Update boot prints to be a little less noisy.
TODO: * Debugging, tracing support. * Logging infra so we can may pass a loglevel like on Linux.
This commit is contained in:
+11
-12
@@ -1,6 +1,5 @@
|
||||
#![no_std]
|
||||
#![feature(abi_x86_interrupt)]
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![warn(
|
||||
clippy::correctness,
|
||||
clippy::nursery,
|
||||
@@ -20,6 +19,7 @@ use crate::{
|
||||
drivers::{
|
||||
ascii::screensize_chars, framebuffer::display::screensize_px,
|
||||
},
|
||||
gdt, interrupts,
|
||||
memory::{
|
||||
FRAME_ALLOCATOR,
|
||||
allocation::{
|
||||
@@ -35,7 +35,7 @@ use crate::{
|
||||
use alloc::{boxed::Box, format};
|
||||
use core::arch::asm;
|
||||
use limine::BaseRevision;
|
||||
use std::unwind::UNWINDER;
|
||||
use std::{debug, unwind::UNWINDER};
|
||||
use x86_64::VirtAddr;
|
||||
|
||||
pub mod arch;
|
||||
@@ -88,8 +88,6 @@ pub fn boot() -> Result<(), Box<dyn core::error::Error>> {
|
||||
return Err("Base revision not supported.".into());
|
||||
}
|
||||
|
||||
use arch::x86_64::{gdt, interrupts};
|
||||
|
||||
let memory_map = mapping::get_memory_map();
|
||||
|
||||
print_log!(" Initialising Serial... ");
|
||||
@@ -101,12 +99,11 @@ pub fn boot() -> Result<(), Box<dyn core::error::Error>> {
|
||||
debugln!("[Success]");
|
||||
}
|
||||
|
||||
debugln!(" Display...");
|
||||
let dimensions = screensize_chars();
|
||||
let dimensions2 = screensize_px();
|
||||
debugln!(" => (px) : {}x{} ", dimensions2.0, dimensions2.1);
|
||||
debugln!(" => (chars) : {}x{} ", dimensions.0, dimensions.1);
|
||||
debugln!(" [Success]");
|
||||
debugln!(
|
||||
"Display is {:?} chars, {:?} px.",
|
||||
screensize_chars(),
|
||||
screensize_px()
|
||||
);
|
||||
|
||||
debug!(" Setting Up Global Descriptor Table... ");
|
||||
gdt::init();
|
||||
@@ -152,9 +149,11 @@ pub fn boot() -> Result<(), Box<dyn core::error::Error>> {
|
||||
x86_64::instructions::interrupts::enable();
|
||||
debugln!("[Success]");
|
||||
|
||||
// Initialises the Unwinder once and only once because this makes a heap
|
||||
// allocation.
|
||||
// Initialises the stack unwinder once and only once because this makes a
|
||||
// heap allocation.
|
||||
debug!(" Initializing Stack Unwinder... ");
|
||||
UNWINDER.lock();
|
||||
debugln!("[Success]");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user