summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-06-02 17:01:22 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-06-02 17:01:22 +0200
commit3113313b86a429b389bc26a2982418d9a0713014 (patch)
tree34f62cbfd5dc68bb9b9b4b93ff9ba96e91deffed /src/Makefile
parentf8e8fe0bf62b18ff9bb7cff98c974dc05aa93d31 (diff)
downloadabaos-3113313b86a429b389bc26a2982418d9a0713014.tar.gz
abaos-3113313b86a429b389bc26a2982418d9a0713014.tar.bz2
..
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile
index d72f5aa..37ad6fe 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -13,10 +13,10 @@ all: image.bin kernel.sym
# + 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 21)
+# loads only the first sector, so adapt NOF_LOAD_SECTORS to 22)
image.bin: boot.bin kernel.bin magic.bin
cat boot.bin kernel.bin > image.tmp
- truncate -s 10752 image.tmp
+ truncate -s 11264 image.tmp
cat image.tmp magic.bin > image.bin
boot.bin: boot.asm boot_gdt.asm stage1_functions.asm stage2_functions.asm stage2_switch_mode.asm stage2_a20.asm
@@ -28,10 +28,11 @@ 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 interrupts.o interrupts_asm.o keyboard.o string.o stdlib.o stdio.o setjmp.o
+kernel.elf: kernel.o kernel_asm.o console.o vga.o serial.o port.o port_asm.o interrupts.o interrupts_asm.o keyboard.o string.o stdlib.o stdio.o setjmp.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 \
- interrupts.o interrupts_asm.o keyboard.o \
+ kernel.o kernel_asm.o console.o vga.o serial.o \
+ port.o port_asm.o interrupts.o interrupts_asm.o \
+ keyboard.o \
string.o stdlib.o stdio.o setjmp.o
magic.bin: magic.asm
@@ -40,6 +41,9 @@ magic.bin: magic.asm
kernel.o: kernel.c
$(CC) $(CFLAGS) -c -o kernel.o kernel.c
+kernel_asm.o: kernel.asm
+ $(NASM) kernel.asm $(NASMFLAGS) -o kernel_asm.o
+
port.o: port.c port.h
$(CC) $(CFLAGS) -c -o port.o port.c