mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-18 07:17:49 +00:00
Use linked_list_allocator crate instead of dummy allocator
This commit is contained in:
@@ -30,6 +30,10 @@ pub fn init_heap(
|
||||
unsafe { mapper.map_to(page, frame, flags, frame_allocator)?.flush() };
|
||||
}
|
||||
|
||||
unsafe {
|
||||
super::ALLOCATOR.lock().init(HEAP_START, HEAP_SIZE);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
extern crate alloc;
|
||||
|
||||
use core::panic::PanicInfo;
|
||||
use linked_list_allocator::LockedHeap;
|
||||
|
||||
pub mod allocator;
|
||||
pub mod gdt;
|
||||
@@ -18,7 +19,7 @@ pub mod serial;
|
||||
pub mod vga_buffer;
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOCATOR: allocator::Dummy = allocator::Dummy;
|
||||
static ALLOCATOR: LockedHeap = LockedHeap::empty();
|
||||
|
||||
pub fn init() {
|
||||
gdt::init();
|
||||
|
||||
Reference in New Issue
Block a user