From d1e408a2f7931732bc98809d36c28c47563fdbd3 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 20 May 2017 09:07:56 +0200 Subject: precomputing MAGIC in makefile, magic.asm and stage2 magic check are in different assembly units, so we cannot use date and time --- src/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index affe3e3..1b77e89 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,6 +4,7 @@ LD := ld NASMFLAGS := -f elf32 NASM := nasm OBJCOPY := objcopy +MAGIC = $(shell printf '%x' `date +%s`) all: image.bin kernel.sym @@ -19,7 +20,7 @@ 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 -DMAGIC='"$(MAGIC)"' -f bin -o boot.bin kernel.bin: kernel.elf $(OBJCOPY) -O binary kernel.elf kernel.bin @@ -33,7 +34,7 @@ kernel.elf: kernel.o console.o vga.o serial.o port.o port_asm.o interrupts.o int interrupts.o interrupts_asm.o string.o stdlib.o magic.bin: magic.asm - $(NASM) magic.asm -f bin -o magic.bin + $(NASM) magic.asm -DMAGIC='"$(MAGIC)"' -f bin -o magic.bin kernel.o: kernel.c $(CC) $(CFLAGS) -c -o kernel.o kernel.c -- cgit v1.2.3-54-g00ecf