hook up ProBoot

This commit is contained in:
4am 2019-03-18 13:52:43 -04:00
parent c9f0fe7ac3
commit a5492de2b5
3 changed files with 23 additions and 1 deletions

View File

@ -22,9 +22,11 @@ VOLUME=ANTI.M
asm:
mkdir -p build
$(ACME) -r build/anti-m.lst src/anti-m.a
cp res/work.bin $(BUILDDISK)
cp res/work.bin "$(BUILDDISK)"
cp res/_FileInformation.txt build/ >>build/log
$(CADIUS) ADDFILE "$(BUILDDISK)" "/${VOLUME}/" "build/ANTI.M.SYSTEM" >>build/log
$(ACME) -r build/proboot.lst src/proboot.a
bin/changebootloader.py "$(BUILDDISK)" build/proboot
clean:
rm -rf build/

20
bin/changebootloader.py Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env python3
import sys
import os.path
target_disk_image, bootloader = sys.argv[1:]
ext = os.path.splitext(target_disk_image)[-1].lower()
assert(ext in (".dsk", ".do", ".po", ".2mg"))
if ext == ".2mg":
offset = 64
else:
offset = 0
with open(bootloader, 'rb') as f:
boot = f.read()
assert(len(boot) == 512)
with open(target_disk_image, 'rb') as f:
data = bytearray(f.read())
data[offset:offset+len(boot)] = boot
with open(target_disk_image, 'wb') as f:
f.write(data)

Binary file not shown.