From 8d8900739603030503c64b8e35c808a63390da08 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 17 Aug 2004 06:33:26 +0000 Subject: [PATCH] Pad out kernel image to multiple of 4 kB to make Bochs happier. --- src/Makefile.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Makefile.inc b/src/Makefile.inc index 338bb25..b28b5d2 100644 --- a/src/Makefile.inc +++ b/src/Makefile.inc @@ -56,10 +56,12 @@ kernel.o: $(OBJECTS) `$(CC) -print-libgcc-file-name` kernel.bin: kernel.o - objcopy -O binary -R .note -R .comment -S $< $@ + objcopy -O binary -R .note -R .comment -S $< $@.data + perl -e 'print "\0" x (4096 - (-s "$@.data") % 4096)' > $@.pad + cat $@.data $@.pad > $@.tmp && mv $@.tmp $@ loader.bin: loader.S kernel.bin - gcc -c $< -DKERNEL_LOAD_PAGES=`perl -e 'print int (((-s "kernel.bin") + 4095) / 4096);'` + gcc -c $< -DKERNEL_LOAD_PAGES=`perl -e 'print +(-s "kernel.bin") / 4096;'` ld -N -e start -Ttext 0x7c00 --oformat binary -o $@ loader.o diskimage.bin: loader.bin kernel.bin -- 2.30.2