diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/kernel.rs b/src/kernel.rs index 1c3bfac..0043ac0 100644 --- a/src/kernel.rs +++ b/src/kernel.rs @@ -17,6 +17,9 @@ #![no_std] extern crate alloc; +pub use alloc::boxed::Box; +pub use alloc::string::String; +pub use alloc::format; mod console; mod cpu; @@ -62,7 +65,6 @@ fn kernel_main() -> ! { #[cfg(feature="verbose")] { - use alloc::boxed::Box; { let a: Box<u8> = Box::new(1); println!("Box: {}", a); @@ -80,13 +82,14 @@ fn kernel_main() -> ! { println!("Boxes: {}, {}, {}", a, b, c); } println!("U8: {:?}", mem::alloc::U8_GRAND_ALLOC); - use alloc::string::String; { let mut s = String::new(); for _ in 0..128 { s += "TEST"; } println!("String: Length {}", s.capacity()); + let s = format!("{:X}", 0xCAFEBABE as u32); + println!("String: 0x{}", s); } use crate::console::interface::Statistics; println!("Characters written to UART: \x1b[91m{}\x1b[0m", console().chars_written()); |