1
0
Fork 0
forked from koniifer/ableos
This commit is contained in:
able 2022-07-31 03:03:59 -05:00
parent a4cc9cdf4f
commit d46527108f
3 changed files with 12 additions and 12 deletions

View file

@ -61,7 +61,7 @@ static IDT: Lazy<InterruptDescriptorTable> = Lazy::new(|| {
idt[InterruptIndex::Timer.as_usize()].set_handler_fn(timer_interrupt_handler); idt[InterruptIndex::Timer.as_usize()].set_handler_fn(timer_interrupt_handler);
idt[InterruptIndex::Keyboard.as_usize()].set_handler_fn(keyboard_interrupt_handler); idt[InterruptIndex::Keyboard.as_usize()].set_handler_fn(keyboard_interrupt_handler);
idt[InterruptIndex::Mouse.as_usize()].set_handler_fn(crate::hardware::mouse_interrupt_handler); // idt[InterruptIndex::Mouse.as_usize()].set_handler_fn(crate::hardware::mouse_interrupt_handler);
// run `a + b + l + e + o + s print;` in ablescript and its 54 thats why this seemingly arbitrary number was chosen // run `a + b + l + e + o + s print;` in ablescript and its 54 thats why this seemingly arbitrary number was chosen
idt[54].set_handler_fn(software_int_handler); idt[54].set_handler_fn(software_int_handler);
@ -70,11 +70,11 @@ static IDT: Lazy<InterruptDescriptorTable> = Lazy::new(|| {
}); });
extern "x86-interrupt" fn software_int_handler(stack_frame: InterruptStackFrame) { extern "x86-interrupt" fn software_int_handler(stack_frame: InterruptStackFrame) {
println!("EXCEPTION: SOFTWARE INT\n{:#?}", stack_frame); trace!("EXCEPTION: SOFTWARE INT\n{:#?}", stack_frame);
} }
extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) { extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) {
println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame); trace!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
} }
extern "x86-interrupt" fn double_fault_handler( extern "x86-interrupt" fn double_fault_handler(
@ -90,7 +90,6 @@ extern "x86-interrupt" fn double_fault_handler(
extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFrame) { extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFrame) {
use super::task_switcher; use super::task_switcher;
unsafe { unsafe {
// print!(".");
asm!( asm!(
// Kernel tick // Kernel tick
@ -134,7 +133,7 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStac
// Backspace // Backspace
'\u{8}' => { '\u{8}' => {
// TODO: Fix this and apply to new term // TODO: Fix this and apply to new term
WRITER.lock().backspace(); // WRITER.lock().backspace();
KEYBUFF.lock().push(8.into()); KEYBUFF.lock().push(8.into());
} }
// '^' => KERNEL_STATE.lock().shutdown(), // '^' => KERNEL_STATE.lock().shutdown(),

View file

@ -24,12 +24,13 @@ impl core::fmt::Write for Stdout {
use crate::TERM; use crate::TERM;
trace!("printing"); trace!("printing");
x86_64::instructions::interrupts::without_interrupts(|| { // x86_64::instructions::interrupts::without_interrupts(|| {
let mut term = TERM.lock(); let mut term = TERM.lock();
term.set_dirty(true); term.set_dirty(true);
term.print(s.to_string()); term.print(s.to_string());
drop(term); drop(term);
}); // });
trace!("Finished printing");
Ok(()) Ok(())
} }
#[cfg(target_arch = "riscv64")] #[cfg(target_arch = "riscv64")]

View file

@ -93,7 +93,7 @@ impl Term {
x += 1 x += 1
} }
} }
self.set_dirty(true); self.set_dirty(false);
trace!("Finished drawing"); trace!("Finished drawing");
} }
} }