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

+15 -16
View File
@@ -23,9 +23,8 @@ interface
uses
tracer, lmemorymanager,
util, console, terminal, strings,
util, strings,
net, nettypes, netutils,
netlog,
lists,
eth2;
@@ -37,7 +36,7 @@ procedure register;
implementation
uses
arp;
arp, stdio;
var
Registered : Boolean = false;
@@ -132,7 +131,7 @@ begin
pop_trace;
end;
procedure terminal_command_ifconfig(params : PParamList);
procedure terminal_command_ifconfig(params : PParamList; stdin_buf, stdout_buf, stderr_buf : POutBuf);
var
Command, Sub, Address, Gateway, Netmask : pchar;
_Address, _Gateway, _Netmask : puint8;
@@ -158,7 +157,7 @@ begin
kfree(void(_Gateway));
kfree(void(_Netmask));
end else begin
writestringlnWND('Invalid number of params to call ''set''.', getTerminalHWND);
stdio.bufWriteStrLn(stderr_buf, 'Invalid number of params to call ''set''.');
end;
end;
if StringEquals(Command, 'net') then begin
@@ -174,18 +173,18 @@ begin
CopyIPv4(@Config.Gateway[0], @Target[0]);
arp.sendRequest(@Target[0]);
end else begin
writestringWND(' MAC: ', getTerminalHWND);
writeMACAddress(net.GetMAC, getTerminalHWND);
writestringWND(' IPv4: ', getTerminalHWND);
writeIPv4Address(@Config.Address[0], getTerminalHWND);
writestringWND(' Gateway: ', getTerminalHWND);
writeIPv4Address(@Config.Gateway[0], getTerminalHWND);
writestringWND(' Netmask: ', getTerminalHWND);
writeIPv4Address(@Config.Netmask[0], getTerminalHWND);
stdio.bufWriteStr(stdout_buf, ' MAC: ');
writeMACAddress(net.GetMAC, stdout_buf);
stdio.bufWriteStr(stdout_buf, ' IPv4: ');
writeIPv4Address(@Config.Address[0], stdout_buf);
stdio.bufWriteStr(stdout_buf, ' Gateway: ');
writeIPv4Address(@Config.Gateway[0], stdout_buf);
stdio.bufWriteStr(stdout_buf, ' Netmask: ');
writeIPv4Address(@Config.Netmask[0], stdout_buf);
if Config.UP then
writestringlnWND(' NetUP: true', getTerminalHWND)
stdio.bufWriteStrLn(stdout_buf, ' NetUP: true')
else
writestringlnWND(' NetUP: false', getTerminalHWND);
stdio.bufWriteStrLn(stdout_buf, ' NetUP: false');
end;
end;
@@ -206,7 +205,7 @@ begin
end;
Config.UP:= false;
eth2.registerType($0800, @recv);
terminal.registerCommand('IFCONFIG', @terminal_command_ifconfig, 'Configure Network Settings.');
stdio.registerCommand('IFCONFIG', @terminal_command_ifconfig, 'Configure Network Settings.');
Registered:= true;
end;
pop_trace;