summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kobert <dennis@kobert.dev>2019-11-12 17:27:07 +0100
committerDennis Kobert <dennis@kobert.dev>2019-11-12 17:27:07 +0100
commit307571308b115eb737281711c780fa4cd1ed837f (patch)
treee62c15f02690e79610b5e65f4742016762074ba7
parentec22f3464c87b3d1b1688898053a569bc4839404 (diff)
Increase fault handler stack size
-rw-r--r--kernel/.cargo/config2
-rwxr-xr-xkernel/run2
-rw-r--r--kernel/src/interrupts/gdt.rs4
-rw-r--r--kernel/tests/stack_overflow.rs4
4 files changed, 6 insertions, 6 deletions
diff --git a/kernel/.cargo/config b/kernel/.cargo/config
index 17dbb96..4a80025 100644
--- a/kernel/.cargo/config
+++ b/kernel/.cargo/config
@@ -3,4 +3,4 @@ target = "x86_64-uff.json"
rustflags = ["-Clink-arg=-r","-Clink-dead-code"]
[target.'cfg(target_os = "none")']
-runner = "./run test -test"
+runner = "./run test -serial -test"
diff --git a/kernel/run b/kernel/run
index 26eae12..8c52bd9 100755
--- a/kernel/run
+++ b/kernel/run
@@ -127,7 +127,7 @@ for arg in "$@"; do
"test") action=test;;
"help") action=help;;
*)
- echo "warn: ignoring unknown option '$arg'"
+ # echo "warn: ignoring unknown option '$arg'"
kernel_libary=$arg;;
esac
done
diff --git a/kernel/src/interrupts/gdt.rs b/kernel/src/interrupts/gdt.rs
index 8f20092..d75ff68 100644
--- a/kernel/src/interrupts/gdt.rs
+++ b/kernel/src/interrupts/gdt.rs
@@ -10,7 +10,7 @@ lazy_static! {
static ref TSS: TaskStateSegment = {
let mut tss = TaskStateSegment::new();
tss.interrupt_stack_table[DOUBLE_FAULT_IST_INDEX as usize] = {
- const STACK_SIZE: usize = 4096;
+ const STACK_SIZE: usize = 4096 * 4;
static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
let stack_start = VirtAddr::from_ptr(unsafe { &STACK });
@@ -18,7 +18,7 @@ lazy_static! {
stack_end
};
tss.interrupt_stack_table[PAGE_FAULT_IST_INDEX as usize] = {
- const STACK_SIZE: usize = 4096;
+ const STACK_SIZE: usize = 4096 * 8;
static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
let stack_start = VirtAddr::from_ptr(unsafe { &STACK });
diff --git a/kernel/tests/stack_overflow.rs b/kernel/tests/stack_overflow.rs
index dc53537..eedb3b5 100644
--- a/kernel/tests/stack_overflow.rs
+++ b/kernel/tests/stack_overflow.rs
@@ -14,7 +14,7 @@ use kernel::io::qemu;
extern "C" fn _start() -> ! {
kernel::init();
unsafe {
- exceptions::expect_fault(interrupts::Interrupts::PAGE_FAULT);
+ exceptions::expect_fault(interrupts::Interrupts::NOT_PRESENT);
}
_loop(0);
panic!("PAGE_FAULT not caught");
@@ -35,6 +35,6 @@ fn _loop(i: u128) -> u128 {
#[panic_handler]
#[no_mangle]
extern "C" fn panic_handler(info: &core::panic::PanicInfo) -> ! {
- kernel::testing::serial_should_panic(info);
+ kernel::testing::serial_panic(info);
loop {}
}