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
File diff suppressed because it is too large.
Load diff
@@ -13,6 +13,7 @@ unit boot.splash;
|
||||
interface
|
||||
|
||||
uses
|
||||
boot.mgr,
|
||||
driver.video.lvgl, driver.video, core.fmt.targa, core.gfx.texture, memory.heap;
|
||||
|
||||
{ Create the boot.splash screen and render the initial frame (0 %). }
|
||||
@@ -82,6 +83,9 @@ var
|
||||
logoTexture: PTexture;
|
||||
logoDsc: PLVImageDsc;
|
||||
|
||||
var
|
||||
Initialized : boolean = false;
|
||||
|
||||
{ ---- private helpers -------------------------------------------------- }
|
||||
|
||||
{ Build an lv_image_dsc_t that points to the decoded ARGB8888 pixel data. }
|
||||
@@ -217,10 +221,13 @@ begin
|
||||
|
||||
{ Push the first frame to the display. }
|
||||
redraw;
|
||||
|
||||
Initialized := true;
|
||||
end;
|
||||
|
||||
procedure update(percent: uint32; status: pchar);
|
||||
begin
|
||||
if not Initialized then exit;
|
||||
if splashScreen = nil then exit;
|
||||
|
||||
{ Clamp to 0..100 }
|
||||
@@ -232,11 +239,12 @@ begin
|
||||
redraw;
|
||||
|
||||
{ DEBUG: pause so each step is visible on screen }
|
||||
busywait_500ms;
|
||||
//busywait_500ms;
|
||||
end;
|
||||
|
||||
procedure teardown;
|
||||
begin
|
||||
if not Initialized then exit;
|
||||
if splashScreen = nil then exit;
|
||||
|
||||
{ Switch back to the screen that was active before the splash. }
|
||||
@@ -260,6 +268,11 @@ begin
|
||||
kfree(void(logoTexture));
|
||||
logoTexture := nil;
|
||||
end;
|
||||
Initialized := false;
|
||||
end;
|
||||
|
||||
Initialization
|
||||
boot.mgr.registerBoot('boot.splash', @init, 'Boot Splash Screen', 'core.panic');
|
||||
boot.mgr.registerBoot('boot.splash.teardown', @teardown, 'Stop Splash Screen', BOOT_MGR_BARRIER_FINAL);
|
||||
|
||||
end.
|
||||
Reference in new issue
Block a user