have to actually learn paging so pushing progress for now
This commit is contained in:
13
kernel/src/allocator.rs
Normal file
13
kernel/src/allocator.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use linked_list_allocator::LockedHeap;
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOCATOR: LockedHeap = LockedHeap::empty();
|
||||
|
||||
pub const HEAP_START: *mut u8 = 0x9000_0000 as *mut u8;
|
||||
pub const HEAP_SIZE: usize = 100 * 1024;
|
||||
|
||||
pub fn init_heap() {
|
||||
unsafe {
|
||||
ALLOCATOR.lock().init(HEAP_START, HEAP_SIZE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user