cleanup
This commit is contained in:
parent
37d51d2afe
commit
864d2dca4e
2 changed files with 40 additions and 56 deletions
|
|
@ -82,11 +82,10 @@ pub fn kbd_callback() {
|
||||||
static mut CTRL: bool = false;
|
static mut CTRL: bool = false;
|
||||||
static mut ALT: bool = false;
|
static mut ALT: bool = false;
|
||||||
// let terminal_two: vga::terminal::Terminal = vga::Screen::new();
|
// let terminal_two: vga::terminal::Terminal = vga::Screen::new();
|
||||||
let control = unsafe { cpuio::inb(0x64) };
|
let control = cpuio::inb(0x64);
|
||||||
if (control & 1) == 1 {
|
if (control & 1) == 1 {
|
||||||
let scancode = unsafe { cpuio::inb(0x60) };
|
let scancode = cpuio::inb(0x60);
|
||||||
let (is_release, scancode) = check_key_state(scancode);
|
let (is_release, scancode) = check_key_state(scancode);
|
||||||
//TODO implement logic to translate scancode->ascii
|
|
||||||
unsafe {//TODO remove unsafe
|
unsafe {//TODO remove unsafe
|
||||||
match self::KEYMAP_US.get(scancode as usize) {
|
match self::KEYMAP_US.get(scancode as usize) {
|
||||||
Some(b"\0\0") => {
|
Some(b"\0\0") => {
|
||||||
|
|
@ -121,9 +120,7 @@ pub fn kbd_callback() {
|
||||||
},
|
},
|
||||||
Some(_) => {},
|
Some(_) => {},
|
||||||
None =>{},
|
None =>{},
|
||||||
// None => println!("nokey ctrl {:x}", control),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// current_screen.flush();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,10 +55,6 @@ fn shutdown() -> ! {
|
||||||
}
|
}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern fn kmain() -> ! {
|
pub extern fn kmain() -> ! {
|
||||||
// use vga::VgaScreen;
|
|
||||||
// use vga::color::Color;
|
|
||||||
// use vga::color::ColorCode;
|
|
||||||
|
|
||||||
println!(r#" ,--, "#);
|
println!(r#" ,--, "#);
|
||||||
println!(r#" ,--.'| ,----, "#);
|
println!(r#" ,--.'| ,----, "#);
|
||||||
println!(r#" ,--, | : .' .' \ "#);
|
println!(r#" ,--, | : .' .' \ "#);
|
||||||
|
|
@ -78,15 +74,6 @@ pub extern fn kmain() -> ! {
|
||||||
loop {
|
loop {
|
||||||
keyboard::kbd_callback();
|
keyboard::kbd_callback();
|
||||||
}
|
}
|
||||||
// let control = unsafe { cpuio::inb(0x64) };
|
|
||||||
// if (control & 1) == 1 {
|
|
||||||
// let keycode = unsafe { cpuio::inb(0x60) };
|
|
||||||
// match keyboard::KEY_CODE_TO_ASCII.get(keycode as usize) {
|
|
||||||
// Some(ascii) => print!("{}", *ascii as char),
|
|
||||||
// None =>{},
|
|
||||||
// // None => println!("nokey ctrl {:x}", control),
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "eh_personality"] #[no_mangle]
|
#[lang = "eh_personality"] #[no_mangle]
|
||||||
|
|
@ -96,12 +83,12 @@ pub extern fn eh_personality() {
|
||||||
|
|
||||||
#[lang = "panic_fmt"] #[no_mangle]
|
#[lang = "panic_fmt"] #[no_mangle]
|
||||||
pub extern fn panic_fmt(
|
pub extern fn panic_fmt(
|
||||||
// fmt: core::fmt::Arguments, file: &'static str, line: u32
|
fmt: core::fmt::Arguments, file: &'static str, line: u32
|
||||||
)
|
)
|
||||||
-> ! {
|
-> ! {
|
||||||
// println!("PANIC: {}", fmt);
|
println!("PANIC: {}", fmt);
|
||||||
// println!("FILE: {}", file);
|
println!("FILE: {}", file);
|
||||||
// println!("LINE: {}", line);
|
println!("LINE: {}", line);
|
||||||
loop {}
|
loop {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue