[][src]Struct sunrise_bootstrap::frame_alloc::FrameAllocator

pub struct FrameAllocator;

A physical memory manger to allocate and free memory frames

Implementations

impl FrameAllocator[src]

pub fn init(boot_info: &BootInformation)[src]

Initialize the FrameAllocator by parsing the multiboot information and marking some memory areas as unusable

fn check_initialized(bitmap: &AllocatorBitmap)[src]

Panics if the frames bitmap was not initialized

fn mark_area_reserved(bitmap: &mut [u8], start_addr: usize, end_addr: usize)[src]

Marks a physical memory area as reserved and will never give it when requesting a frame. This is used to mark where memory holes are, or where the kernel was mapped

Panic

Does not panic if it overwrites an existing reservation

fn mark_area_free(bitmap: &mut [u8], start_addr: usize, end_addr: usize)[src]

Marks a physical memory area as free for frame allocation

Panic

Does not panic if it overwrites an existing reservation

pub fn alloc_frame() -> Frame[src]

Allocates a free frame

Panic

Panics if it cannot find a free frame. This is fine for now when we have plenty of memory and should not happen, but in the future we should return an Error type

pub fn alloc_contiguous_frames(count: usize) -> PhysicalAddress[src]

Allocates count contiguous frames.

Panic

Panics if it cannot find count contiguous free frame.

fn free_frame(frame: &Frame)[src]

Frees an allocated frame.

Panic

Panics if the frame was not allocated

Auto Trait Implementations

impl RefUnwindSafe for FrameAllocator

impl Send for FrameAllocator

impl Sync for FrameAllocator

impl Unpin for FrameAllocator

impl UnwindSafe for FrameAllocator

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.