Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions 23-fixes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ HEADERS = $(wildcard kernel/*.h drivers/*.h cpu/*.h libc/*.h)
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
CC = gcc
GDB = gdb
# -g: Use debugging symbols in gcc
CFLAGS = -g -ffreestanding -Wall -Wextra -fno-exceptions -m32
CFLAGS = -g -ffreestanding -Wall -Wextra -fno-exceptions -m32 -fno-pie

# First rule is run by default
os-image.bin: boot/bootsect.bin kernel.bin
Expand All @@ -16,11 +16,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 -m elf_i386 -o $@ -Ttext 0x1000 $^ --oformat binary

# Used for debugging purposes
kernel.elf: boot/kernel_entry.o ${OBJ}
i386-elf-ld -o $@ -Ttext 0x1000 $^
ld -m elf_i386 -o $@ -Ttext 0x1000 $^

run: os-image.bin
qemu-system-i386 -fda os-image.bin
Expand Down