summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-01-02 17:31:51 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-01-02 17:31:51 +0100
commited959ff149a5794649312288f87453f63bbbf3c9 (patch)
tree70906a1c4b99da097811a6477f45aeda3d30eb70 /i386
parentcde7c781e172c1fd55f74550b66712540a677d85 (diff)
Handle kernel traps happening before starting userland
* i386/i386/trap.c (kernel_trap): When current_thread is null, assume that we are in kernel land.
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/trap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index 9d4d43d..f1fe634 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -217,9 +217,9 @@ dump_ss(regs);
goto badtrap;
}
} else {
- assert(thread);
- map = thread->task->map;
- if (map == kernel_map) {
+ if (thread)
+ map = thread->task->map;
+ if (!thread || map == kernel_map) {
printf("kernel page fault at %08x:\n", subcode);
dump_ss(regs);
panic("kernel thread accessed user space!\n");