MCPcopy Create free account
hub / github.com/Ruddle/Fomos / init

Method init

bootloader/kernel/src/memory.rs:58–64  ·  view source on GitHub ↗

Create a FrameAllocator from the passed memory map. This function is unsafe because the caller must guarantee that the passed memory map is valid. The main requirement is that all frames that are marked as `USABLE` in it are really unused.

(memory_map: &'static MemoryRegions)

Source from the content-addressed store, hash-verified

56 /// memory map is valid. The main requirement is that all frames that are marked
57 /// as `USABLE` in it are really unused.
58 pub unsafe fn init(memory_map: &'static MemoryRegions) -> Self {
59 BootInfoFrameAllocator {
60 memory_map,
61 next: 1,
62 buf: ArrayVec::new(),
63 }
64 }
65
66 /// Returns an iterator over the usable frames specified in the memory map.
67 fn usable_frames(&self) -> impl Iterator<Item = PhysFrame> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected