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] 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