Compare commits

...
Author SHA1 Message Date
t3hn3rd e55da49900 feature: add architecture-agnostic kernel panic (BSOD) engine
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Introduce core.panic, a new architecture-agnostic kernel panic engine
with a pre-allocated LVGL BSOD screen. The screen and all widgets are
created at init time so that zero LVGL allocation occurs at panic time.

Layout features:
- Top banner with decoded teapot TGA image (128x128) and title/subtitle
- Two-column content area with dark semi-transparent cards:
  - Left: Fault Details, CPU Registers, Process Info, System Info
  - Right: Call Stack (full height)
- Pastel red background (#7A2828), monospace text for data sections

Key changes:
- Add core.panic.pas with pre-built BSOD screen, register/trace/system
  info formatting, hex conversion helpers, and syslog fallback
- Add arch.x86.panic.pas as the x86 bridge: packs interrupt registers
  into a TRegisterSnapshot and calls core.panic.panic()
- Simplify all 19 x86 fault handlers to one-liner panic calls
- Remove legacy BSOD code from arch.x86.util.pas
- Add teapot.tga (256x256) embedded via splash_tga.asm
- Add LVGL bindings: lv_refr_now, lv_image_create, lv_image_set_src,
  lv_image_set_scale, lv_image_set_inner_align, and style helpers
- Wire up panic init and test command in asuro.pas
2026-03-08 16:44:21 +00:00
admin 7abb38ccbe Merge pull request 'Namespace Restructure' (#54) from feature/refactor into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #54
Reviewed-by: Aaron Hance <[email protected]>
2026-03-08 12:47:41 +00:00
t3hn3rd c2aaf1a5c9 fix: minor cleanup after namespace refactor
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Shorten 'driver.video.windows: ' label to 'Windows: ' in uidebug
- Shorten e1000 terminal command name from 'driver.net.dev.e1000' to 'E1000'
- Auto-generated version bump (build artifact)

3 files changed, 7 insertions(+), 7 deletions(-)
2026-03-08 12:07:35 +00:00
t3hn3rd 021aa0d82e refactor: namespace cleanup pass 2
continuous-integration/drone/push Build is passing
- Rename driver.intf.serial -> driver.io.serial (intf/ -> io/)
- Move net protocols to driver.net.proto.* (net/ -> net/proto/)
  - arp, dhcp, eth2, icmp, ipv4, tcp, udp
- Move netdev to driver.net.dev.* (netdev/ -> net/dev/)
  - e1000
- Move driver.net.pas into driver/net/
- Move driver.video.pas into driver/video/
- Rename arch.x86.faults -> arch.x86.fault, move to fault/ dir
- Move driver.storage.ctl.ahci.pas into ctl/ahci/
- Move driver.storage.ctl.ide.pas into ctl/ide/
- Move linker.script and version to toolchain/
- Update all unit references and namespace doc

35 files changed, 237 insertions(+), 234 deletions(-)
2026-03-08 10:00:41 +00:00
t3hn3rd 6fa008ed79 refactor: namespace restructure of entire codebase
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(-)
2026-03-08 01:28:31 +00:00
admin e922f086c2 Merge pull request 'WASM Execution Pipeline, File Dispatch & Supporting Infrastructure' (#52) from feature/wasm into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #52
Reviewed-by: Aaron Hance <[email protected]>
2026-03-07 22:29:29 +00:00
admin 605ec9d817 Merge pull request 'Standalone SHA-1 hashing implementation' (#51) from feature/sha1 into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #51
Reviewed-by: Aaron Hance <[email protected]>
2026-03-07 22:12:38 +00:00
t3hn3rd 1ae867d929 fix: adapt subsystems to new VFS volume API and fix desktop program registry
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- ramdrive: rewrite from registerDrive callbacks to TFilesystem/TStorage_Volume
  hooks (rd_Read, rd_ReadDir, rd_ReadOffset, rd_Identify) and mount via
  vfs.mountVolume('/disk/ram', ...). Remove open-slot tracking; VFS now
  manages file handles through the FD table.

- vfs: fix PathValid for otDRIVE nodes — split relative path into parent
  directory + leaf name, list the parent via readDirCallback, and check
  each entry's type so individual files are correctly identified as pvFile
  instead of always returning pvDirectory or pvInvalid.

- desktop: replace static array[0..MAX_PROGRAMS-1] program registry with
  a dynamic PLinkedListBase. Lazy-init on first registerProgram call.
  Remove prog_count := 0 from init so programs registered before
  desktop.init (e.g. notepad, diskutil) are no longer wiped.

- filedispatch, wasmrunner: add storagetypes to uses, remove stale Lock
  parameter from vfs.OpenFile calls.

- progmanager: clean up duplicate uses clauses and remove invalid
  kernel.bsod registration.
2026-03-07 22:12:18 +00:00
t3hn3rd 40a1c05728 Fix: missing imports in wasmio.pas 2026-03-07 21:26:26 +00:00
t3hn3rd 2bfbb44cfb feature: WASM execution pipeline, file dispatch, RAM drive, and VFS handle table
- Add file-type dispatch registry (filedispatch.pas) matching files by
  magic header bytes and routing to registered handlers
- Add WASM integration layer: wasmshim, wasmio, wasmrunner, wasmcleanup
  providing full WASI Preview1 bridging (fd_write/read, proc_exit,
  clock, random, args passthrough, environ stubs)
- Add RAM drive (ramdrive.pas) providing in-memory VFS at /disk/ram
  with a built-in hello world WASM binary
- (Placeholder) Implement VFS handle table for proper
  open/read/write/close/filesize routing through registered drives
  and devices
- Integrate file dispatch into vterminal for unknown commands, supporting
  both foreground and background execution of dispatched files
- Expand progmanager init with PS, KILL, TERMINATE, DEV, DISK, MEMRAW,
  BSOD, IFCONFIG, ARP, and TCP commands; wire up ramdrive, filedispatch,
  and wasmrunner initialization
- Replace serial.sendString with syslog.logln in desktop launcher
2026-03-07 21:26:25 +00:00
t3hn3rd 8ab2d0d04f fix: drone pipeline not working
- compile_wasuro.sh was copying files to the /code directory which
  is not where drone builds from, fixed to use $(pwd) and relative
  directories based on the root.
2026-03-07 21:24:13 +00:00
t3hn3rd b51881ced7 feat: integrate Wasuro WASM runtime into Asuro build chain
- Add compile_wasuro.sh to sparse-clone Wasuro src/wasm from gitea
  (develop branch) with caching to skip redundant pulls
- Update compile.sh to include wasuro build step in pipeline
- Update compile_sources.sh to dynamically discover -Fu paths via
  find across src/ and wasuro/ directories
- Extend system.pas with FPC 3.2.2 compilerprocs required by Wasuro:
  - 64-bit signed/unsigned div and mod (fpc_div_int64, fpc_mod_int64,
    fpc_div_qword, fpc_mod_qword) with correct i386 parameter mapping
  - 64-bit multiply (fpc_mul_int64) via three 32-bit MUL instructions
  - Float-to-integer intrinsics (Trunc, Round) using x87 FPU
  - Memory allocation compilerprocs (fpc_getmem, fpc_freemem)
    delegating to kernel kalloc/kfree
  - Exception handling stubs (reraise, raiseexception, catches, doneexception)
  - setjmp/longjmp for exception address stack
  - Fix sInt64 type alias (was longint/32-bit, now int64/64-bit)
  - Add serial debug helpers (COM1 $3F8) for bare-metal tracing
- Wire up Wasuro in kernel.pas: init WASM VM, set I/O callback to
  syslog, and run all 1103 Wasuro tests (0 failures)
- Update .gitignore to exclude wasuro/ cache directory
2026-03-07 21:24:12 +00:00
t3hn3rd 0d6f1e006c feature: preemptive process management - implementation progress
Implement a preemptive multitasking system for the Asuro kernel.

Context Switching & Scheduling:
- Custom IRQ0 ISR (contextswitcher.pas) with PUSHAD/POPAD ESP-swap
- Round-robin scheduler with priority-based quantum
- Process table using DList of PProcessContext pointers
- Idle process (PID 0) replaces kernel HLT loop

Process Lifecycle:
- create/kill/terminate/sendMessage API (processmanager.pas)
- Process states: Created, Running, Ready, Suspended, Awaiting,
  Finished, Error
- Parent-child tracking (ParentID, smChildExited notification on reap)
- proc_yield, proc_sleep_ms, proc_await, proc_suspend, proc_exit

Resource Binding & Cleanup:
- Per-process resource list
  (bindResource/unbindResource/unbindAllResources)
- TCP sockets auto-bound to owning process (OwnerPID on TTCPSocket)
- socket_cleanup + auto-unbind in DestroySocket

VTerminal Refactor:
- Multi-instance design (heap-allocated TVTermState per terminal)
- Foreground process with incremental stdout/stderr drain via LVGL timer
- Ctrl+C kills foreground process (killForeground)
- Per-terminal CWD, dir stack, FS builtins (CD/LS/PUSHD/POPD)
- Background job support (& suffix, JOBS/FG commands)
- Command history (Up/Down arrow)

Command Consolidation:
- 14 commands extracted from 9 units into centralized progmanager.pas
- Command procedures exported in host unit interfaces
- E1000/TRACER/stdio builtins kept in-place (conditional/circular)

New Units:
- src/include/proctypes.pas — process type definitions
- src/processmanager.pas — core process manager
- src/prog/ping.pas — standalone ICMP ping process
- src/prog/testcmd.pas — test command (proc_sleep_ms demo)
- src/testprocs.pas — process subsystem smoke tests

Misc:
- ICMP callbacks gain userData parameter for concurrency-safe ping
- CLI/STI guards on kalloc/kfree (lmemorymanager.pas)
- LV_KEY_CTRLC constant + Ctrl+C interception in LVGL keyboard hook
- Window owner PID tracking (windows.pas)
- ISR_32 gate override support (isrmanager.pas)
2026-03-07 21:21:45 +00:00
t3hn3rd c70c0b52c3 Rebase: Fixed accidentally removed unit tests.
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-07 21:05:12 +00:00
t3hn3rd 452cc0c8c8 Rebased on develop & remove test code from Kernel main.
continuous-integration/drone/push Build is passing
2026-03-07 20:59:42 +00:00
t3hn3rd 3d334b8e8b feature: SHA-1 Hashing
- Add SHA-1 hashing implementation with Init/Update/Final API and inline test in kernel,
  following the same interface as MD5 & the fpc rtl.
2026-03-07 20:58:51 +00:00
t3hn3rd b9643a7b56 feature: SHA-1 Hashing
- Add SHA-1 hashing implementation with Init/Update/Final API and inline test in kernel,
  following the same interface as MD5 & the fpc rtl.
2026-03-07 20:58:22 +00:00
Aaron 6902a406b0 Merge pull request 'GPU Stack, V8086 Monitor & BGA Driver' (#50) from feature/gpu-stack-v8086-bga into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #50
Reviewed-by: Aaron Hance <[email protected]>
2026-03-07 20:56:19 +00:00
209 changed files with 9296 additions and 5784 deletions
+2 -2
View File
@@ -22,8 +22,8 @@ steps:
commands:
- git fetch --tags
- find . -type f -print0 | xargs -0 dos2unix
- chmod +x /drone/src/*.sh
- /drone/src/compile.sh
- chmod +x /drone/src/toolchain/*.sh
- /drone/src/toolchain/compile.sh
- name: upload-iso-artifact
image: alpine/git
+3 -1
View File
@@ -16,4 +16,6 @@ dockerout.txt
AGENTS.md
lessons_learnt.md
*.log
/doc/*.md
/doc/*.md
wasuro
src/core/core.version.pas
+1 -2
View File
@@ -14,10 +14,9 @@ RUN curl -sL https://sourceforge.net/projects/freepascal/files/Linux/$FPC_VERSIO
pushd fpc-$FPC_VERSION.i386-linux && ./install.sh && popd && \
rm -rf fpc-$FPC_VERSION.i386-linux
COPY compile.sh /compile.sh
ADD https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver /usr/bin/semver
RUN chmod +x /usr/bin/semver
WORKDIR /code
RUN find . -type f -print0 | xargs -0 dos2unix
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/compile.sh"]
CMD ["find toolchain -name '*.sh' -exec dos2unix {} + 2>/dev/null; find toolchain -name '*.sh' -exec chmod +x {} +; bash toolchain/compile.sh"]
+75
View File
@@ -0,0 +1,75 @@
{ Compatibility shim: wasuro references the old unit name 'lmemorymanager'.
Since wasuro/ cannot be modified, this unit re-exports the public API of
memory.heap so that 'uses lmemorymanager' continues to compile. }
unit lmemorymanager;
interface
uses
memory.heap;
const
ALLOC_UNIT = memory.heap.ALLOC_UNIT;
DATA_OFFSET = memory.heap.DATA_OFFSET;
PAGE_SIZE_LMM = memory.heap.PAGE_SIZE_LMM;
TOTAL_UNITS = memory.heap.TOTAL_UNITS;
BITMAP_DWORDS = memory.heap.BITMAP_DWORDS;
SIZE_PREFIX = memory.heap.SIZE_PREFIX;
LARGE_ALLOC_MAGIC = memory.heap.LARGE_ALLOC_MAGIC;
type
PHeapPageHeader = memory.heap.PHeapPageHeader;
THeapPageHeader = memory.heap.THeapPageHeader;
procedure init;
function kalloc(size : uint32) : void;
function klalloc(size : uint32) : void;
procedure klfree(address : uint32);
function kpalloc(address : uint32) : void;
procedure kfree(area : void);
function lmm_total_free : uint32;
function lmm_page_count : uint32;
implementation
procedure init;
begin
memory.heap.init;
end;
function kalloc(size : uint32) : void; inline;
begin
kalloc := memory.heap.kalloc(size);
end;
function klalloc(size : uint32) : void; inline;
begin
klalloc := memory.heap.klalloc(size);
end;
procedure klfree(address : uint32); inline;
begin
memory.heap.klfree(address);
end;
function kpalloc(address : uint32) : void; inline;
begin
kpalloc := memory.heap.kpalloc(address);
end;
procedure kfree(area : void); inline;
begin
memory.heap.kfree(area);
end;
function lmm_total_free : uint32; inline;
begin
lmm_total_free := memory.heap.lmm_total_free;
end;
function lmm_page_count : uint32; inline;
begin
lmm_page_count := memory.heap.lmm_page_count;
end;
end.
+7
View File
@@ -0,0 +1,7 @@
unit types;
interface
implementation
end.
-8
View File
@@ -1,8 +0,0 @@
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
echo "Compiling Stub..."
echo " "
nasm -f elf src/stub/stub.asm -o lib/stub.o
nasm -f elf src/stub/splash_tga.asm -o lib/splash_tga.o
+648
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

@@ -17,12 +17,12 @@
@author(Angus C <angus@actm.uk>)
}
unit base64_prog;
unit app.base64;
interface
uses
stdio, util, strings, tracer, base64, lmemorymanager;
io.stdio, core.util, arch.x86.util, core.strings, debug.tracer, core.enc.base64, memory.heap;
procedure init();
@@ -38,7 +38,7 @@ var
PSize : uInt32;
begin
tracer.push_trace('base64_prog.run');
debug.tracer.push_trace('base64_prog.run');
if paramCount(Params) > 1 then begin
encdec := getParam(0, Params);
if stringEquals(encdec, 'encode') then begin
@@ -58,23 +58,23 @@ begin
dec(pinput);
pinput^ := #0;
result := b64_encode_str(input);
stdio.bufWriteStrLn(stdout_buf, result);
io.stdio.bufWriteStrLn(stdout_buf, result);
kfree(void(result));
end else if stringEquals(encdec, 'decode') then begin
input := getParam(1, Params);
result := b64_decode_str(input);
stdio.bufWriteStrLn(stdout_buf, result);
io.stdio.bufWriteStrLn(stdout_buf, result);
kfree(void(result));
end else stdio.bufWriteStrLn(stderr_buf, 'Usage: base64 <encode/decode> <text>');
end else io.stdio.bufWriteStrLn(stderr_buf, 'Usage: core.enc.base64 <encode/decode> <text>');
end else begin
stdio.bufWriteStrLn(stderr_buf, 'Usage: base64 <encode/decode> <text>');
io.stdio.bufWriteStrLn(stderr_buf, 'Usage: core.enc.base64 <encode/decode> <text>');
end;
end;
procedure init();
begin
tracer.push_trace('base64_prog.init');
stdio.registerCommand('BASE64', @Run, 'Perform Base64 Encode/Decode.');
debug.tracer.push_trace('base64_prog.init');
io.stdio.registerCommand('BASE64', @Run, 'Perform Base64 Encode/Decode.');
end;
end.
@@ -17,12 +17,12 @@
@author(Kieron Morris <kjm@kieronmorris.me>)
}
unit dhclient;
unit app.dhclient;
interface
uses
stdio, util, strings, tracer, dhcp;
io.stdio, core.util, arch.x86.util, core.strings, debug.tracer, driver.net.proto.dhcp;
procedure init();
@@ -30,14 +30,14 @@ implementation
procedure run(Params : PParamList; stdin_buf, stdout_buf, stderr_buf : POutBuf);
begin
tracer.push_trace('dhclient.run');
debug.tracer.push_trace('dhclient.run');
DHCPDiscover();
end;
procedure init();
begin
tracer.push_trace('dhclient.init');
stdio.registerCommand('DHClient', @Run, 'Run the DHCP configuration utility.');
debug.tracer.push_trace('dhclient.init');
io.stdio.registerCommand('DHClient', @Run, 'Run the DHCP configuration utility.');
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
@@ -17,12 +17,12 @@
@author(Kieron Morris <kjm@kieronmorris.me>)
}
unit md5sum;
unit app.md5sum;
interface
uses
stdio, util, strings, tracer, md5;
io.stdio, core.util, arch.x86.util, core.strings, debug.tracer, core.enc.md5;
procedure init();
@@ -40,15 +40,15 @@ begin
wordlen:= stringSize(md5word);
MD5_Hash := MD5Buffer(puint8(md5word), wordlen);
for i:=0 to 15 do begin
stdio.bufWriteHexPair(stdout_buf, MD5_Hash^[i]);
io.stdio.bufWriteHexPair(stdout_buf, MD5_Hash^[i]);
end;
stdio.bufWriteStrLn(stdout_buf, ' ');
io.stdio.bufWriteStrLn(stdout_buf, ' ');
end;
procedure init();
begin
tracer.push_trace('md5sum.init');
stdio.registerCommand('MD5SUM', @Run, 'Perform MD5SUM on a word.');
debug.tracer.push_trace('md5sum.init');
io.stdio.registerCommand('MD5SUM', @Run, 'Perform MD5SUM on a word.');
end;
end.
+83
View File
@@ -0,0 +1,83 @@
// Copyright 2021 Kieron Morris
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
{
Prog->app.meminfo - Print memory statistics (PMM / LMM).
@author(Kieron Morris <[email protected]>)
}
unit app.meminfo;
interface
uses
io.stdio, arch.x86.multiboot, arch.x86.memory.physical, memory.heap, debug.tracer;
procedure init();
implementation
procedure run(Params : PParamList; stdin_buf, stdout_buf, stderr_buf : POutBuf);
var
pmm_total, pmm_free, pmm_used : uint32;
lmm_pages, lmm_free : uint32;
begin
{ Multiboot memory info }
io.stdio.bufWriteStrLn(stdout_buf, '--- Multiboot ---');
io.stdio.bufWriteStr(stdout_buf, 'Lower Memory : ');
io.stdio.bufWriteInt(stdout_buf, multibootinfo^.mem_lower);
io.stdio.bufWriteStrLn(stdout_buf, ' KB');
io.stdio.bufWriteStr(stdout_buf, 'Upper Memory : ');
io.stdio.bufWriteInt(stdout_buf, multibootinfo^.mem_upper);
io.stdio.bufWriteStrLn(stdout_buf, ' KB');
io.stdio.bufWriteStr(stdout_buf, 'Total Memory : ');
io.stdio.bufWriteInt(stdout_buf, ((multibootinfo^.mem_upper + 1000) div 1024) + 1);
io.stdio.bufWriteStrLn(stdout_buf, ' MB');
{ PMM stats }
io.stdio.bufWriteStrLn(stdout_buf, '--- PMM (4 MB blocks) ---');
pmm_total := arch.x86.memory.physical.pmm_total_blocks;
pmm_free := arch.x86.memory.physical.pmm_free_blocks;
pmm_used := pmm_total - pmm_free;
io.stdio.bufWriteStr(stdout_buf, 'Total Blocks : ');
io.stdio.bufWriteIntLn(stdout_buf, pmm_total);
io.stdio.bufWriteStr(stdout_buf, 'Free Blocks : ');
io.stdio.bufWriteIntLn(stdout_buf, pmm_free);
io.stdio.bufWriteStr(stdout_buf, 'Used Blocks : ');
io.stdio.bufWriteIntLn(stdout_buf, pmm_used);
io.stdio.bufWriteStr(stdout_buf, 'Free Physical : ');
io.stdio.bufWriteInt(stdout_buf, pmm_free * 4);
io.stdio.bufWriteStrLn(stdout_buf, ' MB');
{ LMM heap stats }
io.stdio.bufWriteStrLn(stdout_buf, '--- LMM (Heap) ---');
lmm_pages := memory.heap.lmm_page_count;
lmm_free := memory.heap.lmm_total_free;
io.stdio.bufWriteStr(stdout_buf, 'Heap Pages : ');
io.stdio.bufWriteIntLn(stdout_buf, lmm_pages);
io.stdio.bufWriteStr(stdout_buf, 'Heap Size : ');
io.stdio.bufWriteInt(stdout_buf, lmm_pages * 4);
io.stdio.bufWriteStrLn(stdout_buf, ' MB');
io.stdio.bufWriteStr(stdout_buf, 'Heap Free : ');
io.stdio.bufWriteInt(stdout_buf, lmm_free div 1024);
io.stdio.bufWriteStrLn(stdout_buf, ' KB');
end;
procedure init();
begin
debug.tracer.push_trace('meminfo.init');
io.stdio.registerCommand('MEMINFO', @Run, 'Print memory statistics (PMM/LMM).');
end;
end.
+86
View File
@@ -0,0 +1,86 @@
// Copyright 2021 Kieron Morris
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
{
ProgManager - Central initialization for terminal registered, baked-in programs.
@author(Kieron Morris <[email protected]>)
@author(Aaron Hance <[email protected]>)
}
unit app.mgr;
interface
uses
debug.tracer, io.stdio, proc.mgr,
//progs
app.base64, app.md5sum, app.dhclient, app.vbeinfo, app.testcmd, app.ping, app.meminfo, app.setres,
//drivers
driver.storage.ctl.ram, driver.mgr,
//network
driver.net.proto.ipv4, driver.net.proto.arp, driver.net.proto.tcp,
//dispatch
driver.storage.filedispatch,
//wasm
app.wasm.runner;
{ Initialize all baked-in programs }
procedure init();
implementation
uses
core.version,
//command provider units
arch.x86.cpu,
app.diskcmd, driver.bus.usb.core, app.diskutil, app.notepad, app.partcmd, app.volcmd;
procedure init();
begin
debug.tracer.push_trace('app.mgr.init');
{ Register commands from provider units }
io.stdio.registerCommand('CPU', @arch.x86.cpu.Terminal_Command_CPU, 'CPU Info.');
io.stdio.registerCommand('DEV', @driver.mgr.terminal_command_dev, 'Driver Management Interface.');
io.stdio.registerCommand('PS', @proc.mgr.terminal_command_ps, 'List running processes.');
io.stdio.registerCommand('KILL', @proc.mgr.terminal_command_kill, 'Force-kill a process by PID.');
io.stdio.registerCommand('TERMINATE', @proc.mgr.terminal_command_terminate, 'Gracefully terminate a process by PID.');
io.stdio.registerCommand('ARP', @driver.net.proto.arp.terminal_command_arp, 'Get ARP Table.');
io.stdio.registerCommand('IFCONFIG', @driver.net.proto.ipv4.terminal_command_ifconfig, 'Configure Network Settings.');
io.stdio.registerCommand('TCPCONNECT', @driver.net.proto.tcp.terminal_command_tcpconnect, 'Connect to a TCP host and send Hello World.');
io.stdio.registerCommand('TCPLISTEN', @driver.net.proto.tcp.terminal_command_tcplisten, 'Listen on a TCP port and log received data.');
io.stdio.registerCommand('TCPHTTP', @driver.net.proto.tcp.terminal_command_tcphttp, 'Send HTTP GET to a host IP (port 80 default).');
io.stdio.registerCommand('USB', @driver.bus.usb.core.terminal_command_usb, 'driver.bus.usb subsystem information.');
{ Initialize baked-in programs }
app.diskcmd.init();
app.partcmd.init();
app.volcmd.init();
app.diskutil.init();
app.notepad.init();
app.md5sum.init();
app.base64.init();
app.dhclient.init();
app.vbeinfo.init();
app.testcmd.init();
app.ping.init();
app.meminfo.init();
{ File dispatch & WASM integration }
driver.storage.ctl.ram.init();
driver.storage.filedispatch.init();
app.wasm.runner.init();
app.setres.init();
end;
end.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More