From: Will Sowerbutts Date: Fri, 20 Feb 2015 21:34:35 +0000 (+0000) Subject: p112: Pad floppy boot images to sector boundary X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e478850f6662a4508518bfc571abec41410bad78;p=FUZIX.git p112: Pad floppy boot images to sector boundary --- diff --git a/Kernel/platform-p112/flopboot-mkimage b/Kernel/platform-p112/flopboot-mkimage index 43ad457c..99cafc67 100755 --- a/Kernel/platform-p112/flopboot-mkimage +++ b/Kernel/platform-p112/flopboot-mkimage @@ -29,5 +29,10 @@ kernel = open(sys.argv[2], 'rb').read() # make the boot image image = stamp_bootstrap(bootstrap, kernel) + kernel +# pad image to even sector boundary +pad = len(image) % 512 +if pad: + image += chr(0xE5) * (512-pad) + # write output file open(sys.argv[3], 'wb').write(image)