Skip to content

Commit

Permalink
Fix panic due to not popping
Browse files Browse the repository at this point in the history
  • Loading branch information
svelterust committed Jan 30, 2024
1 parent 733b3ba commit cf6a03b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions os/src/interrupts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStac
// Get access to writer
let mut vga = vga::WRITER.lock();
vga.delete_character();
repl::pop();
}
DecodedKey::Unicode(character) => {
if character == '\n' {
Expand Down
2 changes: 1 addition & 1 deletion os/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! {
#[cfg(not(test))]
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
println!("{}", info);
println!("\n{}", info);
knarkos::hlt_loop();
}

Expand Down
5 changes: 5 additions & 0 deletions os/src/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ lazy_static! {
};
}

pub fn pop() {
let mut prompt = PROMPT.lock();
prompt.pop();
}

pub fn push(character: char) {
match character as u8 {
0x20..=0x7e => {
Expand Down

0 comments on commit cf6a03b

Please sign in to comment.