From ee431b65ef855138dd75dccf1e9cff59a3b96ae6 Mon Sep 17 00:00:00 2001 From: Able Date: Tue, 23 Nov 2021 08:49:41 -0600 Subject: [PATCH] :> --- ableos/notes/GraphicsNote.md | 3 +++ ableos/src/kmain.rs | 14 ++------------ 2 files changed, 5 insertions(+), 12 deletions(-) create mode 100644 ableos/notes/GraphicsNote.md diff --git a/ableos/notes/GraphicsNote.md b/ableos/notes/GraphicsNote.md new file mode 100644 index 0000000..81502eb --- /dev/null +++ b/ableos/notes/GraphicsNote.md @@ -0,0 +1,3 @@ +wgpu + +write using wgpu and compiles to native/web diff --git a/ableos/src/kmain.rs b/ableos/src/kmain.rs index be6186d..3bed61f 100644 --- a/ableos/src/kmain.rs +++ b/ableos/src/kmain.rs @@ -36,7 +36,6 @@ pub fn kernel_main() -> ! { GraphicsBuffer::draw(); GraphicsBuffer::hide_cursor(); GraphicsBuffer::show_cursor(); - seed_rng(); { use alloc::{vec, vec::Vec}; @@ -64,17 +63,7 @@ pub fn kernel_main() -> ! { // crate::arch::shutdown(); sloop() } -// TODO: reimplement for the random handler -pub fn seed_rng() -> PRand { - println!("Seeding PRNG"); - let data = TICK.lock(); - let mut rand = PRand::new(); - let seed = rand.rand(); - println!("{:?}", seed); - rand.seed(*data); - println!("Seeded PRNG"); - rand -} + lazy_static! { // TODO: should have a sin wave influence contribution to entropy pub static ref TICK: spin::Mutex = spin::Mutex::new(0); @@ -86,6 +75,7 @@ pub fn tick() { // serial_println!("{}", *data); RAND_HANDLE.lock().seed_entropy_timer(*data); } + pub fn key_entropy(key: u8) { RAND_HANDLE.lock().seed_entropy_keyboard(key); }