refactor: namespace restructure of entire codebase
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Reorganize all source files into a hierarchical namespace structure with dot-separated unit names matching directory paths. Major changes: - src/prog/ -> src/app/ (app.*.pas) - src/fault/ -> src/arch/x86/fault/ (arch.x86.fault.*.pas) - src/isr/ -> src/arch/x86/isr/ (arch.x86.isr.*.pas) - src/include/ -> src/core/ (core.*.pas) + src/arch/x86/ - src/driver/ subtree reorganized with driver.* namespace prefixes - src/driver/storage/con/ -> src/driver/storage/ctl/ (Windows reserved name fix) - src/driver/storage/ split into con(ctl)/fs/vol/ subdirectories - src/driver/net/ flattened from l1-l5 layers to driver.net.*.pas - kernel.pas -> asuro.pas, faults.pas -> arch.x86.faults.pas - stdio.pas/syslog.pas -> io/io.stdio.pas, io/io.syslog.pas - processmanager.pas -> proc/proc.mgr.pas - lmemorymanager.pas -> memory/memory.heap.pas - Build scripts moved to toolchain/ - Added compat/ shims for lmemorymanager and types - Added doc/namespace.md tracking the refactor 197 files changed, 6292 insertions(+), 5526 deletions(-)
This commit is contained in:
1 parent
e922f086c2
commit
6fa008ed79
197 files changed
+6291
-5525
No files matched your search
@@ -0,0 +1,76 @@
|
||||
{
|
||||
prog->GraphicsRefresh - Continuous graphics rendering process.
|
||||
|
||||
Spawns a dedicated render process that loops indefinitely, driving the
|
||||
driver.video.desktop, LVGL and driver.video-flush pipeline. The loop does real work every
|
||||
iteration (especially the 7.3 MB SSE framebuffer copy in driver.video.Flush),
|
||||
which keeps the vCPU active so the NEM/Hyper-V back-end never
|
||||
deschedules it and starves the PIT of interrupts.
|
||||
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit svc.gfxd;
|
||||
|
||||
interface
|
||||
|
||||
procedure init;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
driver.video.desktop,
|
||||
app.uidebug,
|
||||
driver.video.lvgl,
|
||||
driver.video,
|
||||
driver.video.windows,
|
||||
proc.mgr,
|
||||
proc.types,
|
||||
io.syslog,
|
||||
arch.x86.isr.tmr0;
|
||||
|
||||
{ Render process entry point — runs as a normal scheduled process with
|
||||
interrupts enabled. Continuously drives the full render pipeline so
|
||||
the vCPU is always executing real work (no HLT / PAUSE spin-waits
|
||||
that would trigger pause-loop exits under NEM/Hyper-V). }
|
||||
|
||||
const
|
||||
TICKS_PER_FRAME = 32; { target ticks per frame; adjust as needed to balance refresh rate and CPU usage }
|
||||
|
||||
var
|
||||
LAST_UPDATE : uint32 = 0;
|
||||
CURRENT_TICK : uint32 = 0;
|
||||
|
||||
procedure render_loop(ctx : PProcessContext);
|
||||
var
|
||||
should_update : boolean;
|
||||
|
||||
begin
|
||||
while true do begin
|
||||
should_update := (CURRENT_TICK - LAST_UPDATE) >= TICKS_PER_FRAME;
|
||||
should_update := should_update or (CURRENT_TICK < LAST_UPDATE); { handle tick counter wraparound }
|
||||
if (should_update) then begin
|
||||
LAST_UPDATE := CURRENT_TICK;
|
||||
driver.video.windows.reapOrphanedWindows;
|
||||
driver.video.desktop.update;
|
||||
app.uidebug.update;
|
||||
lvgl_handler;
|
||||
driver.video.Flush;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure tick;
|
||||
begin
|
||||
{ This function is called on every timer tick (interrupt 32) via the ISR hooks.
|
||||
It can be used to trigger periodic tasks without needing a dedicated process. }
|
||||
CURRENT_TICK := CURRENT_TICK + 1;
|
||||
end;
|
||||
|
||||
procedure init;
|
||||
begin
|
||||
arch.x86.isr.tmr0.hook(uint32(@tick)); { Register the tick handler to run on every timer interrupt }
|
||||
proc.mgr.create('gfxd', @render_loop, nil, 5);
|
||||
io.syslog.logln('gfxd', 'Render process spawned.');
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
Prog->USBHotplug - driver.bus.usb hotplug daemon process.
|
||||
|
||||
Spawns a dedicated 'usbd' process that polls for driver.bus.usb port changes
|
||||
approximately once per second using proc.mgr.proc_sleep_ms.
|
||||
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit svc.usbd;
|
||||
|
||||
interface
|
||||
|
||||
procedure init;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
driver.bus.usb.core,
|
||||
proc.mgr,
|
||||
proc.types,
|
||||
io.syslog;
|
||||
|
||||
{ driver.bus.usb daemon process entry point — polls for hotplug events once per second. }
|
||||
procedure usbd_loop(ctx : PProcessContext);
|
||||
begin
|
||||
while true do begin
|
||||
driver.bus.usb.core.usb_check_hotplug;
|
||||
proc.mgr.proc_sleep_ms(1000);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure init;
|
||||
begin
|
||||
proc.mgr.create('usbd', @usbd_loop, nil, 2);
|
||||
io.syslog.logln('usbd', 'driver.bus.usb hotplug daemon spawned.');
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in new issue
Block a user