added boot messages
This commit is contained in:
+22
-3
@@ -59,18 +59,37 @@ pub fn boot() -> Result<(), &'static str> {
|
|||||||
use arch::x86_64::{gdt, interrupts, memmap, memory};
|
use arch::x86_64::{gdt, interrupts, memmap, memory};
|
||||||
|
|
||||||
let memory_map = memmap::get_memory_map();
|
let memory_map = memmap::get_memory_map();
|
||||||
|
|
||||||
|
print_log!(" Initialising Serial... ");
|
||||||
lib_serial::init()?;
|
lib_serial::init()?;
|
||||||
|
println_log!("[Success]");
|
||||||
|
|
||||||
|
print_log!(" Setting Up Global Descriptor Table... ");
|
||||||
gdt::init();
|
gdt::init();
|
||||||
|
println_log!("[Success]");
|
||||||
|
|
||||||
|
print_log!(" Setting Up Interrupt Descriptor Table... ");
|
||||||
interrupts::init_idt();
|
interrupts::init_idt();
|
||||||
|
println_log!("[Success]");
|
||||||
|
|
||||||
|
print_log!(" Setting Up Page Table... ");
|
||||||
let mut frame_allocator = unsafe { memory::FoundryOSFrameAllocator::init(memory_map) };
|
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 physical_memory_offset = VirtAddr::new(*memmap::PHYSICAL_MEMORY_OFFSET);
|
||||||
let mut l4_table = unsafe { memory::init(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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-7
@@ -12,11 +12,13 @@ unsafe extern "C" fn kmain() -> ! {
|
|||||||
// All limine requests must also be referenced in a called function, otherwise they may be
|
// All limine requests must also be referenced in a called function, otherwise they may be
|
||||||
// removed by the linker.
|
// removed by the linker.
|
||||||
|
|
||||||
println_log!(" [ Initialising ] ");
|
println_log!(" [ Initialising Kernel Systems ] ");
|
||||||
if let Err(err) = foundry_os::boot() {
|
if let Err(err) = foundry_os::boot() {
|
||||||
panic!("{}", err);
|
panic!("{}", err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println_log!("[ Kernel Initialised Successfully ] ");
|
||||||
|
|
||||||
let dimensions = lib_ascii::screensize_chars();
|
let dimensions = lib_ascii::screensize_chars();
|
||||||
let dimensions2 = lib_framebuffer::screensize_px();
|
let dimensions2 = lib_framebuffer::screensize_px();
|
||||||
|
|
||||||
@@ -44,11 +46,5 @@ unsafe extern "C" fn kmain() -> ! {
|
|||||||
"
|
"
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut vec = Vec::new();
|
|
||||||
for i in 0..100 {
|
|
||||||
vec.push(i);
|
|
||||||
}
|
|
||||||
println!("{:?}", vec);
|
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user