interupts
E. Almqvist 3 years ago
parent f5c26a7bce
commit 7cdd3157cd
  1. 6
      Makefile
  2. 55
      kernel/interupt.asm
  3. 6
      kernel/interupt.h

@ -15,15 +15,16 @@ VMFLAGS =
# Do not touch these. # Do not touch these.
C_SOURCES = $(wildcard kernel/*.c drivers/*.c lib/*.c) C_SOURCES = $(wildcard kernel/*.c drivers/*.c lib/*.c)
ASM_SOURCES = $(wildcard kernel/*.asm drivers/*.asm lib/*.asm)
HEADERS = $(wildcard kernel/*.h drivers/*.h lib/*.h) HEADERS = $(wildcard kernel/*.h drivers/*.h lib/*.h)
OBJ = $(C_SOURCES:.c=.o) OBJ = $(C_SOURCES:.c=.o)
AOBJ = $(ASM_SOURCES:.asm=.o)
all: eos.iso all: eos.iso
run: all run: all
$(VM) $(VMFLAGS) eos.iso $(VM) $(VMFLAGS) eos.iso
drun: clean run drun: clean run
grub: eos_grub.iso grub: eos_grub.iso
@ -38,10 +39,9 @@ eos_grub.iso : kernel.bin grub/grub.cfg
eos.iso: bootloader/bootloader.bin kernel.bin eos.iso: bootloader/bootloader.bin kernel.bin
cat $^ > eos.iso cat $^ > eos.iso
kernel.bin: kernel/multiboot2.o kernel/kernel_entry.o kernel/enable_paging.o $(OBJ) kernel.bin: kernel/kernel_entry.o $(OBJ) $(AOBJ)
$(LD) -o $@ $^ $(LDFLAGS) $(LD) -o $@ $^ $(LDFLAGS)
%.o : %.c ${HEADERS} %.o : %.c ${HEADERS}
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@

@ -0,0 +1,55 @@
; osdev crap
%macro isr_err_stub 1
isr_stub_%+%1:
call exception_handler
iret
%endmacro
%macro isr_no_err_stub 1
isr_stub_%+%1:
call exception_handler
iret
%endmacro
extern exception_handler
isr_no_err_stub 0
isr_no_err_stub 1
isr_no_err_stub 2
isr_no_err_stub 3
isr_no_err_stub 4
isr_no_err_stub 5
isr_no_err_stub 6
isr_no_err_stub 7
isr_err_stub 8
isr_no_err_stub 9
isr_err_stub 10
isr_err_stub 11
isr_err_stub 12
isr_err_stub 13
isr_err_stub 14
isr_no_err_stub 15
isr_no_err_stub 16
isr_err_stub 17
isr_no_err_stub 18
isr_no_err_stub 19
isr_no_err_stub 20
isr_no_err_stub 21
isr_no_err_stub 22
isr_no_err_stub 23
isr_no_err_stub 24
isr_no_err_stub 25
isr_no_err_stub 26
isr_no_err_stub 27
isr_no_err_stub 28
isr_no_err_stub 29
isr_err_stub 30
isr_no_err_stub 31
global isr_stub_table
isr_stub_table:
%assign i 0
%rep 32
dd isr_stub_%+i
%assign i i+1
%endrep

@ -1 +1,7 @@
#include "../lib/types.h" #include "../lib/types.h"
__attribute__((noreturn))
void exception_handler();
__attribute__((noreturn))
void interupt_handler();

Loading…
Cancel
Save