p112: Pad floppy boot images to sector boundary
authorWill Sowerbutts <will@sowerbutts.com>
Fri, 20 Feb 2015 21:34:35 +0000 (21:34 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Fri, 20 Feb 2015 21:36:14 +0000 (21:36 +0000)
Kernel/platform-p112/flopboot-mkimage

index 43ad457..99cafc6 100755 (executable)
@@ -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)