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,33 @@
|
||||
unit app.bsod;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
io.stdio,
|
||||
debug.tracer,
|
||||
core.panic;
|
||||
|
||||
procedure init;
|
||||
|
||||
implementation
|
||||
|
||||
procedure terminal_command_bsod(params : PParamList; stdin_buf, stdout_buf, stderr_buf : POutBuf);
|
||||
begin
|
||||
push_trace('kernel.terminal_command_bsod');
|
||||
|
||||
if paramCount(params) > 1 then begin
|
||||
core.panic.panic(getparam(0, params), getparam(1, params), nil);
|
||||
end else begin
|
||||
io.stdio.bufWriteStrLn(stderr_buf, 'Invalid number of params.');
|
||||
io.stdio.bufWriteStrLn(stderr_buf, 'Usage: bsod <error> <info>');
|
||||
end;
|
||||
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
procedure init;
|
||||
begin
|
||||
io.stdio.registerCommand('BSOD', @terminal_command_bsod, 'Force a Panic Screen.');
|
||||
end;
|
||||
|
||||
end.
|
||||
+10
-1
@@ -23,6 +23,7 @@ unit app.mgr;
|
||||
interface
|
||||
|
||||
uses
|
||||
boot.mgr,
|
||||
debug.tracer, io.stdio, proc.mgr,
|
||||
//progs
|
||||
app.base64, app.md5sum, app.dhclient, app.vbeinfo, app.testcmd, app.ping, app.meminfo, app.setres,
|
||||
@@ -34,7 +35,10 @@ uses
|
||||
driver.storage.filedispatch,
|
||||
//wasm
|
||||
app.wasm.runner,
|
||||
app.divzero;
|
||||
app.divzero,
|
||||
app.bsod,
|
||||
app.vterminal,
|
||||
app.filebrowser;
|
||||
|
||||
{ Initialize all baked-in programs }
|
||||
procedure init();
|
||||
@@ -86,7 +90,12 @@ begin
|
||||
app.wasm.runner.init();
|
||||
app.setres.init();
|
||||
app.divzero.init();
|
||||
app.bsod.init();
|
||||
app.vterminal.init;
|
||||
app.filebrowser.init();
|
||||
end;
|
||||
|
||||
Initialization
|
||||
boot.mgr.registerBoot('app.mgr', @init, 'Program Manager', BOOT_MGR_BARRIER_LATE);
|
||||
|
||||
end.
|
||||
@@ -0,0 +1,25 @@
|
||||
unit app.wasm;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
boot.mgr;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
io.syslog,
|
||||
wasm.vm.io,
|
||||
wasm;
|
||||
|
||||
procedure init();
|
||||
begin
|
||||
{ Let's test Wasuro! }
|
||||
wasm.vm.io.io_set_writechar(@io.syslog.logchar);
|
||||
wasm.wasm_init;
|
||||
end;
|
||||
|
||||
initialization
|
||||
boot.mgr.registerBoot('app.wasm', @init, 'Initialize WASM VM Backend', BOOT_MGR_BARRIER_FINAL)
|
||||
|
||||
end.
|
||||
Reference in new issue
Block a user