diff --git a/14-checkpoint/Makefile b/14-checkpoint/Makefile index b611257..37e7ec9 100644 --- a/14-checkpoint/Makefile +++ b/14-checkpoint/Makefile @@ -6,28 +6,29 @@ 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 # 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 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 # 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 b611257..37e7ec9 100644 --- a/15-video-ports/Makefile +++ b/15-video-ports/Makefile @@ -6,28 +6,29 @@ 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 # 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 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 # 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 b611257..37e7ec9 100644 --- a/16-video-driver/Makefile +++ b/16-video-driver/Makefile @@ -6,28 +6,29 @@ 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 # 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 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 # 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 b611257..37e7ec9 100644 --- a/17-video-scroll/Makefile +++ b/17-video-scroll/Makefile @@ -6,28 +6,29 @@ 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 # 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 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 # 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 8a68aa0..deccb84 100644 --- a/18-interrupts/Makefile +++ b/18-interrupts/Makefile @@ -6,28 +6,29 @@ 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 # 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 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 # 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 8a68aa0..deccb84 100644 --- a/19-interrupts-irqs/Makefile +++ b/19-interrupts-irqs/Makefile @@ -6,28 +6,29 @@ 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 # 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 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 # 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 4d6da94..30c4edb 100644 --- a/20-interrupts-timer/Makefile +++ b/20-interrupts-timer/Makefile @@ -6,28 +6,29 @@ 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 # 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 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 # 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 1478294..380bed4 100644 --- a/21-shell/Makefile +++ b/21-shell/Makefile @@ -6,29 +6,30 @@ 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 # 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 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 # 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 1478294..380bed4 100644 --- a/22-malloc/Makefile +++ b/22-malloc/Makefile @@ -6,29 +6,30 @@ 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 # 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 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 # 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 65e577b..53fdedf 100644 --- a/23-fixes/Makefile +++ b/23-fixes/Makefile @@ -6,28 +6,29 @@ 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 # 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 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 # 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