diff --git a/Makefile b/Makefile index b486045..27faeb7 100644 --- a/Makefile +++ b/Makefile @@ -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/ diff --git a/bin/changebootloader.py b/bin/changebootloader.py new file mode 100755 index 0000000..5ad571d --- /dev/null +++ b/bin/changebootloader.py @@ -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) diff --git a/res/work.bin b/res/work.bin index c25e318..42b22ca 100644 Binary files a/res/work.bin and b/res/work.bin differ