mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2025-06-13 12:54:24 +00:00
Merge d7469c76b3
into ce8e050d24
This commit is contained in:
commit
b863e67d68
@ -6,28 +6,29 @@ OBJ = ${C_SOURCES:.c=.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g
|
CFLAGS = -g
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
@ -6,28 +6,29 @@ OBJ = ${C_SOURCES:.c=.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g
|
CFLAGS = -g
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
@ -6,28 +6,29 @@ OBJ = ${C_SOURCES:.c=.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g
|
CFLAGS = -g
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
@ -6,28 +6,29 @@ OBJ = ${C_SOURCES:.c=.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g
|
CFLAGS = -g
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
@ -6,28 +6,29 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g
|
CFLAGS = -g
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
@ -6,28 +6,29 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g
|
CFLAGS = -g
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
@ -6,28 +6,29 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g
|
CFLAGS = -g
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
@ -6,29 +6,30 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs \
|
CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs \
|
||||||
-Wall -Wextra -Werror
|
-Wall -Wextra -Werror
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
@ -6,29 +6,30 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs \
|
CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs \
|
||||||
-Wall -Wextra -Werror
|
-Wall -Wextra -Werror
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
@ -6,28 +6,29 @@ OBJ = ${C_SOURCES:.c=.o cpu/interrupt.o}
|
|||||||
# Change this if your cross-compiler is somewhere else
|
# Change this if your cross-compiler is somewhere else
|
||||||
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
CC = /usr/local/i386elfgcc/bin/i386-elf-gcc
|
||||||
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
GDB = /usr/local/i386elfgcc/bin/i386-elf-gdb
|
||||||
|
LD = /usr/local/i386elfgcc/bin/i386-elf-ld
|
||||||
# -g: Use debugging symbols in gcc
|
# -g: Use debugging symbols in gcc
|
||||||
CFLAGS = -g -ffreestanding -Wall -Wextra -fno-exceptions -m32
|
CFLAGS = -g -ffreestanding -Wall -Wextra -fno-exceptions -m32
|
||||||
|
|
||||||
# First rule is run by default
|
# First rule is run by default
|
||||||
os-image.bin: boot/bootsect.bin kernel.bin
|
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
|
# '--oformat binary' deletes all symbols as a collateral, so we don't need
|
||||||
# to 'strip' them manually on this case
|
# to 'strip' them manually on this case
|
||||||
kernel.bin: boot/kernel_entry.o ${OBJ}
|
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
|
# Used for debugging purposes
|
||||||
kernel.elf: boot/kernel_entry.o ${OBJ}
|
kernel.elf: boot/kernel_entry.o ${OBJ}
|
||||||
i386-elf-ld -o $@ -Ttext 0x1000 $^
|
${LD} -o $@ -Ttext 0x1000 $^
|
||||||
|
|
||||||
run: os-image.bin
|
run: os-image.bin
|
||||||
qemu-system-i386 -fda os-image.bin
|
qemu-system-i386 -fda os-image.bin
|
||||||
|
|
||||||
# Open the connection to qemu and load our kernel-object file with symbols
|
# Open the connection to qemu and load our kernel-object file with symbols
|
||||||
debug: os-image.bin kernel.elf
|
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"
|
${GDB} -ex "target remote localhost:1234" -ex "symbol-file kernel.elf"
|
||||||
|
|
||||||
# Generic rules for wildcards
|
# Generic rules for wildcards
|
||||||
|
Loading…
Reference in New Issue
Block a user