Remove logger
This commit is contained in:
parent
fc93078d3f
commit
8f71fa0771
7
bootloader/bootloader/Cargo.lock
generated
7
bootloader/bootloader/Cargo.lock
generated
@ -54,12 +54,6 @@ dependencies = [
|
|||||||
"scopeguard",
|
"scopeguard",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "log"
|
|
||||||
version = "0.4.22"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "raw-cpuid"
|
name = "raw-cpuid"
|
||||||
version = "10.7.0"
|
version = "10.7.0"
|
||||||
@ -105,7 +99,6 @@ version = "1.0.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"linked_list_allocator",
|
"linked_list_allocator",
|
||||||
"log",
|
|
||||||
"spin",
|
"spin",
|
||||||
"uart_16550",
|
"uart_16550",
|
||||||
]
|
]
|
||||||
|
@ -65,7 +65,6 @@ multiple_crate_versions = "deny"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
linked_list_allocator = "0.10.5"
|
linked_list_allocator = "0.10.5"
|
||||||
log = "0.4.17"
|
|
||||||
spin = "0.9.5"
|
spin = "0.9.5"
|
||||||
uart_16550 = "0.3.2"
|
uart_16550 = "0.3.2"
|
||||||
|
|
||||||
|
@ -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) {}
|
|
||||||
}
|
|
@ -11,7 +11,6 @@ use self::os::{OsMemoryEntry, OsMemoryKind};
|
|||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod os;
|
mod os;
|
||||||
mod logger;
|
|
||||||
mod serial;
|
mod serial;
|
||||||
|
|
||||||
//TODO: allocate this in a more reasonable manner
|
//TODO: allocate this in a more reasonable manner
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use linked_list_allocator::LockedHeap;
|
use linked_list_allocator::LockedHeap;
|
||||||
use spin::Mutex;
|
use spin::Mutex;
|
||||||
|
|
||||||
use crate::logger::LOGGER;
|
|
||||||
use crate::serial_println;
|
use crate::serial_println;
|
||||||
|
|
||||||
use self::memory_map::memory_map;
|
use self::memory_map::memory_map;
|
||||||
@ -55,9 +54,6 @@ pub unsafe extern "C" fn start(
|
|||||||
// Clear screen
|
// Clear screen
|
||||||
VGA.lock().clear();
|
VGA.lock().clear();
|
||||||
|
|
||||||
// Set logger
|
|
||||||
LOGGER.init();
|
|
||||||
|
|
||||||
let (heap_start, heap_size) = memory_map(thunk15).expect("No memory for heap");
|
let (heap_start, heap_size) = memory_map(thunk15).expect("No memory for heap");
|
||||||
|
|
||||||
ALLOCATOR.lock().init(heap_start as *mut u8, heap_size);
|
ALLOCATOR.lock().init(heap_start as *mut u8, heap_size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user