//! # 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)] #![no_main] #![no_std] mod alloc; mod console; mod cpu; mod panic_wait; mod print; mod sync; mod uart; use crate::console::console; use crate::alloc::*; /// # Initialization Code /// /// Initializes /// - Allocators /// - UART /// /// After initialization, jump to /// the regular main. unsafe fn kernel_init() -> ! { console().init().unwrap(); U64_QUEUE_ALLOCATOR.init(); kernel_main() } /// # Post-initialization /// /// TODO: Figure out what to do here fn kernel_main() -> ! { for idx in 0..30 { if let Some(cell) = U64_QUEUE_ALLOCATOR.alloc() { let inner = cell.inner(); *inner = idx; println!("SUCCESS: Allocated a char! {:?}", cell); U64_QUEUE_ALLOCATOR.free(cell); } else { println!("ERROR: No more chars remaining!"); } } println!("I should be able to print {} here!", 5); loop { } }