From 402bf9974d708cf38ac5fe0bf3fc6c90224ba2cd Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Sun, 24 Aug 2025 10:47:18 -0400 Subject: [PATCH] moved map file output to build moved output of builds to build/output updated gitea action --- .gitea/workflows/onpush.yaml | 4 +++- Makefile | 14 +++++++------- scripts/create-disk.sh | 21 ++++++++++++--------- src/mbr/mbr.nasm | 2 +- src/stage2/stage2.nasm | 2 +- src/vbr/vbr.nasm | 2 +- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.gitea/workflows/onpush.yaml b/.gitea/workflows/onpush.yaml index feed079..ccb6b23 100644 --- a/.gitea/workflows/onpush.yaml +++ b/.gitea/workflows/onpush.yaml @@ -33,6 +33,8 @@ jobs: with: name: stevia-${{ github.run_number }} path: | - build/** + build/output/artifacts.tar.gz + build/output/disk.img.gz + build/output/part.img.gz if-no-files-found: error retention-days: 30 # override server default if you like \ No newline at end of file diff --git a/Makefile b/Makefile index c568a56..63bed43 100755 --- a/Makefile +++ b/Makefile @@ -32,8 +32,8 @@ GIT_VERSION := $(shell git describe --tags) GIT_HASH := $(shell git rev-parse HEAD) GIT_NASM_DEFINES := -D __GIT_VER__='"$(GIT_VERSION)"' -D __GIT_HASH__='"$(GIT_HASH)"' -iso := '/tmp/disk.img' -isoz := 'disk.img.gz' +iso := 'build/disk.img' +isoz := 'build/output/disk.img.gz' qemu_args := -L ./bin/ -bios bios.bin -cpu pentium3 -m 128 -S -s -monitor stdio -nic none .PHONY: all mbr vbr stage2 boottest clean run run_bochs iso isoz @@ -45,10 +45,11 @@ stage2: $(stage2_binary_files) boottest: $(boottest_binary_files) clean: - @rm -rvf *.map - @rm -rvf $(build_dir)/* - @rm -rvf $(iso) - @rm -rvf $(isoz) + @rm -v $(build_dir)/*.bin + @rm -v $(build_dir)/*.map + @rm -v $(build_dir)/*.img + @rm -v $(build_dir)/output/*.img.gz + @rm -v $(build_dir)/output/*.tar.gz run: $(iso) @sudo qemu-system-i386 $(qemu_args) -hda $(iso) @@ -79,7 +80,6 @@ build/%.bin: src/miniboot32/%.nasm @nasm -i$(include) -Wall -f bin $(GIT_NASM_DEFINES) $< -o $@ $(iso): $(mbr_binary_files) $(vbr_binary_files) $(stage2_binary_files) $(boottest_binary_files) - @echo root access needed to create disk image... @scripts/create-disk.sh $(isoz): $(iso) diff --git a/scripts/create-disk.sh b/scripts/create-disk.sh index 4469461..cfe7f0b 100755 --- a/scripts/create-disk.sh +++ b/scripts/create-disk.sh @@ -23,9 +23,13 @@ stage2_file=build/stage2.bin boottest_file=build/BOOTi686.bin # Disk creation options -disk_img=/tmp/disk.img -disk_img_final=build/disk.img.gz -part_img=/tmp/part.img +disk_img=build/disk.img +disk_img_final=build/output/disk.img.gz + +part_img=build/part.img +part_img_final=build/output/part.img.gz + +artifacts_archive=build/output/artifacts.tar.gz # $disk_sector_size * $disk_size = total bytes, default is 256MiB disk_sectors=(524288 * 2) @@ -140,16 +144,15 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then dd if="$stage2_file" of="$disk_img" bs=$disk_sector_size seek=1 conv=notrunc echo "[7/7] Assembling final disk image" - # place partition at it's place in the disk image dd if="$part_img" of="$disk_img" bs=$disk_sector_size seek=$part_start conv=notrunc - gzip -9c "$disk_img" > "$disk_img_final" -# requires util-linux from homebrew -elif [[ "$OSTYPE" == "darwin"* ]]; then - echo "[WIP]" + echo " *** Outputing disk images will be in ./build/output/* *** " + gzip -9c "$disk_img" > "$disk_img_final" + gzip -9c "$part_img" > "$part_img_final" + tar caf "$artifacts_archive" build/*.bin build/*.map else # Unknown. - echo "Unknown OS type! Supported build hosts systems are GNU/Linux (WSL) and macOS." + echo "Unknown OS type! Supported build hosts systems are GNU/Linux (& WSL)" exit 1 fi \ No newline at end of file diff --git a/src/mbr/mbr.nasm b/src/mbr/mbr.nasm index 6c7dc35..3e81ada 100755 --- a/src/mbr/mbr.nasm +++ b/src/mbr/mbr.nasm @@ -18,7 +18,7 @@ [CPU KATMAI] [WARNING -reloc-abs-byte] [WARNING -reloc-abs-word] ; Yes, we use absolute addresses. surpress these warnings. -[map all mbr.map] +[map all build/mbr.map] %define __STEVIA_MBR jmp short (init - $$) nop diff --git a/src/stage2/stage2.nasm b/src/stage2/stage2.nasm index 239dad1..283d9f9 100755 --- a/src/stage2/stage2.nasm +++ b/src/stage2/stage2.nasm @@ -16,7 +16,7 @@ [BITS 16] [ORG 0x0500] ; IF YOU CHANGE ORG CHANGE THE SIGN OFFSET AT THE END [CPU KATMAI] -[map all stage2.map] +[map all build/stage2.map] [WARNING -reloc-abs-byte] [WARNING -reloc-abs-word] [WARNING -reloc-abs-dword] ; Yes, we use absolute addresses. surpress these warnings. diff --git a/src/vbr/vbr.nasm b/src/vbr/vbr.nasm index 7f7e9af..2f3dc76 100755 --- a/src/vbr/vbr.nasm +++ b/src/vbr/vbr.nasm @@ -17,7 +17,7 @@ [CPU KATMAI] [WARNING -reloc-abs-byte] [WARNING -reloc-abs-word] -[map all vbr.map] ; Yes, we use absolute addresses. surpress these warnings. +[map all build/vbr.map] ; Yes, we use absolute addresses. surpress these warnings. %define __STEVIA_VBR section .text __ENTRY: