Compare commits

..
13 Commits
Author SHA1 Message Date
Aaron 6c7bcc1911 better testing
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-04 00:00:56 +00:00
Aaron e09c9b5595 refactor 2026-03-04 00:00:56 +00:00
Aaron 9476bb0c8a compile 2026-03-04 00:00:56 +00:00
Aaron 8f7db8507b Queues 2026-03-04 00:00:56 +00:00
t3hn3rd 452203b7b4 Merge pull request 'bug: vtop incorrect bitmask' (#36) from feature/vtop-fix into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #36
Reviewed-by: Aaron Hance <[email protected]>
2026-03-03 20:03:47 +00:00
t3hn3rd 76c419336e bug: vtop incorrect bitmask
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Fix for issue #32 in which the incorrect bitmask ($FFFFFF) is used where
  $3FFFFF should be used instead. (24 vs 22 bits).
2026-03-03 19:10:08 +00:00
admin 2ad0ae8420 Merge pull request 'feature/gitattributes' (#30) from feature/gitattributes into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #30
2026-03-02 21:56:56 +00:00
t3hn3rd c0c199bfe6 .gitattributes update
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Updated .gitattributes linguist excludes for compile-time directories.
2026-03-02 21:48:10 +00:00
t3hn3rd 7ec3bcb9b9 .gitattributes & doc directory
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Added gitattributes for linguist exclusions
- Created empty doc folder for local working docs
2026-03-02 21:41:14 +00:00
admin 4bd0a2dfbf Merge pull request 'Merge feature/graphics-interrupts into develop' (#14) from feature/graphics-interrupts into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #14
2026-03-02 19:19:46 +00:00
admin 431e5bc8f4 Merge pull request 'Merge feature/USB into develop' (#13) from feature/USB into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #13
2026-03-02 19:14:05 +00:00
t3hn3rd 8169d93a9c refactor: move render loop & USB hotplug to timer-driven units
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Replace the blocking main render loop in kernel.pas with two new
timer-hooked units that are driven by the 1024Hz PIT interrupt:

- graphicsrefresh: calls desktop.update, uidebug.update, lvgl_handler
  and video.Flush every 4 ticks (~256 FPS target).
- usbhotplug: calls usbcore.usb_check_hotplug every 1024 ticks (~1Hz).

The kernel main procedure now registers both timer hooks and enters an
idle STI/HLT loop (kernel.yield), allowing the CPU to sleep between
interrupts instead of busy-spinning.

Also removes the unused myUserLandFunction and reorders early syslog
init calls for clarity.
2026-03-02 19:04:42 +00:00
admin 983d9a428d Merge pull request 'feature: Tracer O(1) ring buffer refactor' (#12) from feature/tracer-optimizations into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #12
2026-03-01 22:29:53 +00:00
18 changed files with 2736 additions and 27 deletions
+8 -1
View File
@@ -1 +1,8 @@
* text=auto eol=lf
* text=auto eol=lf
lvglh/** linguist-vendored
lvgl/** linguist-vendored
.vscode/* linguist-vendored
lib/* linguist-generated
release/* linguist-generated
iso/* linguist-generated
*.asm linguist-detectable
+1
View File
@@ -15,3 +15,4 @@ localenv.json
dockerout.txt
AGENTS.md
*.log
/doc/*.md
+1 -1
View File
@@ -4,4 +4,4 @@ echo "======================="
echo " "
echo "Compiling FPC Sources..."
echo " "
fpc -Aelf -gw -g -gl -n -v0ew -O3 -OpPENTIUM3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* -Fusrc/driver/bus/* -Fusrc/driver/bus/usb/* -Fusrc/driver/hid/* src/kernel.pas
fpc -Aelf -gw -g -gl -n -v0ew -O3 -OpPENTIUM3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/include/* -Fusrc/driver/* -Fusrc/driver/net/* -Fusrc/driver/bus/* -Fusrc/driver/bus/usb/* -Fusrc/driver/hid/* src/kernel.pas
View File
+52
View File
@@ -0,0 +1,52 @@
{
Driver->Timer->GraphicsRefresh - Timer-driven graphics refresh at ~120FPS.
Hooks into the 1024Hz timer (TMR_0_ISR) and calls the desktop, uidebug,
LVGL and video flush routines every ~9 ticks (1024/9 ≈ 113.8 FPS).
@author(Kieron Morris <[email protected]>)
}
unit graphicsrefresh;
interface
procedure init;
implementation
uses
util,
TMR_0_ISR,
desktop,
uidebug,
lvgl,
video,
syslog;
const
{ 1024 / 4 ≈ 256 FPS }
TICKS_PER_FRAME = 4;
var
TickCounter : uint32;
procedure on_tick(data : void);
begin
TickCounter := TickCounter + 1;
if TickCounter >= TICKS_PER_FRAME then begin
TickCounter := 0;
desktop.update;
uidebug.update;
lvgl_handler;
video.Flush;
end;
end;
procedure init;
begin
TickCounter := 0;
TMR_0_ISR.hook(uint32(@on_tick));
syslog.logln('GFXREFRESH', 'Hooked into 1024Hz timer (~120 FPS).');
end;
end.
+46
View File
@@ -0,0 +1,46 @@
{
Driver->Timer->USBHotplug - Timer-driven USB hotplug polling at ~1Hz.
Hooks into the 1024Hz timer (TMR_0_ISR) and calls
usbcore.usb_check_hotplug every 1024 ticks (approximately once per second).
@author(Kieron Morris <[email protected]>)
}
unit usbhotplug;
interface
procedure init;
implementation
uses
util,
TMR_0_ISR,
usbcore,
syslog;
const
{ 1024 ticks at 1024Hz ≈ 1 second }
TICKS_PER_POLL = 1024;
var
TickCounter : uint32;
procedure on_tick(data : void);
begin
TickCounter := TickCounter + 1;
if TickCounter >= TICKS_PER_POLL then begin
TickCounter := 0;
usbcore.usb_check_hotplug;
end;
end;
procedure init;
begin
TickCounter := 0;
TMR_0_ISR.hook(uint32(@on_tick));
syslog.logln('USBHOTPLUG', 'Hooked into 1024Hz timer (~1Hz polling).');
end;
end.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+26 -24
View File
@@ -66,7 +66,9 @@ uses
rand,
hashmap, vfs,
video, vesa, doublebuffer, color, lvgl, desktop, uidebug,
vterminal;
vterminal,
graphicsrefresh, usbhotplug,
fifo, cfifo, cfifols, lifo, circ, minh, maxh, prio;
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
@@ -103,18 +105,14 @@ begin
pop_trace;
end;
procedure myUserLandFunction;
var
i : uint32;
procedure yield();
begin
i:=0;
while true do begin
i:=i+1;
asm
MOV EAX, i
end;
end;
asm
sti
@idle:
hlt
jmp @idle
end;
end;
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall; [public, alias: 'kmain'];
@@ -132,6 +130,7 @@ begin
{ Syslog Init — right after serial so log hooks work }
syslog.init();
syslog.writestringln('Booting Asuro...');
{ Store Multiboot info }
multibootinfo:= mbinfo;
@@ -140,10 +139,8 @@ begin
{ Ensure tracer is frozen }
tracer.freeze();
syslog.writestringln('Booting Asuro...');
syslog.writestringln('Checking for Multiboot Compliance');
{ Check for Multiboot }
syslog.writestringln('Checking for Multiboot Compliance');
if (multibootmagic <> MULTIBOOT_BOOTLOADER_MAGIC) then begin
syslog.logln('KERNEL', 'Multiboot Compliant Boot-Loader Needed!');
syslog.logln('KERNEL', 'HALTING.');
@@ -275,17 +272,22 @@ begin
usbhub.UnitTest;
usb_keyboard.UnitTest;
usb_mouse.UnitTest;
fifo.UnitTest;
cfifo.UnitTest;
cfifols.UnitTest;
lifo.UnitTest;
circ.UnitTest;
minh.UnitTest;
maxh.UnitTest;
prio.UnitTest;
{ Main render loop — USB completions are now interrupt-driven }
syslog.logln('KERNEL', 'Entering main render loop.');
while true do begin
desktop.update;
uidebug.update;
lvgl_handler;
usbcore.usb_check_hotplug;
video.Flush();
end;
{ Register timer-driven tasks }
graphicsrefresh.init;
usbhotplug.init;
{ All work is now driven by timer interrupts — idle the CPU }
syslog.logln('KERNEL', 'All tasks registered. Halting into idle.');
kernel.yield();
end;
end.
+1 -1
View File
@@ -190,7 +190,7 @@ begin
push_trace('vmemorymanager.vtop');
idx:= address SHR 22;
paddress:= uint32(KERNEL_PAGE_DIRECTORY^[idx].address) SHL 12;
loadd:= address AND $FFFFFF;
loadd:= address AND $3FFFFF;
vtop:= paddress + loadd;
pop_trace;
end;