Your modern OS and graphics hardware is way more complex. In DOS you wrote something that took over exclusive access to all the PC hardware and didn't have to multitask or share it with any other apps or code (more or less). You could directly write to hardware memory with no need to have some intermediate layers arbitrating access like today. The hardware itself was extremely simple and just a buffer of bytes that represented pixel colors, not like modern GPUs that are entirely distinct computers themselves that you have to pass messages and cooperate with for rendering even basic pixels.
Check out a modern library like raylib, it makes blasting out pixels on modern hardware easy: https://www.raylib.com/