bootloader icon indicating copy to clipboard operation
bootloader copied to clipboard

VESA video modes

Open skyne98 opened this issue 7 years ago • 5 comments

Hello there! I need to start by saying that this project is awesome and I strongly believe it will spark the creation of some very creative pieces of software!

Nevertheless, I think it would have being awesome to add support for choosing one of the available VESA modes. Right now, you have to do it in real-time mode, while bootloader switches the processor to go to 64-bits and therefore, if you need to work with it, then you need to somehow go back to 16-bits in the kernel (or 32-bits with emulation?) and do the setup. Making bootloader do it might be the best idea (as well as give it an option to automatically choose the highest option).

As far as I understand, it can be quite a challenge, considering you have to fit it into 16-bit processor mode memory (512 first bytes?), but as far as I know, it is rather doable.

I think that this implementation from Redox OS can serve as a good example.

Cheers, Alex!

skyne98 avatar Dec 06 '18 08:12 skyne98

Thank you!

I just added support for a small 320x200 vga frame buffer in https://github.com/rust-osdev/bootloader/pull/35. Support for VESA is definitely planned, I just don't have the time to work on it right now. Pull requests are welcome!

I think we can start simpler than the Redox solution and just use a fixed resolution instead of offering all possible resolutions to the user (we can still add that later if we want).

phil-opp avatar Dec 06 '18 12:12 phil-opp

I think that the best solution right now would be to automatically choose the best (the highest) resolution available. It seems to be a safe choice.

skyne98 avatar Dec 06 '18 15:12 skyne98

@phil-opp ~~I started taking a crack at this and I would welcome any help. I added code to query the BIOS for VESA information, but it fails when running the bootloader+example-kernel in qemu. See below: Screenshot_20190622_111215~~ Disregard, I made some progress.

jabedude avatar Jun 22 '19 15:06 jabedude

How do I enable this feature? I have some cute ascii art that my OS prints whenever there is a double fault, and it currently doesn't fit on the screen >.<

just-chillin avatar Nov 26 '20 03:11 just-chillin

@just-chillin You have to enable the vga_320x200 crate feature of the bootloader and change the framebuffer address to 0xa0000. Note that this will become much easier with the upcoming rewrite implemented in https://github.com/rust-osdev/bootloader/pull/130, but unfortunately it is not quite ready yet.

phil-opp avatar Dec 16 '20 12:12 phil-opp