We should have a working interrupt table

This commit is contained in:
Gitea 2021-01-02 20:52:20 -06:00
parent 42a76ff1ec
commit 1747d88ff3
4 changed files with 78 additions and 51 deletions

View file

@ -1,4 +1,5 @@
#include <kernel/init.h> #include <kernel/init.h>
#include <kernel/interrupt.h>
#include <string.h> #include <string.h>
#include <sys/io.h> #include <sys/io.h>
#include "gdt.h" #include "gdt.h"
@ -43,6 +44,7 @@ int init(void) {
NMI_disable(); NMI_disable();
A20_enable(); A20_enable();
setup_gdt(); setup_gdt();
idt_init();
printf("Fenix Dev Pre-release v0.0.3\n"); printf("Fenix Dev Pre-release v0.0.3\n");
return 0; return 0;
} }

View file

@ -1,55 +1,72 @@
global irq0 .globl irq0
global irq1 .type irq0,%function
global irq2 .globl irq1
global irq3 .type irq1,%function
global irq4 .globl irq2
global irq5 .type irq2,%function
global irq6 .globl irq3
global irq7 .type irq3,%function
global irq8 .globl irq4
global irq9 .type irq4,%function
global irq10 .globl irq5
global irq11 .type irq5,%function
global irq12 .globl irq6
global irq13 .type irq6,%function
global irq14 .globl irq7
global irq15 .type irq7,%function
.globl irq8
.type irq8,%function
.globl irq9
.type irq9,%function
.globl irq10
.type irq10,%function
.globl irq11
.type irq11,%function
.globl irq12
.type irq12,%function
.globl irq13
.type irq13,%function
.globl irq14
.type irq14,%function
.globl irq15
.type irq15,%function
global load_idt .globl load_idt
.type load_idt,%function
global irq0_handler .globl irq0_handler
global irq1_handler .globl irq1_handler
global irq2_handler .globl irq2_handler
global irq3_handler .globl irq3_handler
global irq4_handler .globl irq4_handler
global irq5_handler .globl irq5_handler
global irq6_handler .globl irq6_handler
global irq7_handler .globl irq7_handler
global irq8_handler .globl irq8_handler
global irq9_handler .globl irq9_handler
global irq10_handler .globl irq10_handler
global irq11_handler .globl irq11_handler
global irq12_handler .globl irq12_handler
global irq13_handler .globl irq13_handler
global irq14_handler .globl irq14_handler
global irq15_handler .globl irq15_handler
extern irq0_handler .extern irq0_handler
extern irq1_handler .extern irq1_handler
extern irq2_handler .extern irq2_handler
extern irq3_handler .extern irq3_handler
extern irq4_handler .extern irq4_handler
extern irq5_handler .extern irq5_handler
extern irq6_handler .extern irq6_handler
extern irq7_handler .extern irq7_handler
extern irq8_handler .extern irq8_handler
extern irq9_handler .extern irq9_handler
extern irq10_handler .extern irq10_handler
extern irq11_handler .extern irq11_handler
extern irq12_handler .extern irq12_handler
extern irq13_handler .extern irq13_handler
extern irq14_handler .extern irq14_handler
extern irq15_handler .extern irq15_handler
irq0: irq0:
pusha pusha
@ -149,6 +166,6 @@ irq15:
load_idt: load_idt:
mov 4(%esp), %edx mov 4(%esp), %edx
lidt %edx lidt (%edx)
sti sti
ret ret

View file

@ -1,4 +1,5 @@
#include <kernel/interrupt.h> #include <kernel/interrupt.h>
#include <sys/io.h>
void idt_init(void) { void idt_init(void) {
extern int load_idt(); extern int load_idt();

View file

@ -3,4 +3,11 @@ KERNEL_ARCH_CPPFLAGS=
KERNEL_ARCH_LDFLAGS= KERNEL_ARCH_LDFLAGS=
KERNEL_ARCH_LIBS= KERNEL_ARCH_LIBS=
KERNEL_ARCH_OBJS=$(ARCHDIR)/boot.o $(ARCHDIR)/tty.o $(ARCHDIR)/init.o $(ARCHDIR)/cmos.o $(ARCHDIR)/gdt.o $(ARCHDIR)/gdt_load.o KERNEL_ARCH_OBJS=$(ARCHDIR)/boot.o \
$(ARCHDIR)/tty.o \
$(ARCHDIR)/init.o \
$(ARCHDIR)/cmos.o \
$(ARCHDIR)/gdt.o \
$(ARCHDIR)/gdt_load.o \
$(ARCHDIR)/interrupt.o \
$(ARCHDIR)/inter.o