From a2e5fb565df070825c71fb60e5e70b9a03879073 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Fri, 28 Aug 2009 15:13:28 +0200 Subject: Some changes --- Source/Kernel/SyscallManager/IDT.ns.cpp | 13 ++++++++----- Source/Kernel/SyscallManager/IDT.ns.h | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'Source/Kernel/SyscallManager') diff --git a/Source/Kernel/SyscallManager/IDT.ns.cpp b/Source/Kernel/SyscallManager/IDT.ns.cpp index 6ad17b5..4635f5f 100644 --- a/Source/Kernel/SyscallManager/IDT.ns.cpp +++ b/Source/Kernel/SyscallManager/IDT.ns.cpp @@ -58,9 +58,12 @@ extern "C" void idt_flush(u32int); extern "C" void interrupt_handler(registers_t regs) { if (regs.int_no < 32) { - IDT::handleException(®s, regs.int_no); + IDT::handleException(regs, regs.int_no); } else if (regs.int_no < 48) { - Dev::handleIRQ(®s, (regs.int_no - 32)); + if (regs.int_no >= 40) + outb(0xA0, 0x20); + outb(0x20, 0x20); + Dev::handleIRQ(regs, (regs.int_no - 32)); } } @@ -149,7 +152,7 @@ void init() { idt_flush((u32int)&idt_ptr); } -void handleException(registers_t *regs, int no) { +void handleException(registers_t regs, int no) { asm volatile("cli;"); char* exceptions[] = { "Division by zero", "Debug exception", "Non maskable interrupt", @@ -167,8 +170,8 @@ void handleException(registers_t *regs, int no) { VirtualTerminal *vt = new VirtualTerminal(5, 50, 0, 15); vt->map(); - *vt << "\n Unhandled exception " << (s32int)no << " at " << (u32int)regs->cs << ":" << - (u32int)regs->eip << "\n :: " << exceptions[no]; + *vt << "\n Unhandled exception " << (s32int)no << " at " << (u32int)regs.cs << ":" << + (u32int)regs.eip << "\n :: " << exceptions[no]; asm volatile("hlt"); } diff --git a/Source/Kernel/SyscallManager/IDT.ns.h b/Source/Kernel/SyscallManager/IDT.ns.h index 0a79100..cf8e9f2 100644 --- a/Source/Kernel/SyscallManager/IDT.ns.h +++ b/Source/Kernel/SyscallManager/IDT.ns.h @@ -25,7 +25,7 @@ namespace IDT { }__attribute__((packed)); void init(); - void handleException(registers_t *regs, int no); + void handleException(registers_t regs, int no); } #endif -- cgit v1.2.3