Compare commits
4 Commits
8a6730bc9c
...
828428e73b
| Author | SHA1 | Date | |
|---|---|---|---|
| 828428e73b | |||
| 402bf9974d | |||
| 5dfc3533d9 | |||
| d9225718c2 |
@@ -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
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
out/*
|
||||
build/*
|
||||
build/output/*
|
||||
*.img
|
||||
*.img.gz
|
||||
*.img.gz
|
||||
|
||||
14
Makefile
14
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)
|
||||
|
||||
0
build/.keep_dir
Normal file
0
build/.keep_dir
Normal file
0
build/output/.keep_dir
Normal file
0
build/output/.keep_dir
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user