From dcd3686d3705110720250babf9400aedecd401fd Mon Sep 17 00:00:00 2001 From: garenchan <1412950785@qq.com> Date: Fri, 16 Nov 2018 10:47:11 +0800 Subject: [PATCH 1/3] Replace target file as $@ . --- 14-checkpoint/Makefile | 2 +- 15-video-ports/Makefile | 2 +- 16-video-driver/Makefile | 2 +- 17-video-scroll/Makefile | 2 +- 18-interrupts/Makefile | 2 +- 19-interrupts-irqs/Makefile | 2 +- 20-interrupts-timer/Makefile | 2 +- 21-shell/Makefile | 2 +- 22-malloc/Makefile | 2 +- 23-fixes/Makefile | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/14-checkpoint/Makefile b/14-checkpoint/Makefile index b611257..45cc9e4 100644 --- a/14-checkpoint/Makefile +++ b/14-checkpoint/Makefile @@ -11,7 +11,7 @@ CFLAGS = -g # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case diff --git a/15-video-ports/Makefile b/15-video-ports/Makefile index b611257..45cc9e4 100644 --- a/15-video-ports/Makefile +++ b/15-video-ports/Makefile @@ -11,7 +11,7 @@ CFLAGS = -g # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case diff --git a/16-video-driver/Makefile b/16-video-driver/Makefile index b611257..45cc9e4 100644 --- a/16-video-driver/Makefile +++ b/16-video-driver/Makefile @@ -11,7 +11,7 @@ CFLAGS = -g # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case diff --git a/17-video-scroll/Makefile b/17-video-scroll/Makefile index b611257..45cc9e4 100644 --- a/17-video-scroll/Makefile +++ b/17-video-scroll/Makefile @@ -11,7 +11,7 @@ CFLAGS = -g # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case diff --git a/18-interrupts/Makefile b/18-interrupts/Makefile index 8a68aa0..d7e16c5 100644 --- a/18-interrupts/Makefile +++ b/18-interrupts/Makefile @@ -11,7 +11,7 @@ CFLAGS = -g # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case diff --git a/19-interrupts-irqs/Makefile b/19-interrupts-irqs/Makefile index 8a68aa0..d7e16c5 100644 --- a/19-interrupts-irqs/Makefile +++ b/19-interrupts-irqs/Makefile @@ -11,7 +11,7 @@ CFLAGS = -g # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case diff --git a/20-interrupts-timer/Makefile b/20-interrupts-timer/Makefile index 4d6da94..3abf8ce 100644 --- a/20-interrupts-timer/Makefile +++ b/20-interrupts-timer/Makefile @@ -11,7 +11,7 @@ CFLAGS = -g # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case diff --git a/21-shell/Makefile b/21-shell/Makefile index 1478294..b347fc8 100644 --- a/21-shell/Makefile +++ b/21-shell/Makefile @@ -12,7 +12,7 @@ CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartf # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case diff --git a/22-malloc/Makefile b/22-malloc/Makefile index 1478294..b347fc8 100644 --- a/22-malloc/Makefile +++ b/22-malloc/Makefile @@ -12,7 +12,7 @@ CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartf # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case diff --git a/23-fixes/Makefile b/23-fixes/Makefile index 65e577b..7c244b6 100644 --- a/23-fixes/Makefile +++ b/23-fixes/Makefile @@ -11,7 +11,7 @@ CFLAGS = -g -ffreestanding -Wall -Wextra -fno-exceptions -m32 # First rule is run by default os-image.bin: boot/bootsect.bin kernel.bin - cat $^ > os-image.bin + cat $^ > $@ # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case From 02a77989c2d0ab155581f051b6344860146cdca5 Mon Sep 17 00:00:00 2001 From: garenchan <1412950785@qq.com> Date: Fri, 16 Nov 2018 15:46:00 +0800 Subject: [PATCH 2/3] Use ld through global variable. --- 14-checkpoint/Makefile | 5 +++-- 15-video-ports/Makefile | 5 +++-- 16-video-driver/Makefile | 5 +++-- 17-video-scroll/Makefile | 5 +++-- 18-interrupts/Makefile | 5 +++-- 19-interrupts-irqs/Makefile | 5 +++-- 20-interrupts-timer/Makefile | 5 +++-- 21-shell/Makefile | 5 +++-- 22-malloc/Makefile | 5 +++-- 23-fixes/Makefile | 5 +++-- 10 files changed, 30 insertions(+), 20 deletions(-) diff --git a/14-checkpoint/Makefile b/14-checkpoint/Makefile index 45cc9e4..5ff0d03 100644 --- a/14-checkpoint/Makefile +++ b/14-checkpoint/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g @@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin diff --git a/15-video-ports/Makefile b/15-video-ports/Makefile index 45cc9e4..5ff0d03 100644 --- a/15-video-ports/Makefile +++ b/15-video-ports/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g @@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin diff --git a/16-video-driver/Makefile b/16-video-driver/Makefile index 45cc9e4..5ff0d03 100644 --- a/16-video-driver/Makefile +++ b/16-video-driver/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g @@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin diff --git a/17-video-scroll/Makefile b/17-video-scroll/Makefile index 45cc9e4..5ff0d03 100644 --- a/17-video-scroll/Makefile +++ b/17-video-scroll/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g @@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin diff --git a/18-interrupts/Makefile b/18-interrupts/Makefile index d7e16c5..fd48e28 100644 --- a/18-interrupts/Makefile +++ b/18-interrupts/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g @@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin diff --git a/19-interrupts-irqs/Makefile b/19-interrupts-irqs/Makefile index d7e16c5..fd48e28 100644 --- a/19-interrupts-irqs/Makefile +++ b/19-interrupts-irqs/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g @@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin diff --git a/20-interrupts-timer/Makefile b/20-interrupts-timer/Makefile index 3abf8ce..d1922a7 100644 --- a/20-interrupts-timer/Makefile +++ b/20-interrupts-timer/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g @@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin diff --git a/21-shell/Makefile b/21-shell/Makefile index b347fc8..23e9d9a 100644 --- a/21-shell/Makefile +++ b/21-shell/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs \ -Wall -Wextra -Werror @@ -17,11 +18,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin diff --git a/22-malloc/Makefile b/22-malloc/Makefile index b347fc8..23e9d9a 100644 --- a/22-malloc/Makefile +++ b/22-malloc/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs \ -Wall -Wextra -Werror @@ -17,11 +18,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin diff --git a/23-fixes/Makefile b/23-fixes/Makefile index 7c244b6..a678f60 100644 --- a/23-fixes/Makefile +++ b/23-fixes/Makefile @@ -6,6 +6,7 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o} # Change this if your cross-compiler is somewhere else CC = /usr/local/i386elfgcc/bin/i386-elf-gcc GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb +LD = /usr/local/i386elfgcc/bin/i386-elf-ld # -g: Use debugging symbols in gcc CFLAGS = -g -ffreestanding -Wall -Wextra -fno-exceptions -m32 @@ -16,11 +17,11 @@ os-image.bin: boot/bootsect.bin kernel.bin # '--oformat binary' deletes all symbols as a collateral, so we don't need # to 'strip' them manually on this case kernel.bin: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ --oformat binary + ${LD} -o $@ -Ttext 0x1000 $^ --oformat binary # Used for debugging purposes kernel.elf: boot/kernel_entry.o ${OBJ} - i386-elf-ld -o $@ -Ttext 0x1000 $^ + ${LD} -o $@ -Ttext 0x1000 $^ run: os-image.bin qemu-system-i386 -fda os-image.bin From d7469c76b3e45e93d0894838c3bba57b4c7fff92 Mon Sep 17 00:00:00 2001 From: garenchan <1412950785@qq.com> Date: Fri, 16 Nov 2018 15:49:01 +0800 Subject: [PATCH 3/3] Freeze CPU at qemu startup while debug. If we don't, the kernel might run into the infinite loop before GDB connects to Qemu. --- 14-checkpoint/Makefile | 2 +- 15-video-ports/Makefile | 2 +- 16-video-driver/Makefile | 2 +- 17-video-scroll/Makefile | 2 +- 18-interrupts/Makefile | 2 +- 19-interrupts-irqs/Makefile | 2 +- 20-interrupts-timer/Makefile | 2 +- 21-shell/Makefile | 2 +- 22-malloc/Makefile | 2 +- 23-fixes/Makefile | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/14-checkpoint/Makefile b/14-checkpoint/Makefile index 5ff0d03..37e7ec9 100644 --- a/14-checkpoint/Makefile +++ b/14-checkpoint/Makefile @@ -28,7 +28,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin & + qemu-system-i386 -s -S -fda os-image.bin & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards diff --git a/15-video-ports/Makefile b/15-video-ports/Makefile index 5ff0d03..37e7ec9 100644 --- a/15-video-ports/Makefile +++ b/15-video-ports/Makefile @@ -28,7 +28,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin & + qemu-system-i386 -s -S -fda os-image.bin & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards diff --git a/16-video-driver/Makefile b/16-video-driver/Makefile index 5ff0d03..37e7ec9 100644 --- a/16-video-driver/Makefile +++ b/16-video-driver/Makefile @@ -28,7 +28,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin & + qemu-system-i386 -s -S -fda os-image.bin & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards diff --git a/17-video-scroll/Makefile b/17-video-scroll/Makefile index 5ff0d03..37e7ec9 100644 --- a/17-video-scroll/Makefile +++ b/17-video-scroll/Makefile @@ -28,7 +28,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin & + qemu-system-i386 -s -S -fda os-image.bin & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards diff --git a/18-interrupts/Makefile b/18-interrupts/Makefile index fd48e28..deccb84 100644 --- a/18-interrupts/Makefile +++ b/18-interrupts/Makefile @@ -28,7 +28,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin -d guest_errors,int & + qemu-system-i386 -s -S -fda os-image.bin -d guest_errors,int & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards diff --git a/19-interrupts-irqs/Makefile b/19-interrupts-irqs/Makefile index fd48e28..deccb84 100644 --- a/19-interrupts-irqs/Makefile +++ b/19-interrupts-irqs/Makefile @@ -28,7 +28,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin -d guest_errors,int & + qemu-system-i386 -s -S -fda os-image.bin -d guest_errors,int & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards diff --git a/20-interrupts-timer/Makefile b/20-interrupts-timer/Makefile index d1922a7..30c4edb 100644 --- a/20-interrupts-timer/Makefile +++ b/20-interrupts-timer/Makefile @@ -28,7 +28,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin -d guest_errors,int & + qemu-system-i386 -s -S -fda os-image.bin -d guest_errors,int & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards diff --git a/21-shell/Makefile b/21-shell/Makefile index 23e9d9a..380bed4 100644 --- a/21-shell/Makefile +++ b/21-shell/Makefile @@ -29,7 +29,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin -d guest_errors,int & + qemu-system-i386 -s -S -fda os-image.bin -d guest_errors,int & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards diff --git a/22-malloc/Makefile b/22-malloc/Makefile index 23e9d9a..380bed4 100644 --- a/22-malloc/Makefile +++ b/22-malloc/Makefile @@ -29,7 +29,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin -d guest_errors,int & + qemu-system-i386 -s -S -fda os-image.bin -d guest_errors,int & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards diff --git a/23-fixes/Makefile b/23-fixes/Makefile index a678f60..53fdedf 100644 --- a/23-fixes/Makefile +++ b/23-fixes/Makefile @@ -28,7 +28,7 @@ run: os-image.bin # Open the connection to qemu and load our kernel-object file with symbols debug: os-image.bin kernel.elf - qemu-system-i386 -s -fda os-image.bin -d guest_errors,int & + qemu-system-i386 -s -S -fda os-image.bin -d guest_errors,int & ${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf" # Generic rules for wildcards