Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BitmapAllocator ¶
type BitmapAllocator struct {
// contains filtered or unexported fields
}
BitmapAllocator implements a physical frame allocator that tracks frame reservations across the available memory pools using bitmaps.
func (*BitmapAllocator) AllocFrame ¶
func (alloc *BitmapAllocator) AllocFrame() (mm.Frame, *kernel.Error)
AllocFrame reserves and returns a physical memory frame. An error will be returned if no more memory can be allocated.
func (*BitmapAllocator) FreeFrame ¶
func (alloc *BitmapAllocator) FreeFrame(frame mm.Frame) *kernel.Error
FreeFrame releases a frame previously allocated via a call to AllocFrame. Trying to release a frame not part of the allocator pools or a frame that is already marked as free will cause an error to be returned.
type BootMemAllocator ¶
type BootMemAllocator struct {
// contains filtered or unexported fields
}
BootMemAllocator implements a rudimentary physical memory allocator which is used to bootstrap the kernel.
The allocator implementation uses the memory region information provided by the bootloader to detect free memory blocks and return the next available free frame. Allocations are tracked via an internal counter that contains the last allocated frame.
Due to the way that the allocator works, it is not possible to free allocated pages. Once the kernel is properly initialized, the allocated blocks will be handed over to a more advanced memory allocator that does support freeing.
func (*BootMemAllocator) AllocFrame ¶
func (alloc *BootMemAllocator) AllocFrame() (mm.Frame, *kernel.Error)
AllocFrame scans the system memory regions reported by the bootloader and reserves the next available free frame.
AllocFrame returns an error if no more memory can be allocated.