feature: boot.mgr replace hardcoded init sequence with dependency-driven boot manager
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
This commit is contained in:
1 parent
dd56ffbcb4
commit
2d190c221a
116 files changed
+1922
-465
No files matched your search
@@ -0,0 +1,79 @@
|
||||
unit test;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
boot.mgr;
|
||||
|
||||
procedure init();
|
||||
procedure runAllTests();
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
core.strings,
|
||||
driver.bus.usb.types,
|
||||
driver.bus.usb.core,
|
||||
driver.bus.usb.uhci,
|
||||
driver.bus.usb.ohci,
|
||||
driver.bus.usb.ehci,
|
||||
driver.bus.usb.xhci,
|
||||
driver.bus.usb.hub,
|
||||
driver.hid.usb.keyboard,
|
||||
driver.hid.usb.mouse,
|
||||
core.ds.fifo,
|
||||
core.ds.cfifo,
|
||||
core.ds.cfifols,
|
||||
core.ds.lifo,
|
||||
core.ds.circ,
|
||||
wasm.test,
|
||||
core.ds.minh,
|
||||
core.ds.maxh,
|
||||
core.ds.prio,
|
||||
driver.storage.vfs,
|
||||
driver.storage.test,
|
||||
core.enc.fnv1a,
|
||||
core.enc.djb2,
|
||||
core.ds.bloom,
|
||||
core.fmt.json;
|
||||
|
||||
procedure init();
|
||||
begin
|
||||
{ Stub for now }
|
||||
end;
|
||||
|
||||
procedure runAllTests();
|
||||
begin
|
||||
{ Run unit tests }
|
||||
core.strings.UnitTest;
|
||||
driver.bus.usb.types.UnitTest;
|
||||
driver.bus.usb.core.UnitTest;
|
||||
driver.bus.usb.uhci.UnitTest;
|
||||
driver.bus.usb.ohci.UnitTest;
|
||||
driver.bus.usb.ehci.UnitTest;
|
||||
driver.bus.usb.xhci.UnitTest;
|
||||
driver.bus.usb.hub.UnitTest;
|
||||
driver.hid.usb.keyboard.UnitTest;
|
||||
driver.hid.usb.mouse.UnitTest;
|
||||
core.ds.fifo.UnitTest;
|
||||
core.ds.cfifo.UnitTest;
|
||||
core.ds.cfifols.UnitTest;
|
||||
core.ds.lifo.UnitTest;
|
||||
core.ds.circ.UnitTest;
|
||||
wasm.test.run_all_tests;
|
||||
core.ds.minh.UnitTest;
|
||||
core.ds.maxh.UnitTest;
|
||||
core.ds.prio.UnitTest;
|
||||
driver.storage.vfs.UnitTest;
|
||||
driver.storage.test.UnitTest;
|
||||
core.enc.fnv1a.UnitTest;
|
||||
core.enc.djb2.UnitTest;
|
||||
core.ds.bloom.UnitTest;
|
||||
core.fmt.json.UnitTest;
|
||||
end;
|
||||
|
||||
initialization
|
||||
boot.mgr.registerBoot('asuro.test.init', @init, 'Initialize Test Framework', BOOT_MGR_BARRIER_MID);
|
||||
boot.mgr.registerBoot('asuro.test.run', @runAllTests, 'Run Unit Tests', BOOT_MGR_BARRIER_LATE);
|
||||
|
||||
end.
|
||||
Reference in new issue
Block a user