have to actually learn paging so pushing progress for now

This commit is contained in:
Bryan McShea
2024-01-25 15:11:11 -05:00
parent 86fda4d6fc
commit bdb29a6361
14 changed files with 803 additions and 74 deletions

13
kernel/src/allocator.rs Normal file
View 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);
}
}