Enable debug info.
This commit is contained in:
parent
3acb397549
commit
8a8fb95965
20
Makefile
20
Makefile
@ -5,12 +5,19 @@ CC=x86_64-elf-gcc
|
||||
run: image.bin
|
||||
qemu-system-i386 -drive format=raw,file=$<
|
||||
|
||||
debug-boot: image.bin mbr.elf
|
||||
qemu-system-i386 -drive format=raw,file=$< -s -S &
|
||||
x86_64-elf-gdb mbr.elf \
|
||||
-ex "set architecture i386" \
|
||||
-ex "target remote localhost:1234" \
|
||||
-ex "break init_32bit" \
|
||||
-ex "continue"
|
||||
|
||||
debug: image.bin
|
||||
qemu-system-i386 -drive format=raw,file=$< -s -S &
|
||||
x86_64-elf-gdb \
|
||||
x86_64-elf-gdb kernel.bin \
|
||||
-ex "target remote localhost:1234" \
|
||||
-ex "set architecture i8086" \
|
||||
-ex "break *0x7c5d" \
|
||||
-ex "break _start" \
|
||||
-ex "continue"
|
||||
|
||||
image.bin: mbr.bin kernel.bin
|
||||
@ -20,13 +27,16 @@ kernel.bin: kernel.o vga.o string.o drivers/ata.o
|
||||
$(LD) -m elf_i386 -o $@ -Ttext 0x1000 $^
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -m32 -ffreestanding -c $< -o $@
|
||||
$(CC) -m32 -ffreestanding -c -g $< -o $@
|
||||
|
||||
%.o: %.S
|
||||
$(AS) $^ -o $@
|
||||
$(AS) $^ -g -o $@
|
||||
|
||||
mbr.bin: mbr.o
|
||||
$(LD) -Ttext=0x7c00 --oformat=binary $^ -o $@
|
||||
|
||||
mbr.elf: mbr.o
|
||||
$(LD) -Ttext=0x7c00 $^ -o $@
|
||||
|
||||
clean:
|
||||
rm *.bin *.o
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user