mirror of
https://github.com/a2-4am/anti-m.git
synced 2025-01-13 16:32:58 +00:00
hook up ProBoot
This commit is contained in:
parent
c9f0fe7ac3
commit
a5492de2b5
4
Makefile
4
Makefile
@ -22,9 +22,11 @@ VOLUME=ANTI.M
|
|||||||
asm:
|
asm:
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
$(ACME) -r build/anti-m.lst src/anti-m.a
|
$(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
|
cp res/_FileInformation.txt build/ >>build/log
|
||||||
$(CADIUS) ADDFILE "$(BUILDDISK)" "/${VOLUME}/" "build/ANTI.M.SYSTEM" >>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:
|
clean:
|
||||||
rm -rf build/
|
rm -rf build/
|
||||||
|
20
bin/changebootloader.py
Executable file
20
bin/changebootloader.py
Executable 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)
|
BIN
res/work.bin
BIN
res/work.bin
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user