0

I am writing a simple OS and I am now trying to display stuff on the screen rather than just text. and after a little bit of research this is what I got :

  • The simplest way to get graphics modes without using BIOS would be to develop VGA driver. This gives you all low resolution modes on practically all hardware
  • However, if you want to support high resolutions, you must write a driver for each graphics card that you want your OS to support.

But as far as I know you can actually have windows or any other operating system up and running with any resolution without installing the dedicated graphics card drivers, How is that possible .

  • 1
    Windows comes with a huge library of existing drivers and if your computer is online can also potentially download drivers that are not apart of the in-box distribution. – SoronelHaetir Jul 02 '23 at 17:15
  • OSes have drivers for most HW that exists. If not, you're stuck in a low-rez mode using VGA or at best VESA VBE extensions for higher-rez modes (https://wiki.osdev.org/VESA_Video_Modes), and without any hardware acceleration for stuff like filling a rectangle with a solid colour or pattern. (Less important on modern systems with very high write bandwidth from CPU to video RAM, you can just copy pixels with the CPU if you do it with write-combining.) – Peter Cordes Jul 02 '23 at 17:53
  • @SoronelHaetir ok thank you that explains it. but if that's the case why do we have to install dedicated graphics drivers if its already installed ? – Djebbar Abderrahmene Jul 02 '23 at 18:57
  • @PeterCordes VGA was a graphics card, and modern graphics cards simulate the way VGA used to work , so writing a VGA driver for any graphics card is the same as writing a driver for the Original VGA graphics card. is that true or is it just a bunch of bullshit ? – Djebbar Abderrahmene Jul 02 '23 at 19:19
  • @Djebbar Abderrahmene : The device-specific (or updated device-specific) driver enables features the in-box driver might not. Control over in addition to just the resolution, it may allow control over the temperature profile, all sorts of things. Sorry, but I am now blind so specific features of video hardware are no longer particularly meaningful to me. – SoronelHaetir Jul 02 '23 at 19:35
  • @DjebbarAbderrahmene: Most video hardware (and all(?) used in x86 PCs) has at least some basic VGA compatibility, usually at least partly supported by the BIOS. (But see [Does modern PC video hardware support VGA text mode in HW, or does the BIOS emulate it (with System Management Mode)?](https://stackoverflow.com/q/61521819) - typical hardware does support text mode without trapping to an SMI for each store). But think of it just as having a backwards-compat mode; using their native hardware interface, most are completely different from legacy VGA and completely different from each other. – Peter Cordes Jul 02 '23 at 19:52
  • So with VESA mode-setting, you can maybe use most video hardware as a dumb framebuffer with some resolutions higher than VGA, but probably not as high as modern 4k monitors, and maybe not even 1920x1080, I don't know. And certainly only 2D; you won't get 3D acceleration without code that's specific to each different model of hardware. – Peter Cordes Jul 02 '23 at 19:55
  • @PeterCordes Just to make sure I understand this correctly, so VGA is a backwards compatibility mode that simulate the early VGA hardware, just Like x86 processors have real mode to simulate the 8086 processor . – Djebbar Abderrahmene Jul 03 '23 at 10:48
  • Yeah, but much less similar. Supporting real mode is very little trouble for an x86-64 CPU that already has to support 16-bit protected mode, it's just a difference in how setting a segment register updates the base and (not) limit. The machine-code format is basically the same, like same opcodes. But modern video hardware usually won't have any legacy I/O ports, only MMIO addresses, and will parse buffers of commands. – Peter Cordes Jul 03 '23 at 11:58

0 Answers0