aboutsummaryrefslogtreecommitdiff
path: root/src/kernel.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel.rs')
-rw-r--r--src/kernel.rs53
1 files changed, 44 insertions, 9 deletions
diff --git a/src/kernel.rs b/src/kernel.rs
index 3d93e37..1c3bfac 100644
--- a/src/kernel.rs
+++ b/src/kernel.rs
@@ -27,7 +27,6 @@ mod print;
mod sync;
mod uart;
use crate::console::console;
-use crate::console::interface::Statistics;
use crate::mem::alloc::alloc;
/// # Initialization Code
@@ -48,13 +47,49 @@ unsafe fn kernel_init() -> ! {
///
/// TODO: Figure out what to do here
fn kernel_main() -> ! {
- draw::draw_ukraine_flag();
- println!();
- draw::draw_american_flag();
- println!();
-
- println!("\x1b[91mInitialized\x1b[0m \x1b[92m{}\x1b[0m \x1b[93mv{}\x1b[0m", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
- println!("\x1b[94mAuthors:\x1b[0m \x1b[95m{}\x1b[0m", env!("CARGO_PKG_AUTHORS"));
- println!("Characters written to UART: \x1b[91m{}\x1b[0m", console().chars_written());
+ #[cfg(not(feature="verbose"))]
+ {
+ draw::draw_ukraine_flag();
+ println!();
+ draw::draw_american_flag();
+ println!();
+
+ println!("\x1b[91mInitialized\x1b[0m \x1b[92m{}\x1b[0m \x1b[93mv{}\x1b[0m", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
+ println!("\x1b[94mAuthors:\x1b[0m \x1b[95m{}\x1b[0m", env!("CARGO_PKG_AUTHORS"));
+ use crate::console::interface::Statistics;
+ println!("Characters written to UART: \x1b[91m{}\x1b[0m", console().chars_written());
+ }
+
+ #[cfg(feature="verbose")]
+ {
+ use alloc::boxed::Box;
+ {
+ let a: Box<u8> = Box::new(1);
+ println!("Box: {}", a);
+ }
+ {
+ let a: Box<u8> = Box::new(2);
+ let b: Box<u8> = Box::new(3);
+ let c: Box<u8> = Box::new(4);
+ println!("Boxes: {}, {}, {}", a, b, c);
+ }
+ {
+ let a: Box<u8> = Box::new(5);
+ let b: Box<u8> = Box::new(6);
+ let c: Box<u8> = Box::new(7);
+ 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());
+ }
+ use crate::console::interface::Statistics;
+ println!("Characters written to UART: \x1b[91m{}\x1b[0m", console().chars_written());
+ }
loop { }
}