#![allow(clippy::empty_loop)] // use acpi::AcpiTables; // use x86_64::instructions::interrupts::{disable, enable}; // use crate::{scratchpad, SCHEDULER, SCREEN_BUFFER}; use { crate::{ arch::{init, sloop}, relib::network::socket::{SimpleSock, Socket}, scratchpad, }, lazy_static::lazy_static, }; lazy_static! { // TODO: Change this structure to allow for multiple cores loaded pub static ref KERNEL_CONF: KernelConfig = KernelConfig::new(); } /// The main entry point of the kernel #[no_mangle] pub fn kernel_main() -> ! { init::init(); if KERNEL_CONF.logging.enabled { log::set_max_level(KERNEL_CONF.log_level()); } else { log::set_max_level(log::LevelFilter::Off); } let mut scheduler = SCHEDULER.lock(); use crate::scheduler::Priority::*; let mut process_1 = scheduler.new_process(High); process_1.capabilities.files = FileAccess::Some(vec![]); scheduler.add_process(process_1); for ref_process in &scheduler.list { trace!("{:?}", ref_process); } drop(scheduler); // start_facepalm(); scratchpad(); sloop() } pub fn cpu_socket_startup() { let mut cpu_info_socket = SimpleSock::new(); cpu_info_socket.register_protocol("CPU_INFO".to_string()); // let x = master().unwrap(); // let _xyz = x.brand_string().unwrap(); } pub fn log_version_data() { info!("{} v{:?}", RELEASE_TYPE, KERNEL_VERSION); info!( "Brand String: ", // master().unwrap().brand_string().unwrap() ); } // TODO: Split up into the randomness and the password generation pub fn generate_process_pass() -> u128 { // TODO: Move this into entropy_pool module // use rdrand::RdRand; // let gen = RdRand::new().unwrap(); // TODO: Split off into process module // let ret = (gen.try_next_u64().unwrap() as u128) << 64 | (gen.try_next_u64().unwrap() as u128); // ret 123 } use kernel::KERNEL_VERSION; use crate::{ boot_conf::KernelConfig, scheduler::{capabilities::FileAccess, SCHEDULER}, systeminfo::RELEASE_TYPE, };