1

I've been interested for a while now in learning about Bare Metal OSes and found this wonderful GitHub by Eugene Obrezkov that gives a basic text shell that works in QEMU. I could not get it to run in VirtualBox though.

https://github.com/ghaiklor/ghaiklor-os-gcc

I want to extend upon it and add a simple boot up splash screen that runs in say 1024x768x24bpp. What is the standard method of doing so on modern computers?

This question though is like asking a few questions. :(

Should I be reading about VBE3? I have a document that I'm reading here:

https://pdos.csail.mit.edu/6.828/2011/readings/hardware/vbe3.pdf

I also took a look at this SE, which says not to use VBE3, which covers a little about graphics mode in UEFI, is it applicable though to a Bare Metal OS that I would test in QEMU or VirtualBox?

Assembly - How to set graphics mode in UEFI (No VGA, No BIOS, Nothing deprecated)

If the answer based on Eugene's initial source is either to use VBE3 or UEFI, which mode do I need to be in among real, protected, or long? This is what I found about switching between modes:

https://www.codeproject.com/Articles/45788/The-Real-Protected-Long-mode-assembly-tutorial-for

John Ernest
  • 785
  • 1
  • 8
  • 20
  • 1
    The code you want to extend uses the traditional BIOS boot method, so using UEFI interfaces is not an option. You can't use VESA interfaces from long mode, so that means if you want to use those interfaces you'd need to switch video modes in the boot sector before it switches to long mode. However, the answer to your question is that the standard method of switching video modes on modern computers running modern operating systems is not to use either the UEFI or VESA interfaces. Instead a video driver is used switch modes. – Ross Ridge Mar 19 '19 at 04:23
  • If you have legacy BIOS on your system you can also consider integrating [`libx86emu`](https://github.com/wfeldt/libx86emu) into your 64-bit kernel. `libx86emu` is a partial x86 emulator with the ability to hook to your kernel when accessing certain memory areas, performing in/out instruction,simulate interrupts etc. it is generally considered enough to drive the VBE legacy BIOS interface. This is all done while remaining in long mode and it can run in ring 0 or ring 3. – Michael Petch Mar 19 '19 at 12:40

1 Answers1

1

What is the standard method of doing so on modern computers?

Windows uses drivers that directly access the graphics card. However, this assumes that you have different drivers for different graphics cards. Without special drivers for a certain graphics card, the maximum is 640x480x16.

More recent Linux versions can either use special drivers or VESA BIOS. For a long time VESA BIOS was the default.

Martin Rosenau
  • 17,897
  • 3
  • 19
  • 38