rust-osdev / bootloader

An experimental pure-Rust x86 bootloader
Apache License 2.0
1.31k stars 204 forks source link

How could I use uefi-rs and bootloader together? #183

Closed tux7k closed 2 years ago

tux7k commented 2 years ago

I'm trying to print some text on the screen using UEFI but my project uses bootloader and AFAIK I don't think you can use a different function for uefi-rs other than efi_main, is there any way I can accomplish this somehow?

ethindp commented 2 years ago

No, you can't. The uefi_main/efi_main function is the only way to get access to EFI boot services. The bootloader exits boot services before calling kmain so this is not possible.

tux7k commented 2 years ago

So how would I go about printing text on the screen or something like that without the uefi-rs crate

ethindp commented 2 years ago

@actuallyexeon You need to use the framebuffer that the bootloader gave you. I'm not too sure on the maths required -- I can't really figure that out myself (but would love to know how) -- and though the OSDev wiki has this article I didn't consider it much help. But maybe you'll find it of use.