mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2026-03-02 03:49:21 +00:00
lesson 14
This commit is contained in:
@@ -12,9 +12,13 @@ CFLAGS = -g
|
||||
os-image.bin: boot/bootsect.bin kernel.bin
|
||||
cat $^ > os-image.bin
|
||||
|
||||
kernel.bin: kernel.elf
|
||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
||||
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
|
||||
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 &
|
||||
${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
|
||||
%.o: %.c ${HEADERS}
|
||||
${CC} ${CFLAGS} -ffreestanding -c $< -o $@
|
||||
|
||||
Reference in New Issue
Block a user