From 4e43cdd041fdbdc85564280079116aeef963f5b2 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Mon, 30 Jan 2012 17:51:53 +0100 Subject: [PATCH] Send 'invalid opcode' exception IPC on OKL4 When an invalid opcode gets executed, OKL4 switches to the kernel debugger console instead of sending an exception IPC to the userland. This patch fixes the problem by removing the code that invokes the debugger console. This patch fixes #95. --- base-okl4/patches/README | 5 ++++ .../invalid_opcode_exception_ipc.patch | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 base-okl4/patches/invalid_opcode_exception_ipc.patch diff --git a/base-okl4/patches/README b/base-okl4/patches/README index 10540b368b..a29c773289 100644 --- a/base-okl4/patches/README +++ b/base-okl4/patches/README @@ -55,6 +55,11 @@ This directory contains patches for the OKL4 kernel version 2.1.1-patch.9. GDT and TSS. As a result, VirtualBox stops with a 'GURU_MEDITATION' error. +:'invalid_opcode_exception_ipc.patch': + + When an invalid opcode gets executed, OKL4 switches to the kernel debugger + console instead of sending an exception IPC to the userland. This patch + fixes the problem by removing the code that invokes the debugger console. Applying the patches -------------------- diff --git a/base-okl4/patches/invalid_opcode_exception_ipc.patch b/base-okl4/patches/invalid_opcode_exception_ipc.patch new file mode 100644 index 0000000000..433640a94b --- /dev/null +++ b/base-okl4/patches/invalid_opcode_exception_ipc.patch @@ -0,0 +1,23 @@ +- send 'invalid opcode' exception IPC to userland instead of switching to the kernel debugger console + +diff --git a/arch/ia32/pistachio/src/exception.cc b/arch/ia32/pistachio/src/exception.cc +--- a/arch/ia32/pistachio/src/exception.cc ++++ b/arch/ia32/pistachio/src/exception.cc +@@ -177,17 +177,6 @@ + printf ("invalid opcode by %t at IP %p\n", current, addr), + "ia32_ud at %x (current=%x)", (u32_t)addr, (u32_t)current); + +- /* instruction emulation, only in user area! */ +- if (space->is_user_area(addr)) { +- switch(space->get_from_user(addr)) { +- case 0xf0: /* lock prefix */ +- /* fall trough */ +- default: +- printf("invalid opcode at IP %p\n", addr); +- enter_kdebug("invalid opcode"); +- } +- } +- + continuation_t cont = ASM_CONTINUATION; + send_exception_ipc(frame, IA32_EXC_INVALIDOPCODE, cont); + }