added boot messages

This commit is contained in:
2025-02-22 21:30:13 +00:00
parent 494d00c53b
commit f9bc75c4f3
2 changed files with 25 additions and 10 deletions
+22 -3
View File
@@ -59,18 +59,37 @@ pub fn boot() -> Result<(), &'static str> {
use arch::x86_64::{gdt, interrupts, memmap, memory};
let memory_map = memmap::get_memory_map();
print_log!(" Initialising Serial... ");
lib_serial::init()?;
println_log!("[Success]");
print_log!(" Setting Up Global Descriptor Table... ");
gdt::init();
println_log!("[Success]");
print_log!(" Setting Up Interrupt Descriptor Table... ");
interrupts::init_idt();
println_log!("[Success]");
print_log!(" Setting Up Page Table... ");
let mut frame_allocator = unsafe { memory::FoundryOSFrameAllocator::init(memory_map) };
println_log!("[Success]");
x86_64::instructions::interrupts::enable();
print_log!(" Initialising Memory Subsystem... ");
let physical_memory_offset = VirtAddr::new(*memmap::PHYSICAL_MEMORY_OFFSET);
let mut l4_table = unsafe { memory::init(physical_memory_offset) };
println_log!("[Success]");
init_heap(&mut l4_table, &mut frame_allocator);
print_log!(" Initialising Heap... ");
if let Err(e) = init_heap(&mut l4_table, &mut frame_allocator) {
return Err("Failed to initialise heap");
}
println_log!("[Success]");
print_log!(" Enabling Interrupts... ");
x86_64::instructions::interrupts::enable();
println_log!("[Success]");
Ok(())
}