From: Ben Pfaff Date: Tue, 17 Aug 2004 06:33:26 +0000 (+0000) Subject: Pad out kernel image to multiple of 4 kB to make Bochs happier. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d8900739603030503c64b8e35c808a63390da08;hp=8256dc4ff8f7c0a1f76c2d3a601b92d67aa8acfe;p=pintos-anon Pad out kernel image to multiple of 4 kB to make Bochs happier. --- 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