refactor/feature/fix: Major refactor of codebase
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

refactor(stdio): replace console/terminal command system with buffer-based stdio
- Introduced stdio.pas as the unified command I/O layer.
- All 31 command procedures across 15 files now receive stdin_buf,
  stdout_buf, and stderr_buf (POutBuf) instead of a single outbuf.
- vterminal.pas creates all three buffers per command invocation and
  displays both stdout and stderr.
- Deleted console.pas, terminal.pas, and 9 obsolete windowing programs
  (shell, splash, edit, memview, themer, netlog, vmlog, vmstate, udpcat).
- Migrated all registerCommand calls to stdio, rewrote vterminal
  processCommand to use stdio.findCommand, and added proper error
  routing to stderr for invalid params, bad paths, and system errors.

refactor(syslog): replace console logging with serial-backed syslog
- Introduced syslog.pas for kernel-level logging over serial/dev.
- Migrated all boot logging in kernel.pas from console.outputln/
  writestringln to syslog.logln/writestringln.
- Converted 19 fault handlers, hashmap, lists, scheduler, tracer, net,
  udp, and all driver init paths to use syslog.
- Rewrote BSOD in util.pas (50+ calls) from console to syslog.
- Removed CONSOLE_SLOW_REDRAW, TRGB565, TRGB565Pair, and HWND
  from system.pas.

fix(keyboard): add ring buffer and proper press/release cycling for LVGL input
- Replaced the single last_key/key_pressed slot in lvgl.pas with a
  16-entry ring buffer (kb_buf, kb_head, kb_tail) to prevent ISR
  overwrites when typing fast.
- Added a kb_pending_release flag so each keystroke gets a
  full PRESSED->RELEASED cycle before the next key is consumed —
  LVGL requires this pairing and was silently dropping intermediate
  keys when receiving consecutive PRESSED events without
  intervening releases.

feat(vterminal): use Hack monospace font for terminal output
- Added Hack Regular 14px (hack_14.c) as a custom LVGL font.
- Removed the .static_bitmap field from the generated font file
  (not present in LVGL 9.2 lv_font_t struct).
- Declared the hack_14 external symbol in lvgl.pas and switched
  vterminal's text label from lv_font_montserrat_14 to hack_14
  for proper monospace terminal rendering.
This commit is contained in:
t3hn3rd committed 2026-03-01 02:06:31 +00:00
1 parent dbe6e958e2
commit f752be48ce
92 files changed
+14917 -5797

No files matched your search

