pub struct BootInfoFrameAllocator { /* private fields */ }
Expand description
A frame allocator that uses the bootloader’s memory map to allocate usable memory frames.
This allocator is initialized with the memory map provided by the bootloader and iterates over the usable memory regions to allocate physical memory frames. It only returns frames from memory regions marked as “Usable.”
Implementations§
Source§impl BootInfoFrameAllocator
impl BootInfoFrameAllocator
Sourcepub unsafe fn init(memory_map: &'static MemoryMap) -> Self
pub unsafe fn init(memory_map: &'static MemoryMap) -> Self
Initializes the BootInfoFrameAllocator
from the bootloader-provided memory map.
This function sets up the allocator to iterate over the usable regions in the memory map.
§Arguments
memory_map
- The memory map provided by the bootloader, detailing the memory regions.
§Safety
This function is unsafe because it relies on the structure and validity of the memory map.
Trait Implementations§
Source§impl FrameAllocator<Size4KiB> for BootInfoFrameAllocator
Allocates memory frames from the usable regions of physical memory.
impl FrameAllocator<Size4KiB> for BootInfoFrameAllocator
Allocates memory frames from the usable regions of physical memory.
This implementation of FrameAllocator
uses the bootloader’s memory map to allocate usable
memory frames for the kernel.