more refactoring

This commit is contained in:
pantonshire committed 2025-04-06 14:27:55 +01:00
1 parent 909875ec5b
commit 2219fac4e5
30 files changed
+438 -1456

No files matched your search

+15 -16
View File
@@ -1,25 +1,31 @@
include_flags := "-Iinclude"
common_flags := "-werror " + include_flags
ld32 := "ld -m elf_i386"
run:
qemu-system-x86_64 \
-monitor stdio \
-no-reboot \
-bios seabios/out/bios.bin \
-m 512M \
-drive format=raw,file=disk.bin
build:
nasm -f bin {{common_flags}} -o s1.bin stages/s1/s1.s
nasm -f elf {{common_flags}} -o stages/s2/s2.o stages/s2/s2.s
nasm -f elf {{common_flags}} -o stages/s3/s3.o stages/s3/s3.s
nasm -f elf {{common_flags}} -o stages/s3/a20.o stages/s3/a20.s
ld.lld -T s2.ld -o s234.bin stages/s2/*.o stages/s3/*.o stages/s4/target/protected32/release/libs4.a
#-bios seabios/out/bios.bin
build: build_stage_1 build_stage_2
build_stage_1:
nasm -f bin {{common_flags}} -o stage_1/stage_1.bin stage_1/main.s
build_stage_2:
nasm -f elf {{common_flags}} -o stage_2/prelude.o stage_2/prelude.s
nasm -f elf {{common_flags}} -o stage_2/main.o stage_2/main.s
nasm -f elf {{common_flags}} -o stage_2/a20.o stage_2/a20.s
{{ld32}} -m elf_i386 -T stage_2/link.ld -o stage_2/stage_2.bin stage_2/*.o
mkimg:
dd if=/dev/zero of=disk.bin bs=440 count=1 conv=notrunc
dd if=s1.bin of=disk.bin conv=notrunc
dd if=s234.bin of=disk.bin bs=512 seek=70 conv=notrunc
dd if=stage_1/stage_1.bin of=disk.bin conv=notrunc
dd if=stage_2/stage_2.bin of=disk.bin bs=512 seek=70 conv=notrunc
# build:
# nasm -f bin -Iinclude -o boot0.bin boot0.s
@@ -45,10 +51,3 @@ partition_disk:
parted --script disk.bin mkpart stage2 70s 900s
parted --script disk.bin type 6 fdffea69-3651-442f-a11d-88a09bf372dd
# write_stage1:
# dd if=/dev/zero of=disk.bin bs=440 count=1 conv=notrunc
# dd if=boot0.bin of=disk.bin conv=notrunc
# write_stage2:
# # dd if=boot1.bin of=disk.bin bs=512 seek=70 conv=notrunc
# dd if=boot1/target/target_protected/release/boot1 of=disk.bin bs=512 seek=70 conv=notrunc