rust-osdev / bootloader

An experimental pure-Rust x86 bootloader
Apache License 2.0
1.38k stars 210 forks source link

BIOS booting: Consider framebuffer config of kernel ELF #281

Open phil-opp opened 1 year ago

phil-opp commented 1 year ago

Right now the BIOS implementation does not consider the framebuffer configuration of the kernel. Instead, it just defaults to a hardcoded resolution.

To fix this, we would need to parse the kernel ELF file already in the real mode stages, which could be challenging because of the memory limits in real mode. Alternatively, we could copy the framebuffer settings to a small text file and place this file alongside the kernel executable on the FAT partition.

Freax13 commented 1 year ago

We could load the file in long mode, extract the frame buffer configuration, drop down to real mode, do the VBE calls, and switch back to long mode.

phil-opp commented 1 year ago

Good idea! I never tried going back to real mode from long mode though, so I'm not sure if it will work.