forked from LowLevelDevs/FoundryOS
totally didn't import an allocator...
This commit is contained in:
@@ -9,9 +9,6 @@ use x86_64::{
|
||||
PhysAddr, VirtAddr,
|
||||
};
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOCATOR: FoundryAllocator = FoundryAllocator;
|
||||
|
||||
/// Returns a mutable reference to the current level 4 page table.
|
||||
///
|
||||
/// # Safety
|
||||
|
||||
+4
-1
@@ -4,6 +4,7 @@
|
||||
extern crate alloc;
|
||||
|
||||
use core::arch::asm;
|
||||
use lib_alloc::allocator::init_heap;
|
||||
use limine::request::{RequestsEndMarker, RequestsStartMarker};
|
||||
use limine::BaseRevision;
|
||||
|
||||
@@ -67,7 +68,9 @@ pub fn boot() -> Result<(), &'static str> {
|
||||
x86_64::instructions::interrupts::enable();
|
||||
|
||||
let physical_memory_offset = VirtAddr::new(*memmap::PHYSICAL_MEMORY_OFFSET);
|
||||
let l4_table = unsafe { memory::init(physical_memory_offset) };
|
||||
let mut l4_table = unsafe { memory::init(physical_memory_offset) };
|
||||
|
||||
init_heap(&mut l4_table, &mut frame_allocator);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use foundry_os::{println, println_log};
|
||||
|
||||
#[no_mangle]
|
||||
@@ -40,5 +44,11 @@ unsafe extern "C" fn kmain() -> ! {
|
||||
"
|
||||
);
|
||||
|
||||
let mut vec = Vec::new();
|
||||
for i in 0..100 {
|
||||
vec.push(i);
|
||||
}
|
||||
println!("{:?}", vec);
|
||||
|
||||
loop {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user