Added sequence to remap PIC

Wrote GDT code in C
Added routines to initialize GDT and IDT
This commit is contained in:
2021-04-16 01:45:40 -05:00
parent 8e6589b472
commit 6138766c49
7 changed files with 223 additions and 74 deletions

View File

@@ -2,6 +2,12 @@
#include "stdio.h"
#include "apic.h"
__attribute__ ((interrupt))
void isr_generic(void* frame)
{
printf("Generic interrupt.\n");
}
__attribute__ ((interrupt))
void isr_division_by_zero(void* frame)
{
@@ -11,18 +17,22 @@ void isr_division_by_zero(void* frame)
__attribute__ ((interrupt))
void isr_gp_fault(void* frame, unsigned int error)
{
asm("cli");
printf("Exception: GP fault, code %08x\n", error);
asm("hlt");
}
__attribute__ ((interrupt))
void isr_page_fault(void* frame, unsigned int error)
{
printf("Exception: Page fault\n");
}
__attribute__ ((interrupt))
void isr_double_fault(void* frame, unsigned int error)
{
asm("cli");
printf("Exception: Double fault (!!), code %08x\n", error);
asm("hlt");
}