From 1d195d618e8de87cf6e91f42d0b03f150937bba9 Mon Sep 17 00:00:00 2001 From: Able Date: Fri, 28 Jan 2022 07:40:47 -0600 Subject: [PATCH] Redux --- ableos/src/arch/x86_64/interrupts.rs | 14 ++++---------- ableos/src/graphics/mod.rs | 3 +++ ableos/src/kmain.rs | 25 +++++-------------------- ableos/src/tests.rs | 2 +- 4 files changed, 13 insertions(+), 31 deletions(-) diff --git a/ableos/src/arch/x86_64/interrupts.rs b/ableos/src/arch/x86_64/interrupts.rs index 962e318..a55c8c3 100644 --- a/ableos/src/arch/x86_64/interrupts.rs +++ b/ableos/src/arch/x86_64/interrupts.rs @@ -100,26 +100,20 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStac // print!("{}", char::try_from(character).unwrap()); } + + 0x5E => KERNEL_STATE.lock().shutdown(), + _ => { print!("{}", char::try_from(character).unwrap()); } } - - let crazy = true; - if crazy { - let mut xyz = crate::kmain::KEY_BUFFER.lock(); - xyz.push(character.try_into().unwrap()); - // println!("{:?}", &xyz); - - crate::kmain::key_entropy(character.try_into().unwrap()); - } } DecodedKey { kind: DecodedKeyKind::RawKey, value: key, } => match KeyCode::from(key) { KeyCode::AltLeft => {} - // KeyCode::Escape => {} + KeyCode::AltRight => {} _ => { print!("{:?}", KeyCode::from(key)) diff --git a/ableos/src/graphics/mod.rs b/ableos/src/graphics/mod.rs index d625edd..6964d6b 100644 --- a/ableos/src/graphics/mod.rs +++ b/ableos/src/graphics/mod.rs @@ -122,6 +122,9 @@ impl ScreenBuffer { info!("Shaders done"); } + + + // TODO force clear pub fn force_redraw(&mut self) { use shadeable::pixel_format::into_vga_16; diff --git a/ableos/src/kmain.rs b/ableos/src/kmain.rs index dc6f351..b3e6790 100644 --- a/ableos/src/kmain.rs +++ b/ableos/src/kmain.rs @@ -1,29 +1,21 @@ #![allow(clippy::empty_loop)] -use alloc::{format, vec::Vec}; - -use crate::{ - boot_conf::BootConfig, - capabilities::FileAccess, - file::{File, PathRep}, - scheduler::SCHEDULER, - ALIAS_TABLE, -}; - // use crate::scheduler; use { crate::{ arch::{init, sloop}, boot_conf, + boot_conf::BootConfig, + capabilities::FileAccess, experiments::{ info::master, systeminfo::{KERNEL_VERSION, RELEASE_TYPE}, }, - graphics::{VgaBuffer, SCREEN_BUFFER}, + file::{File, PathRep}, + relib::network::socket::SimpleSock, relib::network::socket::Socket, - relib::network::socket::{SimpleSock, SocketReturns}, - vga_e::{self, num_to_vga16}, + scheduler::SCHEDULER, }, alloc::{ string::{String, ToString}, @@ -32,10 +24,6 @@ use { core::sync::atomic::{AtomicU64, Ordering::*}, lazy_static::lazy_static, log::*, - picorand::PicoRandGenerate, - rkyv::{ser::serializers::AllocSerializer, Deserialize}, - shadeable::pixel_format::from_vga_16, - y_compositor_protocol::Version, }; #[no_mangle] @@ -47,7 +35,6 @@ pub extern "C" fn stack_overflow() -> u8 { } lazy_static! { - pub static ref KEY_BUFFER: spin::Mutex = spin::Mutex::new("".to_string()); pub static ref TICK: AtomicU64 = AtomicU64::new(0); pub static ref BOOT_CONF: BootConfig = boot_conf::BootConfig::new(); } @@ -117,8 +104,6 @@ pub fn tick() { TICK.store(data, Relaxed) } -/// called every time a key is pressed to add it to the randomness pool -pub fn key_entropy(key: u8) {} pub fn cpu_socket_startup() { let mut cpu_info_socket = SimpleSock::new(); diff --git a/ableos/src/tests.rs b/ableos/src/tests.rs index 090e39c..d5a2bfd 100644 --- a/ableos/src/tests.rs +++ b/ableos/src/tests.rs @@ -93,7 +93,7 @@ pub fn screen_writer_test() { // sock_print_id.write(format!("1....2....3....4....5....6....7....8....9").into()); for current in (*String::from_utf8_lossy(&sock_print_id.peek().unwrap())).chars() { - vga_e::draw_char(0, 0, current, 0); + vga_e::draw_char(0, 0, current, 0xff000000); } }