+1 -1
View File
@@ -75,7 +75,7 @@ procedure tick_update(data : void);
implementation
uses
console, vmemorymanager;
vmemorymanager;
procedure tick_update(data : void);
begin
+12 -12
View File
@@ -22,7 +22,7 @@ unit hashmap;
interface
uses
md5, util, strings, lmemorymanager, console, tracer;
md5, util, strings, lmemorymanager, tracer, syslog;
type
DPHashItem = ^PHashItem;
@@ -265,23 +265,23 @@ var
begin
for i:=0 to map^.Size-1 do begin
if map^.table[i] <> nil then begin
writestring('Map[');
writeint(i);
writestring(']->(0)="');
writestring(map^.table[i]^.key);
writestring('"');
syslog.writestring('Map[');
syslog.writeint(i);
syslog.writestring(']->(0)="');
syslog.writestring(map^.table[i]^.key);
syslog.writestring('"');
item:= map^.table[i]^.next;
c:=1;
while item <> nil do begin
writestring('->(');
writeint(c);
writestring(')="');
writestring(item^.key);
writestring('"');
syslog.writestring('->(');
syslog.writeint(c);
syslog.writestring(')="');
syslog.writestring(item^.key);
syslog.writestring('"');
inc(c);
item:= item^.next;
end;
writestringln(' ');
syslog.writestringln(' ');
end;
end;
end;
+37 -37
View File
@@ -22,7 +22,7 @@ unit lists;
interface
uses
console,
syslog,
lmemorymanager,
tracer,
util;
@@ -1119,28 +1119,28 @@ var
testStr2: pchar;
begin
{ --- Test Managed Linked List --- }
console.writeString('--- Testing Managed Linked List ---');
syslog.writeString('--- Testing Managed Linked List ---');
ll := LL_New(sizeof(uint32));
for i := 1 to 3 do
begin
p := LL_Add(ll);
puint32(p)^ := i; // Store the value (1, 2, 3)
end;
console.writeString('Managed Linked List Size: ');
console.writeintln(LL_Size(ll));
syslog.writeString('Managed Linked List Size: ');
syslog.writeintln(LL_Size(ll));
for i := 0 to LL_Size(ll) - 1 do
begin
p := LL_Get(ll, i);
console.writeString('Element ');
console.writeint(i);
console.writeString(': ');
console.writeintln(puint32(p)^);
syslog.writeString('Element ');
syslog.writeint(i);
syslog.writeString(': ');
syslog.writeintln(puint32(p)^);
end;
LL_Free(ll);
{ --- Test String Linked List --- }
console.writeString('');
console.writeString('--- Testing String Linked List ---');
syslog.writeString('');
syslog.writeString('--- Testing String Linked List ---');
testStr := stringNew(5);
PuInt8(testStr)^ := ord('H');
PuInt8(testStr + 1)^ := ord('e');
@@ -1159,65 +1159,65 @@ begin
strList := STRLL_New;
STRLL_Add(strList, testStr);
STRLL_Add(strList, testStr2);
console.writeString('String Linked List Size: ');
console.writeintln(STRLL_Size(strList));
syslog.writeString('String Linked List Size: ');
syslog.writeintln(STRLL_Size(strList));
for i := 0 to STRLL_Size(strList) - 1 do
begin
console.writeString('String ');
console.writeint(i);
console.writeString(': ');
console.writeString(STRLL_Get(strList, i));
syslog.writeString('String ');
syslog.writeint(i);
syslog.writeString(': ');
syslog.writeString(STRLL_Get(strList, i));
end;
STRLL_Free(strList);
{ --- Test Dynamic List --- }
console.writeString('');
console.writeString('--- Testing Dynamic List ---');
syslog.writeString('');
syslog.writeString('--- Testing Dynamic List ---');
dlist := DL_New(sizeof(uint32));
for i := 1 to 5 do
begin
intPtr := DL_Add(dlist);
intPtr^ := i * 10; // Store values: 10, 20, 30, 40, 50
end;
console.writeString('Dynamic List Size: ');
console.writeintln(DL_Size(dlist));
syslog.writeString('Dynamic List Size: ');
syslog.writeintln(DL_Size(dlist));
for i := 0 to DL_Size(dlist) - 1 do
begin
intPtr := DL_Get(dlist, i);
console.writeString('Element ');
console.writeint(i);
console.writeString(': ');
console.writeintln(intPtr^);
syslog.writeString('Element ');
syslog.writeint(i);
syslog.writeString(': ');
syslog.writeintln(intPtr^);
end;
{ Insert a new element at index 2 }
intPtr := DL_Insert(dlist, 2);
if intPtr <> nil then
intPtr^ := 999; // Inserted value 999 at index 2
console.writeString('After insertion at index 2, size: ');
console.writeintln(DL_Size(dlist));
syslog.writeString('After insertion at index 2, size: ');
syslog.writeintln(DL_Size(dlist));
for i := 0 to DL_Size(dlist) - 1 do
begin
intPtr := DL_Get(dlist, i);
console.writeString('Element ');
console.writeint(i);
console.writeString(': ');
console.writeintln(intPtr^);
syslog.writeString('Element ');
syslog.writeint(i);
syslog.writeString(': ');
syslog.writeintln(intPtr^);
end;
{ Delete element at index 3 }
if DL_Delete(dlist, 3) then
console.writeString('Deleted element at index 3.');
console.writeString('After deletion, size: ');
console.writeintln(DL_Size(dlist));
syslog.writeString('Deleted element at index 3.');
syslog.writeString('After deletion, size: ');
syslog.writeintln(DL_Size(dlist));
for i := 0 to DL_Size(dlist) - 1 do
begin
intPtr := DL_Get(dlist, i);
console.writeString('Element ');
console.writeint(i);
console.writeString(': ');
console.writeintln(intPtr^);
syslog.writeString('Element ');
syslog.writeint(i);
syslog.writeString(': ');
syslog.writeintln(intPtr^);
end;
DL_Free(dlist);
end;
-1
View File
@@ -26,7 +26,6 @@ interface
uses
util,
lmemorymanager,
console,
tracer;
const
-3
View File
@@ -46,9 +46,6 @@ function boolToString(b : boolean; ext : boolean) : pchar;
implementation
uses
console;
function hexStringToInt(str : pchar) : uint32;
var
result : uint32;
-15
View File
@@ -27,7 +27,6 @@ const
KERNEL_PAGE_NUMBER = KERNEL_VIRTUAL_BASE SHR 22;
BSOD_ENABLE = true;
TRACER_ENABLE = true;
CONSOLE_SLOW_REDRAW = false; //Redraws the Window manager after every character, but slows performance.
type
//internal types
@@ -83,7 +82,6 @@ type
PDouble = ^Double;
Void = ^uInt32;
HWND = uint32;
yord = uInt8;
xord = uInt8;
@@ -128,19 +126,6 @@ type
TMask = bitpacked array[0..7] of Boolean;
PMask = ^TMask;
TRGB565 = bitpacked record
B : UBit5;
G : UBit6;
R : UBit5
end;
PRGB565 = ^TRGB565;
TRGB565Pair = bitpacked record
Background : TRGB565;
Foreground : TRGB565;
end;
PRGB565Pair = ^TRGB565Pair;
PText = ^Text;
{ ---- Types required by FPC 3.2.2 compiler internals ---- }
+31 -87
View File
File diff suppressed because it is too large. Load diff