Skip to content

Commit e0b68c6

Browse files
committed
Delete the old bootinfo module
1 parent 4c7f3f2 commit e0b68c6

File tree

4 files changed

+36
-356
lines changed

4 files changed

+36
-356
lines changed

src/boot_info.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,49 @@
11
use crate::memory_map::MemoryRegion;
22
use core::slice;
33

4+
/// This structure represents the information that the bootloader passes to the kernel.
5+
///
6+
/// The information is passed as an argument to the entry point. The entry point function must
7+
/// have the following signature:
8+
///
9+
/// ```ignore
10+
/// pub extern "C" fn(boot_info: &'static BootInfo) -> !;
11+
/// ```
12+
///
13+
/// Note that no type checking occurs for the entry point function, so be careful to
14+
/// use the correct argument types. To ensure that the entry point function has the correct
15+
/// signature, use the [`entry_point`] macro.
416
#[derive(Debug)]
517
pub struct BootInfo {
18+
/// A map of the physical memory regions of the underlying machine.
19+
///
20+
/// The bootloader queries this information from the BIOS/UEFI firmware and translates this
21+
/// information to Rust types. It also marks any memory regions that the bootloader uses in
22+
/// the memory map before passing it to the kernel. Regions marked as usable can be freely
23+
/// used by the kernel.
624
pub memory_regions: &'static mut [MemoryRegion],
25+
/// Information about the framebuffer for screen output if available.
726
pub framebuffer: Option<FrameBuffer>,
27+
/// The virtual address at which the mapping of the physical memory starts.
28+
///
29+
/// Physical addresses can be converted to virtual addresses by adding this offset to them.
30+
///
31+
/// The mapping of the physical memory allows to access arbitrary physical frames. Accessing
32+
/// frames that are also mapped at other virtual addresses can easily break memory safety and
33+
/// cause undefined behavior. Only frames reported as `USABLE` by the memory map in the `BootInfo`
34+
/// can be safely accessed.
35+
///
36+
/// Only available if the `map-physical-memory` config option is enabled.
837
pub physical_memory_offset: Option<u64>,
38+
/// The virtual address of the recursively mapped level 4 page table.
39+
///
40+
/// Only available if the `map-page-table-recursively` config option is enabled.
941
pub recursive_index: Option<u16>,
42+
/// The address of the `RSDP` data structure, which can be use to find the ACPI tables.
43+
///
44+
/// This field is `None` if no `RSDP` was found (for BIOS) or reported (for UEFI).
1045
pub rsdp_addr: Option<u64>,
46+
/// The thread local storage (TLS) template of the kernel executable, if present.
1147
pub tls_template: Option<TlsTemplate>,
1248
pub(crate) _non_exhaustive: (),
1349
}

src/bootinfo/memory_map.rs

Lines changed: 0 additions & 236 deletions
This file was deleted.

0 commit comments

Comments
 (0)