From 19f908dac2a6be3124b41f4913ee13faee9298a9 Mon Sep 17 00:00:00 2001 From: Able Date: Mon, 7 Feb 2022 07:33:40 -0600 Subject: [PATCH] litter todo about --- ableos/src/kmain.rs | 30 ++++++++++++++++-------------- ableos/src/logger.rs | 4 +++- ableos/src/print.rs | 5 +++++ 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ableos/src/kmain.rs b/ableos/src/kmain.rs index 5b38e789..7e0858cf 100644 --- a/ableos/src/kmain.rs +++ b/ableos/src/kmain.rs @@ -41,21 +41,19 @@ pub fn kernel_main() -> ! { init::init(); log::set_max_level(BOOT_CONF.log_level()); - { - let mut scheduler = SCHEDULER.lock(); + let mut scheduler = SCHEDULER.lock(); - use crate::scheduler::Priority::*; - let mut process_1 = scheduler.new_process(High); - process_1.capabilities.files = FileAccess::Some(vec![PathRep { - location: FileLocations::Home, - file_name: "test".to_string(), - }]); - scheduler.add_process(process_1); - for ref_process in &scheduler.list { - trace!("{:?}", ref_process); - } - drop(scheduler); + use crate::scheduler::Priority::*; + let mut process_1 = scheduler.new_process(High); + process_1.capabilities.files = FileAccess::Some(vec![PathRep { + location: FileLocations::Home, + file_name: "test".to_string(), + }]); + scheduler.add_process(process_1); + for ref_process in &scheduler.list { + trace!("{:?}", ref_process); } + drop(scheduler); use crate::proto_filetable::file::FileLocations; @@ -73,6 +71,7 @@ pub fn kernel_main() -> ! { mode.copy_to_buffer(); } + // TODO: create a scratchpad module if false { // Currently not implemented let acpi_handler = AcpiStruct {}; @@ -115,10 +114,13 @@ pub fn log_version_data() { 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 } diff --git a/ableos/src/logger.rs b/ableos/src/logger.rs index 64ae5e8b..0fa1e4b3 100644 --- a/ableos/src/logger.rs +++ b/ableos/src/logger.rs @@ -9,7 +9,9 @@ use log::{Level, Metadata, Record}; use crate::arch::drivers::timer::TIMER_INTERRUPT_HERTZ; struct SimpleLogger; - +// TODO: Rebuild this to take advantage of sockets +// DETAIL: Log to a socket instead of the screen +// So that we can log in the kernel and display it in userland impl log::Log for SimpleLogger { fn enabled(&self, metadata: &Metadata) -> bool { metadata.level() <= Level::Trace diff --git a/ableos/src/print.rs b/ableos/src/print.rs index 59ea1fbc..710f4f77 100644 --- a/ableos/src/print.rs +++ b/ableos/src/print.rs @@ -1,3 +1,6 @@ +// TODO: refactor this file +// TODO: make STDOUT redirect to a socket owned +// by the process named "stdout" pub struct Stdout; use core::fmt::{Arguments, Error}; impl Stdout { @@ -45,7 +48,9 @@ macro_rules! print { } #[macro_export] macro_rules! println { + // TODO: The panic here should not be here () =>{ + // ::core::writeln!($crate::print::Stdout, "\n") panic![]; };