21
Programming with NASM / Re: how to switch video modes (switching to VESA video modes too) in protected mode
« Last post by fredericopissarra on April 13, 2025, 01:01:59 PM »I ran into the same headache back when I was experimenting with writing a small OS kernel for fun. Switching to VESA modes in protected mode easily becomes a rabbit hole. I had to do a bunch of hacks just to get the BIOS to cooperate. The legacy BIOS interrupt (INT 0x10) just won't fly once you're out of real mode, so I remember relying on setting up a trampoline to call into real mode temporarily or using something like a VBE 2.0+ Linear Framebuffer approach after querying video modes beforehand.Yep... OR you could setup and use Virtual 8086 mode (NOT available in x86-64 mode!) to do it... Anyway, it is a nightmare.
Another problems are: Getting the Linear Framebuffer Physical address from ModeBlockInfo strucuture... Often this field is zeroed in VMs like QEMU, for example... And page switching, for double buffering... another nightmare.
This and the Protect Mode Interface, described in VBE 3.0 documentation usually are not present (not even in Option-ROM that a nVidia card puts there)...
Recent Posts