summaryrefslogtreecommitdiff
path: root/Source/Kernel/SyscallManager
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-23 08:13:15 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-23 08:13:15 +0200
commit5e5b36b281d951433d8db71ae898a9dc3272384a (patch)
tree41ce80e62d121620db1c4fffc5b8e117ab8b32c5 /Source/Kernel/SyscallManager
parentdc37d089e8ca98ff2dc8a320c21fc3ac0a87eaa6 (diff)
downloadMelon-5e5b36b281d951433d8db71ae898a9dc3272384a.tar.gz
Melon-5e5b36b281d951433d8db71ae898a9dc3272384a.zip
Fixed a bug with paging/tasking.
Diffstat (limited to 'Source/Kernel/SyscallManager')
-rw-r--r--Source/Kernel/SyscallManager/IDT.ns.h1
-rw-r--r--Source/Kernel/SyscallManager/IDT.wtf.asm6
2 files changed, 7 insertions, 0 deletions
diff --git a/Source/Kernel/SyscallManager/IDT.ns.h b/Source/Kernel/SyscallManager/IDT.ns.h
index e73a885..ea8372a 100644
--- a/Source/Kernel/SyscallManager/IDT.ns.h
+++ b/Source/Kernel/SyscallManager/IDT.ns.h
@@ -4,6 +4,7 @@
#include <common.h>
struct registers_t {
+ u32int cr3; //Page directory
u32int ds; // Data segment selector
u32int edi, esi, ebp, esp, ebx, edx, ecx, eax; // Pushed by pusha.
u32int int_no, err_code; // Interrupt number and error code (if applicable)
diff --git a/Source/Kernel/SyscallManager/IDT.wtf.asm b/Source/Kernel/SyscallManager/IDT.wtf.asm
index b94612e..630b2fb 100644
--- a/Source/Kernel/SyscallManager/IDT.wtf.asm
+++ b/Source/Kernel/SyscallManager/IDT.wtf.asm
@@ -116,8 +116,14 @@ interrupt_common_stub:
mov fs, ax
mov gs, ax
+ mov eax, cr3
+ push eax
+
call interrupt_handler
+ pop eax
+ mov cr3, eax
+
pop eax ; reload the original data segment descriptor
mov ds, ax
mov es, ax