|
@@ -12,9 +12,13 @@ CFLAGS = -g
|
|
os-image.bin: boot/bootsect.bin kernel.bin
|
|
os-image.bin: boot/bootsect.bin kernel.bin
|
|
cat $^ > os-image.bin
|
|
cat $^ > os-image.bin
|
|
|
|
|
|
-kernel.bin: kernel.elf
|
|
|
|
|
|
+kernel.bin: boot/kernel_entry.o ${OBJ}
|
|
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
|
i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary
|
|
|
|
|
|
|
|
+# Used for debugging purposes
|
|
|
|
+kernel.elf: boot/kernel_entry.o ${OBJ}
|
|
|
|
+ i386-elf-ld -o $@ -Ttext 0x1000 $^
|
|
|
|
+
|
|
run: os-image.bin
|
|
run: os-image.bin
|
|
qemu-system-i386 -fda os-image.bin
|
|
qemu-system-i386 -fda os-image.bin
|
|
|
|
|
|
@@ -22,10 +26,6 @@ debug: os-image.bin kernel.elf
|
|
qemu-system-i386 -s -fda os-image.bin &
|
|
qemu-system-i386 -s -fda os-image.bin &
|
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
|
|
|
|
|
-# To build the kernel: make all objects first
|
|
|
|
-kernel.elf: boot/kernel_entry.o ${OBJ}
|
|
|
|
- i386-elf-ld -o $@ -Ttext 0x1000 $^
|
|
|
|
-
|
|
|
|
# To make an object, always compile from its .c
|
|
# To make an object, always compile from its .c
|
|
%.o: %.c ${HEADERS}
|
|
%.o: %.c ${HEADERS}
|
|
${CC} ${CFLAGS} -ffreestanding -c $< -o $@
|
|
${CC} ${CFLAGS} -ffreestanding -c $< -o $@
|