1
0
Fork 0
forked from AbleOS/ableos

litter todo about

This commit is contained in:
Able 2022-02-07 07:33:40 -06:00
parent 5a1a84b1c7
commit 19f908dac2
3 changed files with 24 additions and 15 deletions

View file

@ -41,7 +41,6 @@ pub fn kernel_main() -> ! {
init::init(); init::init();
log::set_max_level(BOOT_CONF.log_level()); log::set_max_level(BOOT_CONF.log_level());
{
let mut scheduler = SCHEDULER.lock(); let mut scheduler = SCHEDULER.lock();
use crate::scheduler::Priority::*; use crate::scheduler::Priority::*;
@ -55,7 +54,6 @@ pub fn kernel_main() -> ! {
trace!("{:?}", ref_process); trace!("{:?}", ref_process);
} }
drop(scheduler); drop(scheduler);
}
use crate::proto_filetable::file::FileLocations; use crate::proto_filetable::file::FileLocations;
@ -73,6 +71,7 @@ pub fn kernel_main() -> ! {
mode.copy_to_buffer(); mode.copy_to_buffer();
} }
// TODO: create a scratchpad module
if false { if false {
// Currently not implemented // Currently not implemented
let acpi_handler = AcpiStruct {}; let acpi_handler = AcpiStruct {};
@ -115,10 +114,13 @@ pub fn log_version_data() {
master().unwrap().brand_string().unwrap() master().unwrap().brand_string().unwrap()
); );
} }
// TODO: Split up into the randomness and the password generation
pub fn generate_process_pass() -> u128 { pub fn generate_process_pass() -> u128 {
// TODO: Move this into entropy_pool module
use rdrand::RdRand; use rdrand::RdRand;
let gen = RdRand::new().unwrap(); 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); let ret = (gen.try_next_u64().unwrap() as u128) << 64 | (gen.try_next_u64().unwrap() as u128);
ret ret
} }

View file

@ -9,7 +9,9 @@ use log::{Level, Metadata, Record};
use crate::arch::drivers::timer::TIMER_INTERRUPT_HERTZ; use crate::arch::drivers::timer::TIMER_INTERRUPT_HERTZ;
struct SimpleLogger; 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 { impl log::Log for SimpleLogger {
fn enabled(&self, metadata: &Metadata) -> bool { fn enabled(&self, metadata: &Metadata) -> bool {
metadata.level() <= Level::Trace metadata.level() <= Level::Trace

View file

@ -1,3 +1,6 @@
// TODO: refactor this file
// TODO: make STDOUT redirect to a socket owned
// by the process named "stdout"
pub struct Stdout; pub struct Stdout;
use core::fmt::{Arguments, Error}; use core::fmt::{Arguments, Error};
impl Stdout { impl Stdout {
@ -45,7 +48,9 @@ macro_rules! print {
} }
#[macro_export] #[macro_export]
macro_rules! println { macro_rules! println {
// TODO: The panic here should not be here
() =>{ () =>{
// ::core::writeln!($crate::print::Stdout, "\n") // ::core::writeln!($crate::print::Stdout, "\n")
panic![]; panic![];
}; };