wip refactor

This commit is contained in:
pantonshire committed 2025-03-04 09:48:46 +00:00
1 parent ae2720c826
commit 2b1a9f9412
15 files changed
+906 -20

No files matched your search

+21 -10
View File
@@ -1,3 +1,6 @@
include_flags := "-Iinclude"
common_flags := "-werror " + include_flags
run:
qemu-system-x86_64 \
-monitor stdio \
@@ -6,11 +9,19 @@ run:
-m 512M \
-drive format=raw,file=disk.bin
build:
nasm -f bin -Iinclude -o boot0.bin boot0.s
cd boot1; cargo build --release
# nasm -f bin -Iinclude -o boot1.bin boot1.s
nasm -f bin {{common_flags}} -o s1.bin stages/s1/s1.s
nasm -f elf -werror -Iinclude -o stages/s2/s2.o stages/s2/s2.s
nasm -f elf -werror -Iinclude -o stages/s3/s3.o stages/s3/s3.s
nasm -f elf -werror -Iinclude -o stages/s3/a20.o stages/s3/a20.s
ld -T s2.ld -o s234.bin stages/s2/*.o stages/s3/*.o
# TODO: try with gnu ld
# build:
# nasm -f bin -Iinclude -o boot0.bin boot0.s
# cd boot1; cargo build --release
# # nasm -f bin -Iinclude -o boot1.bin boot1.s
zero_disk:
dd if=/dev/zero of=disk.bin bs=512 count=1000
@@ -31,10 +42,10 @@ 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_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
# 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