FINALLY PAGING AND HEAP WORK WITH REALLY BAD CODE

This commit is contained in:
Bryan McShea
2024-01-28 19:11:27 -05:00
parent 260c5c223a
commit f9e7f85a8c
15 changed files with 472 additions and 274 deletions

View File

@@ -3,11 +3,8 @@ 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);
ALLOCATOR.lock().init(crate::arch::paging::first_free(), crate::arch::paging::free_len());
}
}