From 67ee9510770674a4ef236168176bf85e0775ab7e Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 18 May 2017 15:33:37 +0200 Subject: added port types which are check when calling port read/write functions --- src/Makefile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/Makefile') 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 -- cgit v1.2.3-54-g00ecf