Use linked list allocator
This commit is contained in:
parent
792ef0b3d2
commit
eccb99d67d
6 changed files with 79 additions and 7 deletions
|
@ -4,7 +4,7 @@ version = "0.1.0"
|
|||
|
||||
[dependencies]
|
||||
bitflags = "*"
|
||||
bump_allocator = { path = "../../alloc/bump_allocator"}
|
||||
hole_list_allocator = { path = "../../alloc/hole_list_allocator"}
|
||||
|
||||
[dependencies.x86]
|
||||
default-features = false
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
#![feature(unique)]
|
||||
#![no_std]
|
||||
|
||||
extern crate hole_list_allocator as allocator;
|
||||
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
extern crate bump_allocator;
|
||||
extern crate x86;
|
||||
|
||||
/// Print to console
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/// It must create the IDT with the correct entries, those entries are
|
||||
/// defined in other files inside of the `arch` module
|
||||
|
||||
use bump_allocator::{HEAP_START, HEAP_SIZE};
|
||||
use allocator::{HEAP_START, HEAP_SIZE};
|
||||
use externs::memset;
|
||||
use gdt;
|
||||
use idt;
|
||||
|
|
|
@ -12,16 +12,16 @@ pub mod area_frame_alloc;
|
|||
static mut MEMORY_MAP: [MemoryArea; 512] = [MemoryArea { base_addr: 0, length: 0, _type: 0, acpi: 0 }; 512];
|
||||
|
||||
/// Memory does not exist
|
||||
const MEMORY_AREA_NULL: u32 = 0;
|
||||
pub const MEMORY_AREA_NULL: u32 = 0;
|
||||
|
||||
/// Memory is free to use
|
||||
const MEMORY_AREA_FREE: u32 = 1;
|
||||
pub const MEMORY_AREA_FREE: u32 = 1;
|
||||
|
||||
/// Memory is reserved
|
||||
const MEMORY_AREA_RESERVED: u32 = 2;
|
||||
pub const MEMORY_AREA_RESERVED: u32 = 2;
|
||||
|
||||
/// Memory is used by ACPI, and can be reclaimed
|
||||
const MEMORY_AREA_ACPI: u32 = 3;
|
||||
pub const MEMORY_AREA_ACPI: u32 = 3;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct MemoryAreaIter {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue