diff options
author | NatrixAeria <upezu@student.kit.edu> | 2021-04-16 15:12:45 +0200 |
---|---|---|
committer | NatrixAeria <upezu@student.kit.edu> | 2021-04-16 15:12:45 +0200 |
commit | 75bd5249ada7825ff751e61434a4a7fc7b4f140a (patch) | |
tree | 1e5d8e429fac3897a979e3a78722459eaffbeb1e | |
parent | 9fcfcbbf16d05d294aadb9b88db0f004ba802bea (diff) |
Fix offsetting in vga text buffer
-rw-r--r-- | kernel/src/io/vga_text.rs | 1 | ||||
-rw-r--r-- | kernel/tests/stack_overflow.rs | 9 |
2 files changed, 4 insertions, 6 deletions
diff --git a/kernel/src/io/vga_text.rs b/kernel/src/io/vga_text.rs index c6d8731..890defb 100644 --- a/kernel/src/io/vga_text.rs +++ b/kernel/src/io/vga_text.rs @@ -223,6 +223,7 @@ impl<'a> VgaTerminalControllerLock<'a> { chars.as_ptr(), core::mem::size_of::<VgaChar>() * chars.len(), ); + *self.lock = self.lock.offset(chars.len() as isize); } } } diff --git a/kernel/tests/stack_overflow.rs b/kernel/tests/stack_overflow.rs index fc93376..7427d3a 100644 --- a/kernel/tests/stack_overflow.rs +++ b/kernel/tests/stack_overflow.rs @@ -16,8 +16,7 @@ extern "C" fn _start() -> ! { exception_handlers::expect_fault(interrupts::InterruptType::PageFault); } _loop(0); - panic!("PAGE_FAULT not caught"); - loop {} + panic!("PAGE_FAULT not caught") } fn _loop(i: u128) -> u128 { @@ -25,8 +24,7 @@ fn _loop(i: u128) -> u128 { return i; } let n = i; - let mut stdout = kernel::OStream::new(); - write!(&mut stdout, "{:x}", &n as *const u128 as u128).unwrap(); + kernel::vga_println!("{:x}", &n as *const u128 as u128); _loop(i + 1) } @@ -34,6 +32,5 @@ fn _loop(i: u128) -> u128 { #[panic_handler] #[no_mangle] extern "C" fn panic_handler(info: &core::panic::PanicInfo) -> ! { - kernel::testing::serial_panic(info); - loop {} + kernel::testing::serial_panic(info) } |