bootloader
bootloader copied to clipboard
VESA video modes
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!
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).
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.
@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:
~~
Disregard, I made some progress.
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 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.