diff --git a/bootloader/bootloader/Cargo.lock b/bootloader/bootloader/Cargo.lock index 4f4cb6e..9657937 100644 --- a/bootloader/bootloader/Cargo.lock +++ b/bootloader/bootloader/Cargo.lock @@ -54,12 +54,6 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - [[package]] name = "raw-cpuid" version = "10.7.0" @@ -105,7 +99,6 @@ version = "1.0.0" dependencies = [ "lazy_static", "linked_list_allocator", - "log", "spin", "uart_16550", ] diff --git a/bootloader/bootloader/Cargo.toml b/bootloader/bootloader/Cargo.toml index 932fb42..cff0838 100644 --- a/bootloader/bootloader/Cargo.toml +++ b/bootloader/bootloader/Cargo.toml @@ -65,7 +65,6 @@ multiple_crate_versions = "deny" [dependencies] linked_list_allocator = "0.10.5" -log = "0.4.17" spin = "0.9.5" uart_16550 = "0.3.2" diff --git a/bootloader/bootloader/src/logger.rs b/bootloader/bootloader/src/logger.rs deleted file mode 100644 index 09d210e..0000000 --- a/bootloader/bootloader/src/logger.rs +++ /dev/null @@ -1,26 +0,0 @@ -use log::{LevelFilter, Log, Metadata, Record}; - -pub static LOGGER: Logger = Logger; - -pub struct Logger; - -impl Logger { - pub fn init(&'static self) { - log::set_logger(self).unwrap(); - log::set_max_level(LevelFilter::Info); - } -} - -impl Log for Logger { - fn enabled(&self, _metadata: &Metadata<'_>) -> bool { - true - } - - fn log(&self, record: &Record<'_>) { - if self.enabled(record.metadata()) { - println!("{} - {}", record.level(), record.args()); - } - } - - fn flush(&self) {} -} diff --git a/bootloader/bootloader/src/main.rs b/bootloader/bootloader/src/main.rs index b0458d5..92073c1 100644 --- a/bootloader/bootloader/src/main.rs +++ b/bootloader/bootloader/src/main.rs @@ -11,7 +11,6 @@ use self::os::{OsMemoryEntry, OsMemoryKind}; #[macro_use] mod os; -mod logger; mod serial; //TODO: allocate this in a more reasonable manner diff --git a/bootloader/bootloader/src/os/bios/mod.rs b/bootloader/bootloader/src/os/bios/mod.rs index 8261440..e9d95fe 100644 --- a/bootloader/bootloader/src/os/bios/mod.rs +++ b/bootloader/bootloader/src/os/bios/mod.rs @@ -1,7 +1,6 @@ use linked_list_allocator::LockedHeap; use spin::Mutex; -use crate::logger::LOGGER; use crate::serial_println; use self::memory_map::memory_map; @@ -55,9 +54,6 @@ pub unsafe extern "C" fn start( // Clear screen VGA.lock().clear(); - // Set logger - LOGGER.init(); - let (heap_start, heap_size) = memory_map(thunk15).expect("No memory for heap"); ALLOCATOR.lock().init(heap_start as *mut u8, heap_size);