summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-05-18 15:33:37 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-05-18 15:33:37 +0200
commit67ee9510770674a4ef236168176bf85e0775ab7e (patch)
tree4cef26a9fc4e5416aeef6a334c8c3de7d65bcd62 /src/Makefile
parenta91dc0e8b48359716fd214f503deb71a0210252d (diff)
downloadabaos-67ee9510770674a4ef236168176bf85e0775ab7e.tar.gz
abaos-67ee9510770674a4ef236168176bf85e0775ab7e.tar.bz2
added port types which are check when calling port read/write functions
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/Makefile b/src/Makefile
index f22b5c0..affe3e3 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,7 @@
CC := gcc
CFLAGS := -std=c99 -m32 -ffreestanding -O0 -g -Wall -Werror
LD := ld
-LDFLAGS := -f elf32
+NASMFLAGS := -f elf32
NASM := nasm
OBJCOPY := objcopy
@@ -14,8 +14,8 @@ image.bin: boot.bin kernel.bin magic.bin
# + M * 512 (M is currently 7) = 3144 for kernel.bin
# + 1 * 512 = 512 for magic.bin
# (M + N + 1 is the number of sectors to be read in stage 2, as stage 1
- # loads only the first sector, so adapt NOF_LOAD_SECTORS to 12)
- truncate -s 7168 image.tmp
+ # loads only the first sector, so adapt NOF_LOAD_SECTORS to 16)
+ truncate -s 8192 image.tmp
cat image.tmp magic.bin > image.bin
boot.bin: boot.asm gdt.asm stage1_functions.asm stage2_functions.asm switch_mode.asm
@@ -27,10 +27,10 @@ kernel.bin: kernel.elf
kernel.sym: kernel.elf
$(OBJCOPY) --only-keep-debug kernel.elf kernel.sym
-kernel.elf: kernel.o console.o vga.o serial.o port.o port_asm.o string.o stdlib.o
+kernel.elf: kernel.o console.o vga.o serial.o port.o port_asm.o interrupts.o interrupts_asm.o string.o stdlib.o
$(LD) -o kernel.elf -N -n -Ttext 0x8400 --oformat elf32-i386 \
kernel.o console.o vga.o serial.o port.o port_asm.o \
- string.o stdlib.o
+ interrupts.o interrupts_asm.o string.o stdlib.o
magic.bin: magic.asm
$(NASM) magic.asm -f bin -o magic.bin
@@ -41,6 +41,9 @@ kernel.o: kernel.c
port.o: port.c port.h
$(CC) $(CFLAGS) -c -o port.o port.c
+port_asm.o: port.asm
+ $(NASM) port.asm $(NASMFLAGS) -o port_asm.o
+
console.o: console.c console.h vga.h serial.h
$(CC) $(CFLAGS) -c -o console.o console.c
@@ -50,8 +53,11 @@ vga.o: vga.c vga.h
serial.o: serial.c serial.h
$(CC) $(CFLAGS) -c -o serial.o serial.c
-port_asm.o: port.asm
- $(NASM) port.asm $(LDFLAGS) -o port_asm.o
+interrupts.o: interrupts.c interrupts.h
+ $(CC) $(CFLAGS) -c -o interrupts.o interrupts.c
+
+interrupts_asm.o: interrupts.asm
+ $(NASM) interrupts.asm $(NASMFLAGS) -o interrupts_asm.o
string.o: string.c string.h
$(CC) $(CFLAGS) -c -o string.o string.c