diff options
-rw-r--r-- | src/Makefile | 12 | ||||
-rw-r--r-- | src/magic.asm | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile index 45498bb..f22b5c0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,6 +2,8 @@ CC := gcc CFLAGS := -std=c99 -m32 -ffreestanding -O0 -g -Wall -Werror LD := ld LDFLAGS := -f elf32 +NASM := nasm +OBJCOPY := objcopy all: image.bin kernel.sym @@ -17,13 +19,13 @@ image.bin: boot.bin kernel.bin magic.bin cat image.tmp magic.bin > image.bin boot.bin: boot.asm gdt.asm stage1_functions.asm stage2_functions.asm switch_mode.asm - nasm boot.asm -f bin -o boot.bin + $(NASM) boot.asm -f bin -o boot.bin kernel.bin: kernel.elf - objcopy -O binary kernel.elf kernel.bin + $(OBJCOPY) -O binary kernel.elf kernel.bin kernel.sym: kernel.elf - objcopy --only-keep-debug kernel.elf kernel.sym + $(OBJCOPY) --only-keep-debug kernel.elf kernel.sym kernel.elf: kernel.o console.o vga.o serial.o port.o port_asm.o string.o stdlib.o $(LD) -o kernel.elf -N -n -Ttext 0x8400 --oformat elf32-i386 \ @@ -31,7 +33,7 @@ kernel.elf: kernel.o console.o vga.o serial.o port.o port_asm.o string.o stdlib. string.o stdlib.o magic.bin: magic.asm - nasm magic.asm -f bin -o magic.bin + $(NASM) magic.asm -f bin -o magic.bin kernel.o: kernel.c $(CC) $(CFLAGS) -c -o kernel.o kernel.c @@ -49,7 +51,7 @@ serial.o: serial.c serial.h $(CC) $(CFLAGS) -c -o serial.o serial.c port_asm.o: port.asm - nasm port.asm $(LDFLAGS) -o port_asm.o + $(NASM) port.asm $(LDFLAGS) -o port_asm.o string.o: string.c string.h $(CC) $(CFLAGS) -c -o string.o string.c diff --git a/src/magic.asm b/src/magic.asm index 56f16c5..d62cea1 100644 --- a/src/magic.asm +++ b/src/magic.asm @@ -4,7 +4,7 @@ times 512-31-($-$$) db 0 ; the magic string we search for in stage 2 to ensure we don't read ; a truncated kernel image ; we make it unique per compilation to avoid funny problems if -; the size of the image differs between compilation stpes and the +; the size of the image differs between compilation steps and the ; host system doens't initialize or randomize the RAM. ; __UTC_DATE_NUM__ is YYYY-MM-DD ; __UTC_TIME_NUM__ is HH:mm:SS |