hal_core/
boot.rs

1use crate::mem;
2use core::iter::Iterator;
3
4pub trait BootInfo {
5    type MemoryMap: Iterator<Item = mem::Region>;
6    type Writer: core::fmt::Write;
7    type Framebuffer: crate::framebuffer::Draw;
8
9    /// Returns the boot info's memory map.
10    fn memory_map(&self) -> Self::MemoryMap;
11
12    /// Returns a writer for printing early kernel diagnostics
13    fn writer(&self) -> Self::Writer;
14
15    fn framebuffer(&self) -> Option<Self::Framebuffer>;
16
17    fn bootloader_name(&self) -> &str;
18
19    fn bootloader_version(&self) -> Option<&str> {
20        None
21    }
22
23    fn subscriber(&self) -> Option<tracing::Dispatch> {
24        None
25    }
26
27    fn init_paging(&self);
28
29    // TODO(eliza): figure out a non-bad way to represent boot command lines (is
30    // it reasonable to convert them to rust strs when we barely have an operating
31    // system???)
32}