Added stub syscall handler
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
#include "../interrupts.hpp"
|
#include "../interrupts.hpp"
|
||||||
#include "idt.hpp"
|
#include "idt.hpp"
|
||||||
|
#include "inthandlers.hpp"
|
||||||
|
|
||||||
kernel::Interrupts::Interrupts()
|
kernel::Interrupts::Interrupts()
|
||||||
{
|
{
|
||||||
|
idt[0] = InterruptDescriptor((void*) &divisionByZero, InterruptDescriptor::INT32, 0);
|
||||||
|
idt[8] = InterruptDescriptor((void*) &doubleFaultHandler, InterruptDescriptor::INT32, 0);
|
||||||
|
idt[0x80] = InterruptDescriptor((void*) &syscallHandler, InterruptDescriptor::INT32, 0);
|
||||||
// Load interrupt handlers
|
// Load interrupt handlers
|
||||||
// Configure PIC
|
// Configure PIC
|
||||||
_lidt();
|
_lidt();
|
||||||
|
|||||||
@@ -13,20 +13,27 @@ __attribute__ ((interrupt))
|
|||||||
void gpFaultHandler(void* frame, unsigned int error)
|
void gpFaultHandler(void* frame, unsigned int error)
|
||||||
{
|
{
|
||||||
*display = 'a';
|
*display = 'a';
|
||||||
asm("hlt");
|
display += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__ ((interrupt))
|
__attribute__ ((interrupt))
|
||||||
void pageFaultHandler(void* frame, unsigned int error)
|
void pageFaultHandler(void* frame, unsigned int error)
|
||||||
{
|
{
|
||||||
*display = '0';
|
*display = '0';
|
||||||
//asm("hlt");
|
display += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__ ((interrupt))
|
__attribute__ ((interrupt))
|
||||||
void doubleFaultHandler(void* frame, unsigned int error)
|
void doubleFaultHandler(void* frame, unsigned int error)
|
||||||
{
|
{
|
||||||
*display = '#';
|
*display = '#';
|
||||||
//asm("hlt");
|
asm("hlt");
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((interrupt))
|
||||||
|
void syscallHandler(void* frame)
|
||||||
|
{
|
||||||
|
*display = 'z';
|
||||||
|
display += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,4 +13,7 @@ void pageFaultHandler(void* frame, unsigned int error);
|
|||||||
__attribute__ ((interrupt))
|
__attribute__ ((interrupt))
|
||||||
void doubleFaultHandler(void* frame, unsigned int error);
|
void doubleFaultHandler(void* frame, unsigned int error);
|
||||||
|
|
||||||
|
__attribute__ ((interrupt))
|
||||||
|
void syscallHandler(void* frame);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user