From 5950709d38af531f730302d618cd451e951e4eac Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Thu, 2 Nov 2017 17:02:11 +0000 Subject: [PATCH] Replace hardcoded selector with configuration constant --- arch/Makefile | 5 +---- arch/isr.asm | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/Makefile b/arch/Makefile index f6b0b52..ef6792b 100644 --- a/arch/Makefile +++ b/arch/Makefile @@ -3,7 +3,7 @@ CCPREFIX = i686-elf- AS = $(CCPREFIX)as CC = $(CCPREFIX)gcc -OBJS = boot.s.o main.c.o logger.c.o console.c.o isr.c.o isr.asm.o multiboot.c.o protected.asm.cpp.o protected.c.o +OBJS = boot.s.o main.c.o logger.c.o console.c.o isr.c.o isr.asm.cpp.o multiboot.c.o protected.asm.cpp.o protected.c.o all: kernel @@ -20,9 +20,6 @@ kernel: $(OBJS) %.s.o: %.s $(AS) $< -o $@ -%.asm.o: %.asm - nasm -felf -o $@ $< - %.asm.cpp.o: %.asm.cpp nasm -felf -o $@ $< diff --git a/arch/isr.asm b/arch/isr.asm index 1288d16..dc75bb9 100644 --- a/arch/isr.asm +++ b/arch/isr.asm @@ -1,3 +1,5 @@ +#include "config.h" + [EXTERN isr] %macro ISR_NOERRCODE 1 @@ -56,7 +58,7 @@ isr_common_stub: mov ax, ds ; Lower 16-bits of eax = ds. push eax ; save the data segment descriptor - mov ax, 0x10 ; load the kernel data segment descriptor + mov ax, GDT_KERNEL_DS_SELECTOR mov ds, ax mov es, ax mov fs, ax