Introduce boot.mgr - a self-registering, dependency-ordered boot initialization framework with barrier-based phasing and glob pattern matching. Units now declare their own init procedures and dependencies via registerBoot()/registerBarrier() in their initialization sections, boot.mgr.run() topologically sorts and executes them. - Add src/boot/boot.mgr.pas with topoSort, glob matching, barrier two-pass algorithm, and boot tree printer - Gut src/asuro.pas (kmain): now just stores multiboot info, calls System.init(), boot.mgr.run, and yield() - Add initialization sections with registerBoot() to 53 existing units - Add new units: core.pas, test.pas, driver.storage.boot.pas, app.wasm.pas, app.bsod.pas (factored out of asuro.pas) - Define 9 barrier phases: immediate -> early -> middle -> storage -> bus -> device -> bus.late -> late -> final - Fix xHCI ISR: exclude PRC/WRC from PORTSC change bit clearing to prevent race with port reset busy-wait - Fix driver.bus.usb.core fire_completion_hooks: guard against uint32 underflow when CompletionHookCount = 0 - Move auto_mount_volumes from device barrier to late barrier so it runs after PCI scan discovers storage controllers - Add toolchain/compile_initcalls.sh for boot entry extraction - Add Boot Registration sections to all 51 doc files; create 4 new doc files; rewrite boot.mgr.md; update mkdocs.yml nav
56 lines
1.3 KiB
Bash
56 lines
1.3 KiB
Bash
#!/usr/bin/env bash
|
|
ERRCOUNT=0
|
|
echo " "
|
|
echo "======================="
|
|
echo " "
|
|
echo "Asuro Compilation"
|
|
echo " "
|
|
|
|
#Compile Stub.asm
|
|
rm -f lib/*
|
|
|
|
runOrFail() {
|
|
local binary=$1
|
|
local errorText=$2
|
|
if $binary; then
|
|
echo "Success."
|
|
else
|
|
echo "$errorText"
|
|
ERRCOUNT=$((ERRCOUNT+1))
|
|
fi
|
|
}
|
|
|
|
TOOLCHAIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
declare -a run_steps=(
|
|
"compile_stub.sh" "Failed to compile stub!"
|
|
"compile_vergen.sh" "Versions failed to compile"
|
|
"compile_lvgl.sh" "Failed to compile LVGL!"
|
|
"compile_icons.sh" "Failed to generate icons!"
|
|
"compile_wasuro.sh" "Failed to pull Wasuro!"
|
|
"compile_sources.sh" "Failed to compile FPC Sources!"
|
|
"compile_initcalls.sh" "Failed to generate INITFINAL table!"
|
|
"compile_link.sh" "Failed linking!"
|
|
"compile_isogen.sh" "Failed to create ISO!"
|
|
"compile_docs.sh" "Failed to generate documentation!"
|
|
)
|
|
|
|
for ((i=0; i<${#run_steps[@]}; i+=2))
|
|
do
|
|
if [ "$ERRCOUNT" -eq "0" ]
|
|
then
|
|
script="${TOOLCHAIN_DIR}/${run_steps[$i]}"
|
|
message="${run_steps[$i+1]}"
|
|
runOrFail "$script" "$message"
|
|
fi
|
|
done
|
|
|
|
#Call generate final artifacts based on failure or success of the above.
|
|
if [ "$ERRCOUNT" -ne "0" ]
|
|
then
|
|
. "${TOOLCHAIN_DIR}/compile_finish.sh" "failed"
|
|
else
|
|
. "${TOOLCHAIN_DIR}/compile_finish.sh" "success"
|
|
fi
|
|
|
|
cd .. |