Merge pull request #414 from Googulator/builder-hex0-submodule

Use builder-hex0 stages from submodule
This commit is contained in:
fosslinux 2024-01-22 03:43:31 +00:00 committed by GitHub
commit 06b40f3f00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 2447 deletions

4
.gitmodules vendored
View File

@ -5,3 +5,7 @@
[submodule "seed/stage0-posix"]
path = seed/stage0-posix
url = https://github.com/oriansj/stage0-posix
[submodule "builder-hex0"]
path = builder-hex0
url = https://github.com/ironmeld/builder-hex0

1
builder-hex0 Submodule

@ -0,0 +1 @@
Subproject commit 8a6be6d30fda0357fdeb4aa4bbbc6d475f9869b2

File diff suppressed because it is too large Load Diff

View File

@ -236,13 +236,14 @@ class Generator():
def create_builder_hex0_disk_image(self, image_file_name, size):
"""Create builder-hex0 disk image"""
shutil.copyfile(os.path.join('seed', 'stage0-posix', 'bootstrap-seeds',
'NATIVE', 'x86', 'builder-hex0-x86-stage1.img'),
image_file_name)
with open(image_file_name, 'ab') as image_file:
# Compile and write stage1 binary seed
with open(os.path.join('builder-hex0', 'builder-hex0-x86-stage1.hex0'),
encoding="utf-8") as infile:
for line in infile:
image_file.write(bytes.fromhex(line.split('#')[0].split(';')[0].strip()))
# Append stage2 hex0 source
with open(os.path.join('kernel-bootstrap', 'builder-hex0-x86-stage2.hex0'),
with open(os.path.join('builder-hex0', 'builder-hex0-x86-stage2.hex0'),
encoding="utf-8") as infile:
image_file.write(infile.read().encode())
# Pad to next sector