From bbbde8fd0dca7d0248da04dae12221ed1043afd4 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Sat, 20 Aug 2022 13:09:05 -0700 Subject: Output Initialization info --- Makefile | 4 ++-- src/kernel.rs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e20e93a..f2e1fa6 100644 --- a/Makefile +++ b/Makefile @@ -29,10 +29,10 @@ doc: @RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" cargo doc $(COMPILER_ARGS) clean: - rm -rf target + -@rm -rf target run: build - qemu-system-arm -cpu cortex-a7 -m 1G -kernel target/armv7a-none-eabi/release/kernel -machine raspi2b -serial mon:stdio -nographic + @qemu-system-arm -cpu cortex-a7 -m 1G -kernel target/armv7a-none-eabi/release/kernel -machine raspi2b -serial mon:stdio -nographic init: rustup target install $(TARGET) diff --git a/src/kernel.rs b/src/kernel.rs index c25e148..e0cd343 100644 --- a/src/kernel.rs +++ b/src/kernel.rs @@ -27,6 +27,7 @@ mod print; mod sync; mod uart; use crate::console::console; +use crate::console::interface::Statistics; use crate::mem::alloc::*; /// # Initialization Code @@ -47,11 +48,13 @@ unsafe fn kernel_init() -> ! { /// /// TODO: Figure out what to do here fn kernel_main() -> ! { - println!("I should be able to print {} here!", 5); + println!("Initialized \x1b[92m{}\x1b[0m \x1b[93m{}\x1b[0m!", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); + println!("Testing out allocations!"); { let a: Box = Box::new(u8::MAX); let b: Box = Box::new(5); println!("{:?} {:?}", a, b); } + println!("Characters written to UART: {}", console().chars_written()); loop { } } -- cgit v1.2.1