//! # Kernel Code //! //! ## Initializes the peripherals //! - UART //! - Allocators #![doc(html_logo_url = "https://raw.githubusercontent.com/rust-embedded/wg/master/assets/logo/ewg-logo-blue-white-on-transparent.png")] #![allow(non_snake_case)] #![allow(clippy::upper_case_acronyms,dead_code)] #![feature(format_args_nl)] #![feature(panic_info_message)] #![feature(trait_alias)] #![feature(exclusive_range_pattern)] #![feature(default_alloc_error_handler)] #![no_main] #![no_std] extern crate alloc; use alloc::boxed::Box; mod console; mod cpu; mod draw; mod mem; mod panic_wait; mod print; mod sync; mod uart; use crate::console::console; use crate::console::interface::Statistics; use crate::mem::alloc::*; /// # Initialization Code /// /// Initializes /// - Allocators /// - UART /// /// After initialization, jump to /// the regular main. unsafe fn kernel_init() -> ! { console().init().unwrap(); ALLOCATOR.init(); kernel_main() } /// # Post-initialization /// /// 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!("Testing out allocations!"); { let a: Box = Box::new(u8::MAX); let b: Box = Box::new(5); println!("{:?} {:?}", a, b); } println!("Characters written to UART: \x1b[91m{}\x1b[0m", console().chars_written()); loop { } }