Function early_printer::init
source · pub fn init(
info: &FramebufferInfo,
page_table: Option<&mut PageTable>
) -> Result<(), &'static str>
Expand description
Initializes a simple graphical framebuffer for early text printing.
Usage
There are two cases in which this function can be called:
- If the given framebuffer info provides the framebuffer’s virtual address,
then the bootloader has already mapped the framebuffer for us.
- In this case, this function can be called before the memory subsystem has been initialized.
- If the given framebuffer info provides a framebuffer’s physical address,
then the bootloader has not mapped anything for us, and thus this function
will attempt to allocate and map a new virtual address to that framebuffer.
- In this case, this function can only be called after the memory subsystem has been initialized.
It is valid (and recommended) to call this function in both circumstances described above, i.e., right after taking over from the bootloader AND again after the memory subsystem has been initialized.