git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added current time syscall, commented some others
[tpg/acess2.git]
/
Kernel
/
arch
/
x86_64
/
errors.c
diff --git
a/Kernel/arch/x86_64/errors.c
b/Kernel/arch/x86_64/errors.c
index
1c68b18
..
9f1d290
100644
(file)
--- a/
Kernel/arch/x86_64/errors.c
+++ b/
Kernel/arch/x86_64/errors.c
@@
-5,6
+5,9
@@
#include <acess.h>
#include <proc.h>
#include <acess.h>
#include <proc.h>
+// === IMPORTS ===
+void MM_PageFault(tVAddr Addr, Uint ErrorCode, tRegs *Regs);
+
// === PROTOTYPES ===
void Error_Handler(tRegs *Regs);
// === PROTOTYPES ===
void Error_Handler(tRegs *Regs);
@@
-25,6
+28,12
@@
void Error_Handler(tRegs *Regs)
{
Uint cr;
{
Uint cr;
+ if( Regs->IntNum == 14 ) {
+ __asm__ __volatile__ ("mov %%cr2, %0":"=r"(cr));
+ MM_PageFault(cr, Regs->ErrorCode, Regs);
+ return ;
+ }
+
Debug_KernelPanic();
Log("CPU Error %x, Code: 0x%x", Regs->IntNum, Regs->ErrorCode);
Debug_KernelPanic();
Log("CPU Error %x, Code: 0x%x", Regs->IntNum, Regs->ErrorCode);
@@
-58,11
+67,13
@@
void Error_Handler(tRegs *Regs)
{
case 6: // #UD
Warning(" Offending bytes: %02x %02x %02x %02x",
{
case 6: // #UD
Warning(" Offending bytes: %02x %02x %02x %02x",
- *(Uint8*)Regs->RIP+0, *(Uint8*)Regs->RIP+1,
- *(Uint8*)Regs->RIP+2, *(Uint8*)Regs->RIP+3);
+ *(Uint8*)(Regs->RIP+0), *(Uint8*)(Regs->RIP+1),
+ *(Uint8*)(Regs->RIP+2), *(Uint8*)(Regs->RIP+3)
+ );
break;
}
break;
}
+ __asm__ __volatile__ ("cli");
for(;;)
__asm__ __volatile__ ("hlt");
}
for(;;)
__asm__ __volatile__ ("hlt");
}
UCC
git Repository :: git.ucc.asn.au