ISR
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
#include <kernel/kernio.h>
|
||||
|
||||
struct Regs_t {
|
||||
unsigned int gs, fs, es, ds; /* pushed the segs last */
|
||||
unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax; /* pushed by 'pusha' */
|
||||
unsigned int int_no, err_code; /* our 'push byte #' and ecodes do this */
|
||||
unsigned int eip, cs, eflags, useresp, ss; /* pushed by the processor automatically */
|
||||
unsigned int gs, fs, es, ds; /* pushed the segs last */
|
||||
unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax; /* pushed by 'pusha' */
|
||||
unsigned int int_no, err_code; /* our 'push byte #' and ecodes do this */
|
||||
unsigned int eip, cs, eflags, useresp, ss; /* pushed by the processor automatically */
|
||||
};
|
||||
|
||||
char *PanicMessage[] = {
|
||||
@@ -48,7 +48,6 @@ char *PanicMessage[] = {
|
||||
extern "C" {
|
||||
|
||||
void DEFAULT_ISR() {
|
||||
Write("SMH \n");
|
||||
outb(0x20,0x20);
|
||||
}
|
||||
|
||||
@@ -57,12 +56,13 @@ void KeyboardHandler() {
|
||||
outb(0x20,0x20);
|
||||
}
|
||||
|
||||
void FaultHandler(struct Regs_t *r) {
|
||||
uint32_t val;
|
||||
asm volatile ( "mov %%cr2, %0" : "=r"(val) );
|
||||
PanicKernel(val, PanicMessage[r->int_no]);
|
||||
for (;;)
|
||||
asm("hlt");
|
||||
void FaultHandler(struct Regs_t* r) {
|
||||
if (r->int_no < 32) {
|
||||
uint32_t val;
|
||||
asm volatile ( "mov %%cr2, %0" : "=r"(val) );
|
||||
PanicKernel(val, PanicMessage[r->int_no], "kernel/isr.cpp:64", "FaultHandler(struct Regs_t* r)");
|
||||
for(;;) {}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user