This commit is contained in:
Able 2022-01-28 07:40:47 -06:00
parent 0404fdd41f
commit 1d195d618e
4 changed files with 13 additions and 31 deletions

View file

@ -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))

View file

@ -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;

View file

@ -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<String> = 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();

View file

@ -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);
}
}