Compare commits

...
205 Commits
Author SHA1 Message Date
admin 7ed8012c7e Merge pull request 'feature/boot.mgr' (#71) from feature/boot.mgr into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #71
Reviewed-by: Aaron Hance <[email protected]>
2026-03-14 20:38:39 +00:00
t3hn3rd e7f7325c54 Fix unicode characters
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-14 20:02:25 +00:00
t3hn3rd 516be28057 Rebase on develop: fix duplicate include.
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-13 15:49:03 +00:00
t3hn3rd 2d190c221a feature: boot.mgr replace hardcoded init sequence with dependency-driven boot manager
Introduce boot.mgr - a self-registering, dependency-ordered boot
initialization framework with barrier-based phasing and glob pattern
matching. Units now declare their own init procedures and dependencies
via registerBoot()/registerBarrier() in their initialization sections,
boot.mgr.run() topologically sorts and executes them.

- Add src/boot/boot.mgr.pas with topoSort, glob matching, barrier
  two-pass algorithm, and boot tree printer
- Gut src/asuro.pas (kmain): now just stores multiboot info, calls
  System.init(), boot.mgr.run, and yield()
- Add initialization sections with registerBoot() to 53 existing units
- Add new units: core.pas, test.pas, driver.storage.boot.pas,
  app.wasm.pas, app.bsod.pas (factored out of asuro.pas)
- Define 9 barrier phases: immediate -> early -> middle -> storage ->
  bus -> device -> bus.late -> late -> final
- Fix xHCI ISR: exclude PRC/WRC from PORTSC change bit clearing to
  prevent race with port reset busy-wait
- Fix driver.bus.usb.core fire_completion_hooks: guard against uint32
  underflow when CompletionHookCount = 0
- Move auto_mount_volumes from device barrier to late barrier so it
  runs after PCI scan discovers storage controllers
- Add toolchain/compile_initcalls.sh for boot entry extraction
- Add Boot Registration sections to all 51 doc files; create 4 new
  doc files; rewrite boot.mgr.md; update mkdocs.yml nav
2026-03-13 15:37:43 +00:00
Aaron dd56ffbcb4 Merge pull request 'feature/file_browser' (#61) from feature/file_browser into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #61
2026-03-12 19:26:21 +00:00
Aaron ee7dcd107b feat(filebrowser): add delete button to toolbar, fix FAT32 delete/rename with raw sector scanning
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Add SYM_TRASH toolbar button wired to fb_delete_cb (was missing entirely)
- Filter '.' and '..' entries in fb_collect_cb so they never appear
- Rewrite deleteFile/deleteDir/renameFile to use raw sector scanning
  instead of getDirEntries linked-list indices (fixes  gap mismatch)
- Handle root directory correctly (use bootRecord^.rootCluster instead
  of assuming entry 0 is '.')
2026-03-11 19:41:51 +00:00
Aaron 671c144ad5 fix: FAT32 >1024 byte read/write truncation, VFS write notifications & dir watch
- FAT32 writeFile: replace hardcoded spc=4 with bootRecord^.spc for
  cluster allocation and per-sector write loop
- FAT32 writeFile: update directory entry byteSize on disk after write
- FAT32 readFile: use dir^.byteSize instead of cluster-based estimate,
  fix off-by-one in read loop, remove spurious +sectorSize allocation
- VFS: fire VFS_OnMutation on sync/async writes (cache invalidate + watch)
- VFS: invalidate all cache entries for volume on mutation (relPath mismatch)
- VFS: add vfsParentDir helper, store VFSDir in file descriptors
- FDTable: add VFSDir field, free on close
- File browser: enable directory watch & poll timer, two-step new file
  creation (open + write), remove io.syslog import
- Linker: add --no-warn-execstack to suppress ld exit code 1 on warning
- Add core.strings.helpers unit (getFileExtension, fmtFileSize, sort)
2026-03-11 19:41:51 +00:00
Aaron 8755f108f2 refactor: rename core.stringhelpers to core.strings.helpers 2026-03-11 19:41:50 +00:00
Aaron 17ee64ba02 refactor: rename core.search to core.stringhelpers 2026-03-11 19:41:50 +00:00
Aaron 6383b35945 remove debug file 2026-03-11 19:41:50 +00:00
Aaron b9e6c53be2 removed unused icons 2026-03-11 19:41:49 +00:00
Aaron abac1ce4a3 fix: replace raw mouse hook with LVGL long-press for file browser context menu
Removed driver.hid.mouse dependency that caused page fault on close.
Context menu now triggers via LV_EVENT_LONG_PRESSED on content rows.
Cleaned up onClose teardown ordering and removed debug syslog markers.
2026-03-11 19:41:49 +00:00
Aaron 5628c1ddbf feat: file dispatch system, file-type icons, multi-instance notepad
- Add extension-based dispatch to driver.storage.filedispatch with typed
  union (variant record THandlerKind = hkMagic/hkExtension)
- Extract file-type icon constants and mapping to core.gfx.fileicons
- Add core.search utility (getFileExtension, fmtFileSize, sortStringArray)
- Generate PUA bitmap icon fonts (32/64/128px) from Font Awesome via
  gen_file_icons.py + compile_icons.sh toolchain
- Integrate file dispatch into file browser (double-click triggers dispatch)
- Register notepad as handler for text file extensions
- Fix init order in app.mgr (filedispatch.init before app inits)
- Refactor notepad from singleton to multi-instance (up to 8 windows)
  using instance array, findStateByWid, and LVGL user_data on msgboxes
2026-03-11 19:41:49 +00:00
admin 140d3d6d68 Merge pull request 'feature: add RFC 8259 JSON parser/serializer and string utility extensions' (#62) from feature/json into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #62
Reviewed-by: Aaron Hance <[email protected]>
2026-03-10 19:26:24 +00:00
admin 1ff6e7549d Merge pull request 'feature: mirror all diagnostics to syslog, add VESA fallback for gfxd crashes' (#63) from feature/panic-fallback into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #63
Reviewed-by: Aaron Hance <[email protected]>
2026-03-10 19:26:02 +00:00
t3hn3rd aa28d62e03 feature: mirror all diagnostics to syslog, add VESA fallback for gfxd crashes
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- syslogDump now outputs all five diagnostic sections (Fault Info,
  CPU Registers, Process Info, System Info, Call Stack) to serial,
  matching the on-screen BSOD content
- panic() detects if the crash occurred in the gfxd process and
  falls back to rendering the BSOD directly to the VESA framebuffer
  via driver.video text drawing, bypassing LVGL entirely
- Add DrawChar, DrawString, DrawHex, DrawInt to driver.video for
  8x16 bitmap font rendering directly to the framebuffer
- Export SHOULD_CRASH flag from svc.gfxd interface so test commands
  can trigger a deliberate gfxd crash
- Add app.divzero with DIV0, PF, and CRASHGFXD test commands
- Update doc/src/core/core.panic.md and doc/src/driver/video/driver.video.md
2026-03-10 12:35:22 +00:00
t3hn3rd 63f6c5ecc1 feature: add RFC 8259 JSON parser/serializer and string utility extensions
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Add core.fmt.json — a complete RFC 8259 JSON library with recursive-descent
parser, serializer, builders, dot/bracket path accessors, and full cleanup.
Supports all 6 JSON value types plus JSON_ERROR for parse error reporting.
Numbers stored as Double via x87 FPU. Unicode \uXXXX escapes handled
(ASCII range emitted, non-ASCII replaced with '?').

Supporting changes:
- core.strings: add int64ToString, doubleToStr (scientific notation for
  very large/small values, fixed-point for normal range, trailing zero
  trimming), plus unit tests for both
- asuro.pas: wire core.fmt.json.UnitTest into the boot test suite
- mkdocs.yml: add JSON nav entry under Formats
- doc/src/core/fmt/core.fmt.json.md: full API documentation
- doc/src/core/core.strings.md: document int64ToString and doubleToStr
- doc/planning/json.md: implementation plan and design spec
- doc/planning/webgpu.md: WebGPU-over-WASM design plan (software
  rasterizer backend for WASM apps importing webgpu.h)
2026-03-10 11:51:48 +00:00
admin 97b4460c48 Merge pull request 'Add mkdocs-material documentation site' (#59) from feature/mkdocs into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #59
Reviewed-by: Aaron Hance <[email protected]>
2026-03-08 21:41:02 +00:00
t3hn3rd 6005ee8576 fix: vfs.md incorrect link to document
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
../src/driver/storage/driver.storage.types.pas -> ../src/driver/storage/driver.storage.types.md
2026-03-08 21:24:14 +00:00
t3hn3rd 466173613f docs: fill out compat, lvglh, and toolchain documentation
continuous-integration/drone/push Build is failing
Replace placeholder content in doc/compat/, doc/lvglh/, and
doc/toolchain/ with comprehensive documentation derived from the
source files.

- compat: document Wasuro WASM VM compatibility shims
- lvglh: document LVGL v9.2.2 configuration, fonts, and patches
- toolchain: document all 13 build pipeline scripts
2026-03-08 21:19:21 +00:00
t3hn3rd d059ff1ffb Rebase on develop - add VFS planning document to mkdocs nav
continuous-integration/drone/push Build is failing
- Rebase on develop
- Move vfs.md into doc/planning/ and add it to the Planning section
in mkdocs.yml.
2026-03-08 21:08:32 +00:00
t3hn3rd 16038e55e7 fix: missing index.md from doc folder 2026-03-08 21:06:14 +00:00
t3hn3rd 019c377914 fix: use pip3 and python3 -m mkdocs for Drone compatibility
The Drone runner environment does not have `pip` or `mkdocs` on PATH
even when installed via the Docker image. Use `pip3` explicitly and
invoke mkdocs as `python3 -m mkdocs` to ensure reliable execution.
Also add --break-system-packages to the fallback install.
2026-03-08 21:06:14 +00:00
t3hn3rd 26e2fd947e feature: add mkdocs-material documentation site with CI deployment
Generate comprehensive documentation for all 173 source units and
integrate mkdocs-material into the build toolchain. Documentation
covers kernel core, x86 architecture, drivers, applications, and
all subsystems with a tabbed navigation structure.

- Add mkdocs.yml with material theme, mermaid support, and tabbed nav
- Add doc/index.md landing page
- Generate doc/src/ markdown for every Pascal unit in src/
- Reorganize planning docs into doc/planning/
- Add compat, lvglh, and toolchain doc sections
- Update Dockerfile to install python3 and mkdocs-material (pinned <2)
- Replace pasdoc-based compile_docs.sh with mkdocs build --strict
- Add compile_docs.sh to the main build pipeline in compile.sh
- Add deploy-docs step in .drone.yml with host volume mount to nginx
- Add site/.gitkeep for build output directory
2026-03-08 21:06:14 +00:00
admin 7157a57513 Merge pull request 'Major rework of the Virtual File System layer covering path resolution, I/O modes, device abstractions, symlinks, and boot mount infrastructure.' (#58) from feature/vfs_improvements into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #58
Reviewed-by: admin <[email protected]>
2026-03-08 20:16:43 +00:00
Aaron c8c7c2983d vfs: symlink support in file picker, test cleanup, boot mount fix
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- File picker (app.filepicker.pas): add otSYMLINK to directory case in
  fp_collect_cb so symlinks like /sys appear as navigable directories
- VFS: add RemoveVirtualTree() to recursively free vdir/symlink trees
- VFS UnitTest: clean up /utest_vfs tree after all tests
- STORTEST: clean up /st_test tree after tests, fix listing leak in
  cmd_stortest (GetDirectoryListingFrom result was never freed)
- Boot mount: auto-mount boot drive at /boot via mountVolume() instead
  of symlink; remove /boot and /cfg from init() vdirs
- mount.asr: remove boot line (now only 'mnt {device}/sys /sys')
2026-03-08 19:00:47 +00:00
Aaron 91bc0e5ea2 vfs: consolidate scattered type/const/var sections into single blocks 2026-03-08 18:07:44 +00:00
Aaron 2cf879c4b9 vfs: replace asr.mnt with mount.asr declarative boot mounts
- Add mount.asr parser in auto_mount_volumes: reads MOUNT.ASR from boot
  volume root, parses 'mnt {device}<src> <target>' lines, expands {device}
  to the boot volume's /disk/volN path, creates symlinks for each entry
- Remove old asr.mnt persistent mount logic from auto_mount_volumes
- Remove persistent mount write ([p] flag) from MOUNT shell command
- Remove hardcoded /boot mount for boot volumes (now driven by mount.asr)
- Add iso/mount.asr with default /boot and /sys symlinks
- Update doc/vfs.md with mount.asr documentation
2026-03-08 18:07:44 +00:00
Aaron fcc9809248 vfs: major overhaul — device nodes, stream I/O, mode simplification
- 5-phase VFS architecture overhaul (path resolution, dir cache, watch/notify,
  symlinks, async API)
- Add character/block device node layer with /dev/null and /dev/zero built-ins
- RegisterDevice() API for custom device nodes with read/write/size callbacks
- Merge TOpenMode + TWriteMode into single TOpenMode enum
  (omRead, omWrite, omCreate, omReadWrite, omStream)
- Add stream write support: WriteFile/WriteFileAsync now accept omStream handles
  with auto-advancing offset for both device and volume FDs
- Add PPWriteOffsetHook type and writeOffsetCallback field to TFilesystem
- Add PPReadOffsetHook-based streaming reads for FAT32 and ISO9660
- Update all callers (notepad, edit, inio, wasm runner, filepicker, filedispatch,
  vterminal, stdio) to new 2-param OpenFile API
- 77 unit tests (0 failures) covering path ops, dir cache, symlinks, watch,
  device nodes, and stream read/write
- Add doc/vfs.md — comprehensive public VFS API documentation
2026-03-08 18:07:44 +00:00
admin 63b67f5878 Merge pull request 'feature: add architecture-agnostic kernel panic (BSOD) engine' (#57) from feature/panic into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #57
Reviewed-by: Aaron Hance <[email protected]>
2026-03-08 17:21:41 +00:00
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 521633c9a4 Merge pull request 'feature/bloom_filter' (#55) from feature/bloom_filter into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #55
Reviewed-by: admin <[email protected]>
2026-03-08 14:24:43 +00:00
Aaron 0cd32a0f64 Fixed file header
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-08 14:04:48 +00:00
Aaron f2e5f3535a perf(ds): replace MD5 key hash in hashmap with FNV-1a32
continuous-integration/drone/push Build is passing
Removes per-lookup heap allocation (MD5Buffer/kfree) in favour of a
single zero-allocation FNV-1a32 pass. Drops core.enc.md5 dependency
from core.ds.hashmap.
2026-03-08 13:59:56 +00:00
Aaron 2159578bdf feat(ds/enc): add bloom filter, FNV-1a and DJB2 hash units
continuous-integration/drone/push Build is passing
- core.enc.fnv1a: FNV-1a 32/64-bit non-cryptographic hash with UnitTest
- core.enc.djb2: DJB2 XOR/Add 32/64-bit hash variants with UnitTest
- core.ds.bloom: probabilistic bloom filter (Bloom_New/Add/Test/Clear/Free)
  using double hashing (FNV-1a32 + DJB2_32) with UnitTest
- core.ds.types: add TBloomFilter / PBloomFilter record
- asuro.pas: wire all three UnitTests into boot test suite
2026-03-08 13:58:33 +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
t3hn3rd 36ec7bfdb6 refactor: move program registration from kernel to progmanager
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Remove diskcmd, diskutil, notepad, partcmd, volcmd init calls and
  uses from kernel.pas — these are programs, not kernel subsystems.
- Move their initialization into progmanager.init() alongside the
  other baked-in programs (md5sum, base64_prog, dhclient, etc.).
- Remove diskcmd, diskutil, notepad from kernel's uses clause.
- Add a splash.update() call for the auto-mount volumes step.
- Suppress FPC warnings in compile_sources.sh (-v0e instead of -v0ew).
2026-03-07 20:39:43 +00:00
t3hn3rd 6c3c0e63d5 fix: Rebase borked kernel.pas - added missing deps 2026-03-07 20:31:38 +00:00
t3hn3rd df71c59aea feature: add boot splash screen with embedded TGA logo
- New splash unit (src/prog/splash.pas) displays a centered logo,
  progress bar and status label during kernel boot.  Manually drives
  LVGL rendering + video.Flush since gfxd isn't running yet.
- Embed img/asuro.tga into the kernel via NASM incbin stub
  (src/stub/splash_tga.asm), assembled in compile_stub.sh.
- Build an lv_image_dsc_t at runtime from the decoded TGA pixel data
  and display it at 50% scale using lv_image_set_scale(128).
- Move LVGL init earlier in kernel.pas (right after video enable) so
  the splash screen is available before VFS/drivers/network init.
- Sprinkle splash.update() calls throughout kmain to show boot
  progress (VFS → drivers → buses → network → tests → desktop).
- Fix targa.pas parser: rename Magic→IDLength, remove erroneous Data
  pointer field, compute pixel offset correctly (buffer+18+IDLength),
  advance source pointer per pixel, handle bottom-to-top origin flip.
- Unit tests moved before desktop.init; splash.teardown called at 100%
  just before handing off to the desktop environment.
2026-03-07 20:20:00 +00:00
t3hn3rd 97244a2b95 Rebase: Changes made to conform with rebase on develop 2026-03-07 20:17:24 +00:00
t3hn3rd ecca496978 fix: show live GPU/resolution info in System Information
- desktop: Resolution/Graphics fields now read from video frontbuffer
  and gpu.activeDriverName instead of static multiboot/hardcoded values
- gpu: markAvailable sets ActiveName when no driver is active yet, so
  the initial VBE boot driver is reported before any setMode call
- kernel: whitespace cleanup
2026-03-07 20:16:26 +00:00
t3hn3rd e52b4a9763 feature: GPU driver framework with BGA, V86 monitor, and runtime resolution switching
- GPU Framework (gpu.pas): Priority-ordered GPU driver registry with
  mode-change callback system. Drivers register with a priority (lower =
  tried first). After successful setMode, fires registered callbacks in
  order (video → LVGL → desktop) for fully decoupled resolution updates.

- BGA Driver (bga.pas): Bochs Graphics Adapter via drivermanagement PCI
  auto-detection (class=$03 subclass=$00 wildcard). Programs display via
  I/O ports $01CE/$01CF, reads framebuffer from PCI BARs with VMware SVGA
  fallback. Supports arbitrary resolutions (1920x1080, 2560x1440, etc).

- SETRES Command (setres.pas): Runtime resolution switching — just calls
  gpu.setMode; video reinit, LVGL buffer realloc, and desktop relayout
  all fire automatically via GPU mode-change callbacks.

- VESA/VBE: Registered as GPU fallback driver (priority 50), uses V86
  INT 10h for VBE mode switching.

- TSS: Fix SS0 from $08 (code segment) to $10 (data segment); add
  set_esp0/get_esp0 helpers for V86 ring-0 stack management.

- VMM: Add map_page_user() for identity-mapping first 4MB with User bit
  (required for V86 IVT/BDA/video ROM access).

- Desktop: relayout procedure + GPU callback registration for automatic
  dock/watermark repositioning on resolution change.

- V86 Monitor (v86.pas): Full Virtual 8086 mode monitor for executing
  real-mode BIOS interrupts from protected mode. Naked GPF handler with
  instruction emulation (INT, IRET, CLI, STI, PUSHF/POPF, IN/OUT, HLT,
  0x66 prefix for 32-bit variants). Thunk-based entry via IRET into VM86.

- Kernel init order: gpu.init → video.init → vesa.init → bga.init;
  drivermanagement.init moved earlier (before video) so PCI scan detects
  BGA before first use.
2026-03-07 20:16:25 +00:00
admin f78eaa3811 Merge pull request 'Storage system overhaul: VFS, FAT32, ISO9660, AHCI/IDE refactor, GUI apps & boot drive mounting' (#49) from feature/storage-system into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #49
Reviewed-by: admin <[email protected]>
2026-03-07 19:53:14 +00:00
Aaron acb4a15e41 Fix file headers
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-07 19:40:18 +00:00
Aaron d3581eea2e update header
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2026-03-07 19:37:26 +00:00
Aaron 1fc00e3e7c chore: ignore lessons_learnt.md
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2026-03-07 19:33:57 +00:00
Aaron 2f837ace6e chore: remove lessons_learnt.md from tracking
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-07 19:33:40 +00:00
Aaron f8182b24b3 removed another bad file
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-07 19:24:59 +00:00
Aaron f0531ff861 Removed bad files
continuous-integration/drone/push Build is passing
2026-03-07 19:22:40 +00:00
Aaron 3d9c4cb49a feat: add processmanager.create to diskutil and notepad
continuous-integration/drone/push Build is passing
- diskutil: add proc_pid global, diskutil_entry idle proc, create process
  on launch with setWindowOwner, kill on close, zero proc_pid in init
- notepad: add pid field to TNotepadState, notepad_entry idle proc, create
  process on launch with setWindowOwner, kill pid in doCloseWindow
- both apps now appear in PS and are manageable via KILL/TERMINATE
2026-03-07 19:18:55 +00:00
Aaron 3a733b1559 feat: auto-mount boot drive to /boot; fix FAT32 deleted entry triple fault
continuous-integration/drone/push Build is passing
- Decode multiboot boot_device byte in storagemanager to identify boot device
- Add isBootDevice to TStorage_Device; propagate isBootDrive to volumes
- Create /boot VFS directory at init; mount boot volume there in auto_mount_volumes
- Fix getDirEntries skipping \-marked (deleted) FAT32 entries to prevent
  triple fault when navigating into a deleted directory via file picker
2026-03-07 18:58:32 +00:00
Aaron deb513c925 storage: fix VFS corruption, ISO9660 hang, OOM; add notepad, file picker, fdtable, GPT, async I/O
VFS fixes:
- GetDirectoryListing(otVDIRECTORY) now returns a heap-allocated snapshot
  instead of a raw live-tree pointer; FreeDirectoryListing no longer
  corrupts the VFS tree (fixes page fault on repeated navigation)
- volumeGetDirectories: guard LL_Size > 0 before loop to prevent uint32
  underflow (0-1 = 0xFFFFFFFF) causing 4B kalloc iterations -> OOM
- Free entry^.fileName and dirList in all branches (memory leak fix)

iso9660:
- equalsIgnoreCase: guard la=0 before loop (same uint32 underflow bug)
- readDirectoryEntries/resolvePath: add 65536/256-iter safety caps

storagemanager:
- Strip debug syslog calls that were allocating 6+ strings per I/O
  (hundreds of I/Os x 6 allocs exhausted the heap)

Process manager:
- Per-process FDTable and Cwd initialised on create, freed on reap
- proc_await: use pointer-indirection spin per lesson #6 (FPC caches
  non-volatile reads; raw while flag=0 returns immediately)
- graphicsrefresh: move LVGL handler from timer ISR (IF=0) to a
  dedicated process so LVGL callbacks can call blocking I/O

New units:
- fdtable.pas: per-process file descriptor table (fd_alloc/get/close)
- iorequest.pas: heap allocation helpers for TIORequest
- gpt.pas: GPT header/entry read + CRC validation
- filepicker.pas: reusable OS-level open/save file picker dialog
- notepad.pas: GUI text editor with selection, indent, save-as

Shell commands (diskcmd, partcmd, volcmd, diskutil):
- Route output to stdout_buf instead of syslog (lesson #4)
- diskutil: async add/remove/format partition; cache-based device display

Add Apache 2.0 license headers to storagemanager.pas, iso9660.pas,
fat32.pas, storagetest.pas

Lessons learnt: #9 VFS listing must return snapshot (not live pointer)
2026-03-07 18:58:32 +00:00
Aaron 789fb7971a getting ready 2026-03-07 18:57:38 +00:00
Aaron 4e3acd6af7 Storage system: AHCI, IDE rework, VFS, volume manager, flatfs, async IO, IOAPIC 2026-03-07 18:45:25 +00:00
admin 262d064b6d Merge pull request 'Fix: PS/2 mouse ISR blocking; convert USB polling & GFX refresh to processes; remove dead scheduler' (#48) from feature/ps2-mouse-fix into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #48
2026-03-07 00:40:20 +00:00
t3hn3rd 738e5828f6 Fix PS/2 mouse ISR blocking; convert USB polling & GFX refresh to processes; remove dead scheduler
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
PS/2 Mouse:
- Fix ISR spin-blocking by reading port $60 directly with inb() instead
  of calling mouse_read(), which uses mouse_wait_long (100k iterations)
  and would stall the interrupt handler waiting for the next packet byte.

Timer (PIT):
- Increase PIT frequency from ~1024 Hz to ~8 kHz (divisor 1193 -> 149)
  for more granular timer ticks.

Graphics Refresh:
- Replace timer-hook-driven rendering (driver/timers/graphicsrefresh)
  with a dedicated 'gfxd' process that runs a continuous render loop,
  keeping the vCPU active to avoid NEM/Hyper-V pause-loop descheduling.
- Move uidebug from driver/video/ to prog/.
- Update FPS calculation to account for 8 kHz tick rate.

USB Hotplug:
- Replace timer-hook-driven polling (driver/timers/usbhotplug) with a
  dedicated 'usbd' daemon process that sleeps 1s between poll cycles.
- Add bounds check in usbcore.usb_check_hotplug for empty HC list.

Cleanup:
- Remove old scheduler unit (superseded by processmanager/contextswitcher).
- Remove tss unit and tss.init() call from kernel.
- Remove unused syslog import from contextswitcher.
- Reduce BASE_QUANTUM from 8 to 5.
2026-03-07 00:29:38 +00:00
t3hn3rd 9fa1c859ac Merge pull request 'feature: preemptive process management & TCP/IP barebones' (#41) from feature/process-management into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #41
Reviewed-by: Aaron Hance <[email protected]>
2026-03-04 20:04:24 +00:00
t3hn3rd d01b534a3d rebase fix: stdio.registerCommand('BSOS') removed from progmanager.pas
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- This can sit in kernel for now, given that's where the handler is.
- TODO: Move everything to sit under prog/
2026-03-04 19:49:56 +00:00
t3hn3rd 491b0ea5c3 fix: Allocator Merge Conflicts Resolved 2026-03-04 19:43:43 +00:00
t3hn3rd de6fde05cc 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-04 19:42:33 +00:00
t3hn3rd fb675a2299 feature: implement TCP (RFC 793) protocol driver
Add full TCP/IP stack implementation at L4 alongside UDP and ICMP.

Core Protocol Engine:
- TCP types in nettypes.pas (header, TCB, state enum, error codes,
  callbacks, OOO entry, socket structures)
- 3-way handshake (active & passive OPEN)
- Reliable data transfer with ACK and sequence number tracking
- Graceful close (FIN_WAIT, CLOSE_WAIT, LAST_ACK, TIME_WAIT)
- RST send/receive handling
- Retransmission with exponential backoff (max 5 attempts)
- Pseudo-header based checksum (RFC 793)

Server Support:
- LISTEN → SYN_RECEIVED → ESTABLISHED passive open path
- Listen backlog enforcement (configurable per-socket)
- accept() to retrieve established child connections

Robustness & Hardening:
- Delayed ACK timer (~200ms)
- Nagle's algorithm (buffer small sends while unACKed data pending)
- Jacobson/Karels RTT estimation with adaptive RTO
- Congestion control (slow start / congestion avoidance)
- Zero-window probing with exponential backoff
- MSS option negotiation in SYN/SYN-ACK (Kind=2, Len=4)
- Keep-alive (30s idle, 10s interval, 5 probes)
- Out-of-order segment reassembly (4-slot buffer)

Terminal & Testing:
- tcpconnect: active open + send "Hello, World!"
- tcplisten: passive open with syslog output
- tcphttp: HTTP/1.0 GET client

Also add push_trace() instrumentation to net, eth2, arp, ipv4,
icmp, udp, and dhcp entry points for call tracing, and register
tcp in net.init.
2026-03-04 19:39:32 +00:00
t3hn3rd aa374b6816 Merge pull request 'refactor(memory): complete PMM/VMM/LMM rewrite - bitmap allocators, bug fixes, hardening' (#40) from feature/memory-allocation-optimization into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #40
Reviewed-by: Aaron Hance <[email protected]>
2026-03-04 19:34:44 +00:00
t3hn3rd f427b7bcc7 refactor(memory): complete PMM/VMM/LMM rewrite - bitmap allocators, bug fixes, hardening
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
PMM Rewrite:
- Replace ~8KB record array with compact bitmaps
  (PhysPresent/PhysAlloc/PhysScanned, 128B each)
- Add PhysOwner[0..1023] for per-block ownership tracking
- new_block: O(1) amortised via NextFreeHint + dword-level BSF scan,
  returns 0 as OOM sentinel
- free_block: O(1) direct bit clear with double-free detection
- alloc_block: validates PhysPresent and PhysAlloc bits before allocation
- Add pmm_free_blocks/pmm_total_blocks stats functions

VMM Correctness Fixes:
- Fix free_page block extraction (Address SHR 10, was using
  raw Address field)
- Fix invlpg operand (use virtual address, was passing PDE index)
- Clear PDE entry on free_page before returning block to PMM
- Remove map_page double-write (delegate to map_page_ex only)
- Add OOM propagation (new_page returns false if PMM returns 0)
- Fix missing pop_trace in new_page error path

LMM Rewrite:
- Replace per-entry record array with bitmap allocator
  (93% vs 43% page efficiency)
- Layout: Header(24B) + Bitmap(64512B) + Padding + Data at 0x10000
- SIZE_PREFIX=16 for 16-byte aligned returns (SSE MOVAPS requirement)
- Next-fit bitmap scan with roving hint (NextFree) and dword-level
  fast skip
- Large alloc sentinel (LARGE_ALLOC_MAGIC=$FFFFFFFE) so kfree detects
  klalloc'd memory
- Implement klfree (was previously a no-op - pages could never
  be returned)
- Implement try_release_page (return fully-free heap pages to VMM/PMM)
- Fix interrupt safety: stack-balanced pushfd/cli/pop +
  restore_if (sti only)
  Fixes Bad TSS caused by popfd restoring dangerous EFLAGS bits (NT, IOPL)
- Zero memory via rep stosd instead of byte-by-byte loop

Hardening:
- kalloc OOM now triggers BSOD instead of returning nil
  (90% of callers don't check)
- Double-free detection in kfree (verify bitmap bits set before clearing)
- Guard bytes ({$IFDEF DEBUG_LMM}): $DEADBEEF sentinel for buffer overrun detection
- kpalloc: bounds check (block >= 1024 -> GPF) + syslog MMIO mapping audit log

Observability:
- Add MEMINFO command as src/prog/meminfo.pas (moved from inline kernel.pas)
- Displays multiboot memory, PMM block stats, LMM heap stats
- Register via progmanager.pas following standard prog pattern

Files changed:
- src/pmemorymanager.pas
- src/vmemorymanager.pas
- src/lmemorymanager.pas
- src/kernel.pas
- src/progmanager.pas
- src/prog/meminfo.pas
2026-03-04 19:23:46 +00:00
Aaron 4ba3c5b524 Merge pull request 'feature/Queues' (#37) from feature/Queues into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #37
2026-03-04 00:06:10 +00:00
t3hn3rd 7180ad39d8 Merge pull request 'feature: Pipeline - LVGL Build Caching' (#38) from feature/lvgl-build-caching into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #38
Reviewed-by: Aaron Hance <[email protected]>
2026-03-04 00:05:01 +00:00
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 188b1aebb0 feature: Pipeline - LVGL Build Caching
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Add LVGL build caching: store liblvgl.a on host mount to skip
  full recompilation on subsequent builds
2026-03-03 23:22:09 +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
t3hn3rd 547251dbd0 update: Kernel.pas changes to align with USB implementation
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Kernel.pas updated to init USB devices & check for hotplug.
- USB Poll removed given USB stack is now interrupt driven.
2026-03-02 15:53:40 +00:00
t3hn3rd 7bbcc44c5e Feature: USB - Hotplug, mass storage, disconnect callbacks, dynamic device lists
- Add disconnect callback (fnDisconnect) to TUSBDevice for safe unplug handling
- Add HotplugArmed/PortChangePending flags to TUSBHCDriver for deferred
  hotplug processing from ISR context (OHCI RHSC, EHCI PCD, xHCI PSC)
- Implement usb_rescan_port() and usb_check_hotplug() in usbcore
- Add usb_bulk_transfer_wait() with timer-based timeout (bios_data_area)
- Add timer-based timeout to usb_control_msg polling loop
- Replace static device arrays with dynamic linked lists in class drivers:
  usb_keyboard (KeyboardList), usb_mouse (MouseList), usb_storage (StorageList)
- Add 3-strike fail-count self-deactivation in keyboard/mouse poll loops
- Add unload() disconnect handlers for keyboard, mouse, and storage drivers
- Implement USB Mass Storage BOT driver (usb_storage.pas):
  CBW/CSW transport, SCSI INQUIRY/READ_CAPACITY/READ10/WRITE10,
  storagemanagement integration with read/write callbacks
- xHCI: acknowledge port status change W1C bits in event handler
- Integrate usb_check_hotplug + poll_keyboards/poll_mice into kernel main loop
2026-03-02 15:52:49 +00:00
t3hn3rd 25475a88a7 featur: USB - Add device tracking, stall recovery, removal, and terminal command
- Track enumerated devices per-HC via linked list (hc^.Devices)
- Add usb_clear_halt() for endpoint stall recovery (CLEAR_FEATURE)
- Add usb_remove_device() to clean up and free device records
- Add get_hc() for indexed host controller access
- Implement 'USB' terminal command showing HC info, connected devices,
  speeds, class descriptors, and endpoint details
2026-03-02 15:50:55 +00:00
t3hn3rd db49c29627 fix: lowercase names for units
- PCI.pas -> pci.pas
2026-03-02 13:38:10 +00:00
t3hn3rd c237553508 fix: ps2_keyboard report key-up events for break codes
The PS/2 keyboard callback hardcoded is_down_code := true for every
scancode, so key releases were never reported. This caused keys to
repeat endlessly until the next key was pressed.

In PS/2 scancode set 1, bit 7 indicates a break (release) code.
The callback now:
- Detects break codes via (scancode AND $80)
- Masks to base code (scancode AND $7F) for key matrix lookup
- Sets is_down_code := false for break codes
- Updates modifier state (shift/ctrl/alt) before building the
  key event, so modifier releases take effect immediately

Files changed:
- ps2_keyboard.pas: rewrite callback to handle make/break codes
2026-03-02 13:37:29 +00:00
t3hn3rd 0c96d32754 feature: move all USB HC drivers from polling to interrupt-driven completion
Replace main-loop polling (poll_all, poll_keyboards, poll_mice) with
hardware interrupt handlers for all four USB host controller drivers.

Each HC driver (XHCI, EHCI, OHCI, UHCI) now:
- Registers an ISR on its PCI interrupt line via isrmanager
- Enables hardware interrupts after HC initialization
- Acknowledges interrupt status in the ISR before calling poll,
  preventing interrupt storms on level-triggered PCI lines
- Uses a PollBusy re-entrancy guard to prevent ISR/inline poll races

usbcore gains a completion hook system (register_completion_hook /
fire_completion_hooks) so HID drivers (keyboard, mouse) are notified
directly from the ISR after transfer completion.

Files changed:
- usbcore.pas: completion hook infrastructure
- XHCI.pas: ISR, enable_interrupts, submit ordering fix
- EHCI.pas: ISR, enable_interrupts, status ack in ISR
- OHCI.pas: ISR, enable_interrupts, status ack in ISR
- UHCI.pas: ISR, enable_interrupts, status ack in ISR
- usb_keyboard.pas: register completion hook
- usb_mouse.pas: register completion hook
2026-03-02 13:36:40 +00:00
t3hn3rd 3f83f279d7 XHCI driver implementation
- Beginnings of a functional XHCI driver implemented.
2026-03-02 12:24:02 +00:00
t3hn3rd 82fe9fa6df EHCI Implementation
- Beginnings of a functional EHCI driver implemented.
2026-03-02 12:23:35 +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
t3hn3rd 2fa77d8295 Merge branch 'feature/tracer-optimizations' into feature/USB 2026-03-01 21:26:56 +00:00
t3hn3rd f53afc1d2d feature: Tracer O(1) ring buffer refactor
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Replaced O(n) shift loop + StringCopy/kalloc/kfree with O(1) ring
  buffer storing PChar pointers directly (zero allocation).
- Eliminated mod operator (causes int64 promotion + broken RTL helpers
  on i386 bare-metal); uses pure uint32 branch arithmetic.
- Removed dead code: PTracerEntry/TTracerEntry linked list types,
  head/tail PTracerEntry vars, c_lock boolean
- Dropped lmemorymanager and serial from uses clause
- pop_trace remains as no-op stub for ABI compat
- get_trace_N uses underflow-safe index: if head >= idx then
  head - idx else MAX_TRACE - (idx - head)
- Added print_traces debug helper
2026-03-01 21:26:35 +00:00
t3hn3rd cb7144f282 USB Stack & HID Refactor
- New units: usbtypes, usbcore, usbhub, UHCI, OHCI, usb_keyboard,
  usb_mouse
- usbtypes: shared USB descriptors, constants, HC abstraction,
  aligned alloc, unit tests
- usb_keyboard: USB HID boot keyboard driver with HID-to-ASCII
  translation, polling, unit tests
- usb_mouse: USB HID boot mouse driver with delta/scroll/button
  processing, polling, unit tests

HID Layer Restructure:
- keyboard.pas: stripped to abstract API (hook + reportKeyEvent),
  no PS/2 dependency
- mouse.pas: absorbed mousestate.pas, now owns
  position/buttons/scroll/hooks directly
- mousestate.pas: deleted (merged into mouse.pas)
- New ps2_keyboard.pas: PS/2 scan code translation,
  calls keyboard.reportKeyEvent
- New ps2_mouse.pas: PS/2 packet handling, calls
  mouse.setMousePos/fireMouseEvent

LVGL Integration:
- lvgl.pas: updated to use mouse.pas directly (was mousestate),
  improved keyboard input handling with proper key held/release tracking
- vterminal.pas: removed serial debug logging, dropped serial dependency

Kernel:
- kernel.pas: added USB units, USB polling in main loop, unit test
  calls, ps2_keyboard/ps2_mouse init
2026-03-01 21:23:33 +00:00
admin afdc83eaf6 Merge pull request 'Merge feature/hardening into develop' (#11) from feature/hardening into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #11
2026-03-01 02:57:23 +00:00
t3hn3rd 2239d9c848 Rebase: Fixed console -> syslog interface
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-01 02:46:13 +00:00
t3hn3rd beb4b253ab fix: guard against uint32 underflow in memset/memcpy and strings unit
When size=0 was passed to memset() or memcpy(), the loop bound
`0 to size-1` underflowed to $FFFFFFFF, iterating ~4 billion times
and causing an immediate page fault.

Added `if size = 0 then exit` guards to both memset() and memcpy()
in util.pas.

Also guarded all `for i:=0 to X-1` loops in strings.pas where X
could be 0 on empty string inputs:
- stringToUpper: wrap loop in `if stringSize > 0`
- stringToLower: wrap loop in `if stringSize > 0`
- stringEquals: early exit when both sizes are 0
- stringToInt: early exit when string is empty

Additionally fixed all previously identified bugs in strings.pas:
- hexStringToInt: guard against empty string underflow
- stringConcat: cache stringSize calls to avoid redundant O(n) scans
- stringTrim: clamp length to source string size
- stringSub: bounds check start/size against source length
- stringReplace: complete rewrite - was using stringEquals() for
  substring matching (only matched at string end), dropped prefix
  chars, had dangling assignment overwriting valid result with
  uninitialized pointer, and had unused variable
- stringIndexOf: rewritten to use new stringMatchAt() helper for
  correct substring matching
- stringContains: simplified to delegate to fixed stringIndexOf(),
  also fixing uint32 underflow when sub was empty
- stringToInt: removed always-true `v >= 0` check on uint32
- intToString: implemented (was a stub returning ' ')
- Added stringMatchAt() helper for prefix comparison
- Added comprehensive UnitTest procedure with 77 assertions
  including adversarial empty/nil/boundary inputs
2026-03-01 02:33:28 +00:00
admin 084130da80 Merge pull request 'feat: VESA rendering implementation & LVGL for graphics drawing' (#10) from feature/lvgl into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #10
2026-03-01 02:25:47 +00:00
t3hn3rd f752be48ce 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.
2026-03-01 02:06:31 +00:00
t3hn3rd dbe6e958e2 fix: More changes for Hyper-V PS/2 mouse compatability
continuous-integration/drone/push Build is passing
2026-02-28 22:54:19 +00:00
t3hn3rd 201cda4c29 fix: Pipeline fixes for temporary lvgl directory
continuous-integration/drone/push Build is passing
- Fixed missing lvgl artefacts for build pipeline causing drone failures.
2026-02-28 16:48:41 +00:00
t3hn3rd e54b34aa93 fix: gate AVX enable on XSAVE support and set CR4.OSXSAVE first
continuous-integration/drone/push Build is failing
XGETBV/XSETBV require CR4 bit 18 (OSXSAVE) to be set before execution,
otherwise the CPU raises #UD (invalid opcode). Hyper-V enforces this
strictly; VirtualBox was silently tolerating it.

- Check both AVX and XSAVE CPUID flags before attempting AVX enable
- Set CR4.OSXSAVE (bit 18) before issuing XGETBV/XSETBV
- If XSAVE is not exposed by the hypervisor, AVX enable is skipped
  gracefully instead of faulting
2026-02-28 16:31:57 +00:00
t3hn3rd fcfe7c3204 fix: Mouse driver Hyper-V compatibility + resolution-independent bounds clamping
- Add mouse_wait_long() with 100,000 iteration timeout for init-time
  i8042 controller commands (mouse_write/mouse_read/load). The original
  mouse_wait() stays at 100 iterations for ISR-safe use in main().

- In load(): use mouse_wait_long() for all direct port I/O ($64/$60)
  and clear CCB bit 5 (AND NOT $20) to ensure the mouse clock is not
  disabled — required for Hyper-V which enforces this strictly.

- Replace Console.getConsoleProperties^.Width/Height with
  video.frontBufferWidth/Height for mouse bounds clamping. The old
  console properties are zero when console.init() is not called,
  which locked the cursor to (0,0). Add 'video' to uses clause.
2026-02-28 16:31:26 +00:00
t3hn3rd be4b482bde fix: LVGL rendering for 16bpp framebuffers (HyperV compatibility)
continuous-integration/drone/push Build is failing
The LVGL flush callback assumed 32bpp (4-byte stride, direct pixel
copy), causing corrupted output on hypervisors that fall back to
16bpp modes (e.g. HyperV at 1600x1200x16).

- lvgl.pas: Make lvgl_flush_cb BPP-aware; add ARGB8888->RGB565
  conversion path for 16bpp, keep direct copy for 32bpp. Replace
  static lv_buf1 array (hardcoded 1600px wide) with kalloc'd buffer
  sized to actual screen width.
- doublebuffer.pas: Fix allocateBackBuffer size from (W*H*BPP) to
  (W*H*BPP) div 8 to get correct byte count.
- vesa.pas: Account for BPP in allocateVESAFrameBuffer page range
  calculation to avoid under-mapping at higher BPP/resolutions.
- Removed the initialization of console in kernel.pas as this will
  cause issues on some systems that don't expect to need to allocate the
  textmode buffer.
2026-02-28 15:38:11 +00:00
t3hn3rd 6f50b053b7 Full LVGL binding & Cursor fix
- Full(ish) LVGL bindings implemented.
- Cursor replaced with an actual cursor.
2026-02-28 00:06:10 +00:00
t3hn3rd ece376660c Removed old lv_conf
continuous-integration/drone/push Build is failing
2026-02-27 22:43:53 +00:00
t3hn3rd 98a14bc7dc More work towards LVGL implementation
continuous-integration/drone/push Build is failing
2026-02-27 22:43:02 +00:00
t3hn3rd 989e36ffe2 Initial LVGL modifications
Basic LVGL wrapper with an example desktop & windowing system.
2026-02-27 16:30:31 +00:00
t3hn3rd ceb03a9d7e Merge branch 'feature/fpc-3.2.2' into feature/lvgl
# Conflicts:
#	.drone.yml
#	virtualbox-wrapper.ps1
2026-02-26 15:51:37 +00:00
admin 924305a1ab Merge pull request 'Migration from FPC 2.6.4 to FPC 3.2.2' (#9) from feature/fpc-3.2.2 into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #9
2026-02-26 12:51:09 +00:00
t3hn3rd 4ef61b0d3b Drone failing due to webhook stage
- Added ignore failure to discord webhook stage.
2026-02-26 12:23:42 +00:00
t3hn3rd 2b071a58c7 feature: Upgrade FPC from 2.6.4 to 3.2.2
continuous-integration/drone Build was killed
Migrate the build toolchain from Free Pascal Compiler 2.6.4 to 3.2.2.
FPC 3.2.2 requires a significantly expanded custom system unit and
several syntactic adjustments across the codebase.

Dockerfile:
- Bump FPC_VERSION from 2.6.4 to 3.2.2

compile_sources.sh:
- Replace obsolete -Op3 flag with -OpPENTIUM3

linker.script:
- Add /DISCARD/ section for .init_array, .fini_array, .ctors, .dtors,
  .eh_frame, .gcc_except_table, and .note.GNU-stack sections emitted
  by FPC 3.2.2

system.pas:
- Fix hresult to 'type longint' (was cardinal, incompatible with 3.2.2)
- Add required types: SizeInt, SizeUInt, PtrInt, PtrUInt, NativeInt,
  NativeUInt, CodePointer, TTypeKind, jmp_buf, TExceptAddr, TGuid,
  FileRec, TextRec
- Add required globals: ExceptAddrStack, ExitCode, ErrorAddr, ErrorCode,
  ExitProc, StackBottom, StackLength, RandSeed
- Implement compilerprocs: fpc_initializeunits, fpc_do_exit,
  fpc_handleerror, fpc_rangeerror, fpc_overflow, fpc_divbyzero,
  fpc_objecterror, fpc_abstracterror, fpc_stackcheck, fpc_iocheck,
  fpc_pushexceptaddr, fpc_popaddrstack, fpc_setjmp (asm),
  fpc_longjmp (asm), fpc_shortstr_assign, fpc_mul_int64 (asm),
  fpc_getmem, fpc_freemem, fpc_reraise, fpc_raiseexception,
  fpc_catches, fpc_doneexception
- Add move() procedure with FPC_MOVE alias

util.pas, serial.pas:
- Fix inline asm functions (getESP, inl, inw, inb, sinb) to use temp
  variables instead of function-name result — FPC 3.2.2 no longer
  allows 'MOV funcname, reg' syntax in inline asm blocks

lmemorymanager.pas:
- Export kalloc/kfree with public aliases (kernel_kalloc, kernel_kfree)
  so system.pas fpc_getmem/fpc_freemem can link to them
2026-02-26 00:01:40 +00:00
t3hn3rd 1145b900e4 Merge pull request 'Virtualbox-Wrapper - Bugfix' (#8) from feature/Virtualbox-Wrapper-Fix into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #8
Reviewed-by: Aaron Hance <[email protected]>
2025-03-23 19:01:28 +00:00
t3hn3rd 436cd86d8c Updated virtualbox wrapper as it was causing stale powershell processes to build up over time
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Updated `Virtualbox-Wrapper.ps1` to include `Get-Job | Stop-Job | Remove-Job -Force` at the end of execution, as the spawning of jobs was causing stale PowerShell processes to build up over time.
2025-03-23 17:54:55 +00:00
t3hn3rd 540444dfbf Merge pull request 'feature/drone-discord-webhooks' (#7) from feature/drone-discord-webhooks into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #7
2025-03-23 15:21:58 +00:00
t3hn3rd 2d7c51ed15 Further formatting cleanups
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Attempted to remove automatic discord embeds by surrounding any markdown links with `<` `>`.
- Corrected some spacing.
2025-03-23 01:14:28 +00:00
t3hn3rd c842d9774f Formatting Fixed - Enchancing
continuous-integration/drone/push Build is passing
- Formatting is now fixed & newlines are working correctly, shame the YAML looks w?*! 🤣
- Added sections to the message for links to Gitea & Drone.
2025-03-23 00:59:36 +00:00
t3hn3rd 5963504f6b More attempts at format fixes
continuous-integration/drone/push Build is passing
Formatting still off, condensing to one line to see if the escaped newlines will work. YAML is wild.
2025-03-23 00:48:31 +00:00
t3hn3rd e64a59714a Formatting Fixes
continuous-integration/drone/push Build is passing
Formatting was off for the message posted to Discord, it also triggered at the start of the pipeline.
- Fixed formatting with an attempt to use newlines.
- Added a depends_on `compile`.
2025-03-23 00:41:22 +00:00
t3hn3rd dd5d908e43 DroneCI config updated to push to discord webhook
continuous-integration/drone/push Build is passing
- `.drone.yml` updated to push notifications to the discord webhook.
2025-03-23 00:31:20 +00:00
Aaron 28846af43c Merge pull request 'feature/dynamic-lists' (#6) from feature/dynamic-lists into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #6
Reviewed-by: t3hn3rd <[email protected]>
2025-03-22 19:24:52 +00:00
t3hn3rd b1e3953960 Merge pull request 'Fixed a DHCP bug' (#5) from feature/DHCP-BugFix into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #5
2025-03-22 19:13:25 +00:00
Aaron 7e00e23801 Fixed and expanded dynamic lists, commented whole file 2025-03-22 19:02:43 +00:00
t3hn3rd bd12bbe862 DevOps Workflow Improvements 2025-03-22 18:42:44 +00:00
t3hn3rd 48c203f028 Fixed a DHCP bug
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Fixed a bug within `dhcp.pas` - `processPacket_OFFER` in which the client was responding with the client IP value within the DHCP header was incorrectly being filled out with the IP being requested & this value was then being used within the REQUESTED_IP_ADDRESS option. Corrected this to fill out the client IP with the currently configured IP, which will be NULL (0.0.0.0) on boot, and whatever is issued thereafter.
- Cascaded the change to use the currently configured IP as opposed to a NULL IP to any other functions that were calling `copyIPv4(@NULL_IP[0], @packetCtx^.IP.Source[0])`.
- Allowed `processPacket_OFFER` to process packets addressed to the BROADCAST MAC (WHY COULDN'T IT DO THIS ALREADY?!).
2025-03-17 00:00:21 +00:00
Aaron d859e40e4a Added mail map
continuous-integration/drone/push Build is passing
2025-03-15 10:52:08 +00:00
t3hn3rd 8be364c990 Merge pull request 'feature/ci-cd-drone-migration' (#3) from feature/ci-cd-drone-migration into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #3
2025-03-10 20:08:38 +00:00
t3hn3rd 0e2c6b2936 Final commit to merge through develop & master
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
- CI/CD Pipeline now working & tested.
- Commits to all branches will trigger the pipeline in DroneCI.
- Commits to master will trigger the resulting ISO artefact to be uploaded to Gitea as a Package.

# Conflicts:
#	.drone.yml
2025-03-10 12:48:21 +00:00
t3hn3rd 8c3649f691 Merge pull request 'feature/ci-cd-drone-migration' (#3) from feature/ci-cd-drone-migration into develop
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Reviewed-on: #3
2025-03-09 22:32:16 +00:00
t3hn3rd b47194ed99 Final commit to merge through develop & master
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- CI/CD Pipeline now working & tested.
- Commits to all branches will trigger the pipeline in DroneCI.
- Commits to master will trigger the resulting ISO artefact to be uploaded to Gitea as a Package.
2025-03-09 22:25:08 +00:00
t3hn3rd 6bca42f2a5 Final Test before finalizing
continuous-integration/drone/push Build is passing
- Single quotes were causing the first CURL to fail.
- This should be the penultimate commit before ready to progress through dev to master.
2025-03-09 22:18:19 +00:00
t3hn3rd f1211f3cca Slowly making progress
continuous-integration/drone/push Build is passing
- YAML is now valid - however, the attempt to temp store the revision number failed. Doing it inline instead.
2025-03-09 22:08:18 +00:00
t3hn3rd 0913daebc6 Still experiencing YAML errors, for some reason.
continuous-integration/drone/push Build is passing
2025-03-09 22:01:55 +00:00
t3hn3rd d1a4b4d42f Another attempt - issues with YAML layout for some reason
continuous-integration/drone/push Build encountered an error
2025-03-09 21:57:19 +00:00
t3hn3rd 2906b8724b Exports don't persist between commands
continuous-integration/drone/push Build encountered an error
- Exports don't persist between commands in Drone commands - removed these exports and made more verbose commands.
2025-03-09 21:45:29 +00:00
t3hn3rd 5e6e6c394a Debugging & Testing
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
- Mistakes made in the curl methods used & the curl upload-file flag - rectified.
2025-03-09 21:18:49 +00:00
t3hn3rd 315050f095 Further permission issues
continuous-integration/drone/push Build is failing
- Further attempts to fix permission issues within Drone when exporting the Asuro.iso artefact
- Switched to `alpine/git` instead of `curl` image, as git didn't exist under the `curl` image.
2025-03-09 20:42:40 +00:00
t3hn3rd f795ba24f8 Further tweaks to artefact upload step
continuous-integration/drone/push Build is failing
DroneCI wasn't happy with the mv of `Asuro.iso` - changed to a cp.
2025-03-09 20:36:19 +00:00
t3hn3rd 738307d070 Testing artefact upload
continuous-integration/drone/push Build is failing
- Testing the upload of the resulting `Asuro.iso` to Gitea fromt the Drone pipeline.
2025-03-09 20:30:45 +00:00
t3hn3rd 04cff2e2c3 Testing Succeeded - Refinement & removal of debugging code
continuous-integration/drone/push Build is passing
- Removed the debug `exit 1` from `compile_stub.sh`
- Improved `compile.sh` to use runOrFail in a more suitable way, correctly passing through failure messages.
2025-03-09 19:58:24 +00:00
t3hn3rd 0b5981242b Intentional edit to cause build failure
continuous-integration/drone/push Build is failing
- Intentional edit to `compile_stub.sh` in order to cause a build failure.
2025-03-09 19:44:19 +00:00
t3hn3rd f0dc598f44 Cleaning up compile scripts
continuous-integration/drone/push Build is passing
- Debugging removed from `compile_vergen.sh`
- `compile.sh` modified to use a for loop for each command & only continue if previous steps succeeded.
2025-03-09 19:39:25 +00:00
t3hn3rd d4236f455e DroneCI doesn't fetch tags by default
continuous-integration/drone/push Build is passing
- Added `git fetch --tags` as the first command
- Changes to compile_vergen.sh in order to debug.
2025-03-09 19:16:23 +00:00
t3hn3rd 96fcf19c14 Further updates to .drone.yml
continuous-integration/drone/push Build is passing
Still experiencing issues with not being able to find the .sh files due to missing /code directory.
2025-03-09 18:59:32 +00:00
t3hn3rd 8c51bd8690 Attempts to resolve issues with missing /code directory
continuous-integration/drone/push Build is failing
Dockerfile expects `/code` attempting to resolve this in the .drone.yml
2025-03-09 18:54:38 +00:00
t3hn3rd 43464bb550 Still not working
continuous-integration/drone/push Build is failing
Testing whether mount paths are the problem
2025-03-09 18:08:28 +00:00
t3hn3rd 6a1b87e250 .drone.yml modifications
continuous-integration/drone/push Build is passing
Modified drone.yml to copy source from the /drone/src directory to the /code directory.
2025-03-09 17:49:04 +00:00
t3hn3rd 9473e26b50 Dockerfile corrections
continuous-integration/drone/push Build is passing
- /code already exists, don't create it in Dockerfile
2025-03-09 17:42:06 +00:00
t3hn3rd f19444201d Updated registry to the registry server, as opposed to my username
continuous-integration/drone/push Build is failing
Oops.
2025-03-09 17:36:45 +00:00
t3hn3rd f907b7e072 First attempt at drone cicd migration
continuous-integration/drone/push Build is failing
- Created a new `.drone.yml` that will compile the Dockerfile, upload this to the Docker Registry & then use this for building.
2025-03-09 17:32:35 +00:00
t3hn3rd 632c3fa66b DevOps Workflow Improvements
- `VirtualBox-Wrapper.ps1` now takes 'up' or 'down' as opposed to a machine name. This allows start/stop of a virtualmachine.
- `VirtualBox-Wrapper.ps1` now relies on a gitignored `localenv.json` to work.
- `VirtualBox-Wrapper.ps1` can also optionally monitor the log file generated from the serial adapter in VirtualBox.
- `readme.md` updated to provide instructions on how to populate the `localenv.json` file.
- `tasks.json` updated to have a "Clean" task to --remove-orphans, the Build task depends on this.
- `tasks.json` updated to have a "Close VirtualBox" task, this runs the `virtualbox-wrapper.ps1` in 'down' mode. The Build task depends on this.
- `launch.json` updated to run the `VirtualBox-Wrapper.ps1` with the "-Command up" argument, instead of machine name.
- .gitignore updated to ignore any instances of `localenv.json`.
2025-03-09 13:05:39 +00:00
t3hn3rd 80d0183391 Merge pull request 'DevOps Workflow Improvements' (#2) from feature/devlops-workflow-improvements into develop
Reviewed-on: #2
2025-03-09 13:03:04 +00:00
t3hn3rd 5f3de290f3 DevOps Workflow Improvements
- `VirtualBox-Wrapper.ps1` now takes 'up' or 'down' as opposed to a machine name. This allows start/stop of a virtualmachine.
- `VirtualBox-Wrapper.ps1` now relies on a gitignored `localenv.json` to work.
- `VirtualBox-Wrapper.ps1` can also optionally monitor the log file generated from the serial adapter in VirtualBox.
- `readme.md` updated to provide instructions on how to populate the `localenv.json` file.
- `tasks.json` updated to have a "Clean" task to --remove-orphans, the Build task depends on this.
- `tasks.json` updated to have a "Close VirtualBox" task, this runs the `virtualbox-wrapper.ps1` in 'down' mode. The Build task depends on this.
- `launch.json` updated to run the `VirtualBox-Wrapper.ps1` with the "-Command up" argument, instead of machine name.
- .gitignore updated to ignore any instances of `localenv.json`.
2025-03-09 13:01:10 +00:00
t3hn3rd 875e3e4765 VirtualBox 7 Compatability Changes
- Created a PowerShell script `virtualbox-wrapper.ps1` to wrap calls to vboxmanage and only exit once the virtual machine has been terminated.
- Updated launch.json to use the PowerShell launch type to launch `virtualbox-wrapper.ps1` with the machine name supplied as an argument.
- Updated `readme.md` to reflect these changes.
2025-03-08 19:29:46 +00:00
t3hn3rd 07106b9aed Merge pull request 'VirtualBox 7 Compatability Changes' (#1) from feature/virtualbox-7-compatibility into develop
Reviewed-on: #1
2025-03-08 19:19:40 +00:00
t3hn3rd 25df276101 VirtualBox 7 Compatability Changes
- Created a PowerShell script `virtualbox-wrapper.ps1` to wrap calls to vboxmanage and only exit once the virtual machine has been terminated.
- Updated launch.json to use the PowerShell launch type to launch `virtualbox-wrapper.ps1` with the machine name supplied as an argument.
- Updated `readme.md` to reflect these changes.
2025-03-08 18:59:12 +00:00
Aaron dbc5105b9b Dynamic lists fixes and additions 2022-02-08 21:28:47 +00:00
Aaron a61289a318 Dynamic list/array inital commit.- 2022-02-07 21:37:36 +00:00
t3hn3rd e28d68128d Merge branch 'feature/video-refactor' of https://gitlab.spexeah.com/spexeah/asuro into feature/video-refactor 2022-02-07 19:48:15 +00:00
t3hn3rd a9969d58f8 Draw texture function added to Video driver. 2022-02-07 19:48:01 +00:00
t3hn3rd d7a54d858d TARGA & Texture Units
Added TARGA and Texture units to represent & parse TARGA into and provide a standard texture format for use when drawing.
2022-02-07 19:48:00 +00:00
t3hn3rd 4e991c3e6f Double Buffer with SSE 128 copy working 2022-02-07 19:48:00 +00:00
t3hn3rd a3217de71a SSE MOVUPS/128bit Memcpy + Fixed Doublebuffer 2022-02-07 19:48:00 +00:00
t3hn3rd 19b433a19f Vesa32 additions + util functions to support 2022-02-07 19:48:00 +00:00
t3hn3rd 69d1d22a18 Fixed files being weird with case/unit searches 2022-02-07 19:48:00 +00:00
t3hn3rd 5c15343ed0 Delete files to recommit with lowercase names. 2022-02-07 19:48:00 +00:00
t3hn3rd 3ae349fbc8 New modular driver set for video
Started outlining how the modular driver set will look for video drawing routines. Currently supports Drawing pixels to the screen & Flushing backbuffer -> frontbuffer.
Still very much test code, tracer is used everywhere for debugging, NOT DEVELOP READY.
Many more draw routines need implementing - such as, but not limited to; drawRect, drawBitmap, drawLine, drawCurve, drawCircle.

TODO: Implement the aforementioned routines in all VESA modes + WindowManager.
2022-02-07 19:48:00 +00:00
t3hn3rd 78c060c114 Abstracted video driver somewhat
Split out video driver into abstract/standard/implementation.
2022-02-07 19:48:00 +00:00
t3hn3rd cd925e96c2 Enabled AVX + Changed flush to flush 2 pixels per iteration. 2022-02-07 19:48:00 +00:00
t3hn3rd 142dd486dd Double buffering implemented
Double buffering is now enabled with the use of the new large alloc (klalloc).
2022-02-07 19:48:00 +00:00
t3hn3rd beeeabd441 Expaneded Video.pas and addec color.pas
Backbuffer will need modification to lmemorymanager to remove the limits to allocation size.
2022-02-07 19:48:00 +00:00
t3hn3rd b73c66f6d6 Started work on refactored video. 2022-02-07 19:48:00 +00:00
Aaron 189526cab8 Merge branch 'feature/kernel-size-awareness' into 'develop'
Kernel Size Awareness

See merge request spexeah/asuro!32
2022-02-07 19:43:45 +00:00
Aaron 595dd4fbac Merge branch 'feature/compile-script-improvements' into 'develop'
Compile Script Improvements

See merge request spexeah/asuro!31
2022-02-07 19:42:59 +00:00
t3hn3rd ba6d8037d2 Compile Script Improvements
Improved the compile script (compile_sources.sh) to show line numbers on error and generally compile faster.
2022-02-06 13:32:57 +00:00
t3hn3rd 208bda92c8 Kernel Size Awareness
Modified the linker script + Added an init function to System.pas to be called at system boot, this allows tracking of the Kernel start & end addresses, and thus, allows us to calculate the kernel size.
2022-02-06 13:29:29 +00:00
t3hn3rd a7111d3cac Draw texture function added to Video driver. 2022-02-06 13:26:12 +00:00
t3hn3rd d182fd7f46 TARGA & Texture Units
Added TARGA and Texture units to represent & parse TARGA into and provide a standard texture format for use when drawing.
2022-02-06 13:25:04 +00:00
t3hn3rd 4c5038b001 Merge branch 'cherry-pick-24c371ca' into 'develop'
Added new String functions

See merge request spexeah/asuro!30
2022-01-31 11:26:25 +00:00
Aaron 98481ea1ce Added new String functions
(cherry picked from commit 24c371cab1)
2022-01-31 00:36:22 +00:00
t3hn3rd b5582b1284 Double Buffer with SSE 128 copy working 2022-01-30 00:17:50 +00:00
Aaron 346dc4e4c9 Merge branch 'feature/readme-update-1' into 'develop'
Update readme.md

See merge request spexeah/asuro!29
2022-01-29 12:47:56 +00:00
t3hn3rd b2eee58df4 Update readme.md 2022-01-29 12:46:35 +00:00
t3hn3rd 161cea4920 SSE MOVUPS/128bit Memcpy + Fixed Doublebuffer 2022-01-29 01:39:45 +00:00
t3hn3rd 6b81c4ece0 Vesa32 additions + util functions to support 2022-01-23 16:58:46 +00:00
t3hn3rd ee17f69115 Fixed files being weird with case/unit searches 2021-07-07 17:49:04 +01:00
t3hn3rd 81c19bff16 Delete files to recommit with lowercase names. 2021-07-07 17:49:04 +01:00
t3hn3rd e7cda58113 New modular driver set for video
Started outlining how the modular driver set will look for video drawing routines. Currently supports Drawing pixels to the screen & Flushing backbuffer -> frontbuffer.
Still very much test code, tracer is used everywhere for debugging, NOT DEVELOP READY.
Many more draw routines need implementing - such as, but not limited to; drawRect, drawBitmap, drawLine, drawCurve, drawCircle.

TODO: Implement the aforementioned routines in all VESA modes + WindowManager.
2021-07-07 17:49:04 +01:00
t3hn3rd 44f18554e1 Abstracted video driver somewhat
Split out video driver into abstract/standard/implementation.
2021-07-07 17:49:04 +01:00
t3hn3rd 52b42ec975 Enabled AVX + Changed flush to flush 2 pixels per iteration. 2021-07-07 17:49:04 +01:00
t3hn3rd 2815dd9e4d Double buffering implemented
Double buffering is now enabled with the use of the new large alloc (klalloc).
2021-07-07 17:49:04 +01:00
t3hn3rd d057bfc3ff Expaneded Video.pas and addec color.pas
Backbuffer will need modification to lmemorymanager to remove the limits to allocation size.
2021-07-07 17:49:04 +01:00
t3hn3rd e4621c8aaa Started work on refactored video. 2021-07-07 17:49:04 +01:00
502 changed files with 200033 additions and 13078 deletions
+96
View File
@@ -0,0 +1,96 @@
kind: pipeline
type: docker
name: build
steps:
- name: build-image
image: plugins/docker
settings:
repo: t3hn3rd/asuro-build
tags: latest
dockerfile: Dockerfile
registry: docker.io
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: compile
image: t3hn3rd/asuro-build:latest
depends_on:
- build-image
commands:
- git fetch --tags
- find . -type f -print0 | xargs -0 dos2unix
- chmod +x /drone/src/toolchain/*.sh
- /drone/src/toolchain/compile.sh
- name: deploy-docs
image: alpine:latest
depends_on:
- compile
when:
branch:
- master
- develop
- feature/mkdocs
volumes:
- name: docs-htdocs
path: /htdocs
commands:
- apk add --no-cache rsync
- |
if [ "${DRONE_BRANCH}" = "master" ]; then
DEST="/htdocs/master"
else
DEST="/htdocs/develop"
fi
- mkdir -p "$DEST"
- rsync -a --delete site/ "$DEST/"
- echo "Documentation deployed to ${DRONE_BRANCH}"
- name: upload-iso-artifact
image: alpine/git
depends_on:
- compile
when:
branch:
- master
environment:
GITEA_TOKEN:
from_secret: gitea_token
commands:
- apk add --no-cache curl
- chmod +w Asuro.iso
- cp Asuro.iso "Asuro-$(git rev-parse --short HEAD).iso"
- echo "Uploading Asuro-$(git rev-parse --short HEAD).iso to Gitea Packages..."
- |
curl -X PUT "https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/$(git rev-parse --short HEAD)/Asuro.iso" \
-H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso"
- echo "Updating latest ISO reference..."
- |
curl -X DELETE https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \
-H "Authorization: token $GITEA_TOKEN" || echo "No previous latest version found."
- |
curl -X PUT https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \
-H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso"
- name: msg status
image: appleboy/drone-discord
failure: ignore
depends_on:
- compile
when:
status: [success, failure, changed]
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_secret
message: "**Asuro Build**\n\n{{#success build.status}}✅ Build successful!\n\n{{else}}❌ Build failed!\n\n{{/success}}Repository: `{{repo.namespace}}/{{repo.name}}`\nBranch: `{{commit.branch}}`\nCommit: `{{commit.sha}}`\nAuthor: `{{commit.author}} <{{commit.email}}>`\n\nGitea Diff: [Link](<{{commit.link}}>)\nDrone Build: [Link](<{{build.link}}>)\n\nMessage: {{commit.message}}"
volumes:
- name: docs-htdocs
host:
path: /mnt/user/htdocs/asuro_docs
+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
+10 -2
View File
@@ -10,5 +10,13 @@
/*.sh~ /*.sh~
/*.img /*.img
src/include/asuro.pas src/include/asuro.pas
.vscode/launch.json localenv.json
.vscode /lvgl/
dockerout.txt
AGENTS.md
lessons_learnt.md
*.log
wasuro
src/core/core.version.pas
site/*
!site/.gitkeep
-73
View File
@@ -1,73 +0,0 @@
stages:
- Compile Versions
- Compile Sources
- Link
- Generate Documentation
- Deploy
cache:
- key: ${CI_COMMIT_REF_SLUG}
paths:
- lib/*.o
- bin/kernel.bin
- doc
before_script:
- chmod +x *.sh
versions:
stage: Compile Versions
script:
- ./compile_vergen.sh
artifacts:
paths:
- release/*.svg
- src/include/asuro.pas
compile_sources:
stage: Compile Sources
script:
- rm -f lib/*.so
- ./compile_sources.sh
needs:
- versions
link:
stage: Link
script:
- ./compile_stub.sh
- ./compile_link.sh
needs:
- versions
- compile_sources
isogen:
stage: Deploy
script:
- ./compile_isogen.sh
- ./compile_sumgen.sh
artifacts:
paths:
- ./Asuro.iso
- ./release/checksum.svg
needs:
- link
docgen:
stage: Generate Documentation
only:
- master
- develop
script:
- ./compile_sourcelist.sh
- ./compile_docs.sh
# Remove comments when we want to use gitlab pages.
#- cp doc public
allow_failure: true
artifacts:
paths:
- doc
#- public/*
#- ./sources.list
needs:
- versions
+13
View File
@@ -0,0 +1,13 @@
# Map all Aaron identities to a single preferred identity
Aaron Hance <[email protected]> aaron <aaron@6dbc8c32-bb84-406f-8558-d1cf31a0ab0c>
Aaron Hance <[email protected]> aaronhance <[email protected]>
Aaron Hance <[email protected]> aaron hance <[email protected]>
Aaron Hance <[email protected]> Aaron <[email protected]>
# Map all Kieron identities to a single preferred identity
Kieron Morris <[email protected]> kieron <kieron@6dbc8c32-bb84-406f-8558-d1cf31a0ab0c>
Kieron Morris <[email protected]> Kieron <[email protected]>
Kieron Morris <[email protected]> t3hn3rd <[email protected]>
# Map goose's multiple identities
goose <goose@6dbc8c32-bb84-406f-8558-d1cf31a0ab0c> goose <[email protected]>
+3 -10
View File
@@ -3,18 +3,11 @@
{ {
"name":"Run", "name":"Run",
"request": "launch", "request": "launch",
"type": "coreclr", "type": "PowerShell",
"preLaunchTask": "Build", "preLaunchTask": "Build",
"program": "VBoxSDL", "script": "${workspaceFolder}/virtualbox-wrapper.ps1",
"args": [ "args": ["-Command", "up"],
"--comment",
"Asuro",
"--startvm",
"7d395c96-891c-4139-b77d-9b6b144b0b93"
],
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
"console": "internalConsole",
"internalConsoleOptions": "neverOpen"
} }
] ]
} }
+24 -2
View File
@@ -9,14 +9,18 @@
"command": "docker-compose", "command": "docker-compose",
"args": [ "args": [
"run", "run",
"builder" "builder",
], ],
"type": "shell", "type": "shell",
"problemMatcher": [], "problemMatcher": [],
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true
} },
"dependsOn": [
"Close VirtualBox",
"Clean"
]
}, },
{ {
"label": "Build (Builder)", "label": "Build (Builder)",
@@ -26,6 +30,24 @@
"builder" "builder"
], ],
"type": "shell" "type": "shell"
},
{
"label": "Clean",
"command": "docker-compose",
"args": [
"down",
"--remove-orphans"
],
"type": "shell"
},
{
"label": "Close VirtualBox",
"command": "./virtualbox-wrapper.ps1",
"args": [
"-Command",
"down"
],
"type": "shell"
} }
] ]
} }
+7 -5
View File
@@ -5,19 +5,21 @@ VOLUME ["/code"]
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386 RUN dpkg --add-architecture i386
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
curl dos2unix wget git make nasm binutils:i386 xorriso grub-pc-bin && \ curl dos2unix wget git make nasm binutils xorriso grub-pc-bin gcc gcc-multilib \
python3 python3-pip python3-pil && \
apt-get clean my room apt-get clean my room
RUN pip3 install --no-cache-dir --break-system-packages "mkdocs>=1.6,<2" mkdocs-material
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
ARG FPC_VERSION=2.6.4 ARG FPC_VERSION=3.2.2
RUN curl -sL https://sourceforge.net/projects/freepascal/files/Linux/$FPC_VERSION/fpc-$FPC_VERSION.i386-linux.tar/download | tar -xf - && \ RUN curl -sL https://sourceforge.net/projects/freepascal/files/Linux/$FPC_VERSION/fpc-$FPC_VERSION.i386-linux.tar/download | tar -xf - && \
pushd fpc-$FPC_VERSION.i386-linux && ./install.sh && popd && \ pushd fpc-$FPC_VERSION.i386-linux && ./install.sh && popd && \
rm -rf fpc-$FPC_VERSION.i386-linux 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 ADD https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver /usr/bin/semver
RUN mkdir /code && chmod +x /usr/bin/semver RUN chmod +x /usr/bin/semver
WORKDIR /code WORKDIR /code
RUN find . -type f -print0 | xargs -0 dos2unix RUN find . -type f -print0 | xargs -0 dos2unix
ENTRYPOINT ["/bin/bash", "-c"] 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.
-45
View File
@@ -1,45 +0,0 @@
#!/usr/bin/env bash
ERRCOUNT=0
echo " "
echo "======================="
echo " "
echo "Asuro Compilation"
echo " "
#Compile Stub.asm
rm lib/*
runOrFail() {
local binary=$1
local errorText=$2
if $binary; then
echo "Success."
else
echo "$errorText"
ERRCOUNT=$((ERRCOUNT+1))
fi
}
runOrFail $(pwd)/compile_stub.sh "Failed to compile stub!"
#Generate .pas with versioning headers.
runOrFail $(pwd)/compile_vergen.sh "Versions failed to compile"
#Compile all .pas sources
runOrFail $(pwd)/compile_sources.sh "Failed to compile FPC Sources!"
#Link into a binary.
runOrFail $(pwd)/compile_link.sh "Failed linking!"
#Generate an ISO with GRUB as the Bootloader.
runOrFail ./compile_isogen.sh "Failed to create ISO!"
#Call generate final artifacts based on failure or success of the above.
if [ "$ERRCOUNT" -ne "0" ]
then
./compile_finish.sh "failed"
else
./compile_finish.sh "success"
fi
cd ..
-17
View File
@@ -1,17 +0,0 @@
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
echo "Generating Documentation..."
echo " "
echo "Dowloading Pasdoc..."
wget https://github.com/pasdoc/pasdoc/releases/download/v0.16.0/pasdoc-0.16.0-linux-x86_64.tar.gz -O pasdoc.tar.gz
echo "Extracting Pasdoc..."
tar -xf pasdoc.tar.gz
echo "Creating doc output directory..."
mkdir ./doc
echo "Removing old docs"
rm -rf ./doc/*
echo "Generating Docs..."
./pasdoc/bin/pasdoc -N "Asuro" -T "Asuro OS Documentation" -O "html" -E ./doc/ -S sources.list --use-tipue-search
echo "Docgen finished."
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
echo "Compiling FPC Sources..."
echo " "
fpc -Aelf -gw -n -va -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* src/kernel.pas
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
echo "Compiling Stub..."
echo " "
nasm -f elf src/stub/stub.asm -o lib/stub.o
View File
+94
View File
@@ -0,0 +1,94 @@
# lmemorymanager
Compatibility shim that re-exports the `memory.heap` API under the legacy unit name.
## Overview
The Wasuro WASM VM project references the old unit name `lmemorymanager` for heap memory operations. Because the Wasuro source tree cannot be modified, this shim unit re-exports every public symbol from `memory.heap` so that `uses lmemorymanager` continues to compile without changes. All functions are thin inline wrappers that delegate directly to their `memory.heap` counterparts.
## Dependencies
- `memory.heap` -- the canonical heap allocator implementation in the Asuro kernel.
## Constants
### ALLOC_UNIT
Re-exported from `memory.heap.ALLOC_UNIT`. The base allocation unit size used by the heap allocator.
### DATA_OFFSET
Re-exported from `memory.heap.DATA_OFFSET`. Byte offset from a heap block header to the start of user data.
### PAGE_SIZE_LMM
Re-exported from `memory.heap.PAGE_SIZE_LMM`. Page size used by the lightweight memory manager.
### TOTAL_UNITS
Re-exported from `memory.heap.TOTAL_UNITS`. Total number of allocation units per heap page.
### BITMAP_DWORDS
Re-exported from `memory.heap.BITMAP_DWORDS`. Number of 32-bit words in the per-page allocation bitmap.
### SIZE_PREFIX
Re-exported from `memory.heap.SIZE_PREFIX`. Size of the prefix stored before each allocation to record its length.
### LARGE_ALLOC_MAGIC
Re-exported from `memory.heap.LARGE_ALLOC_MAGIC`. Magic value used to identify large (multi-page) allocations.
## Types
### PHeapPageHeader / THeapPageHeader
Re-exported from `memory.heap`. Pointer and record types describing the header structure at the beginning of each heap page.
## Functions and Procedures
### init
```pascal
procedure init;
```
Initializes the heap memory manager by delegating to `memory.heap.init`.
### kalloc
```pascal
function kalloc(size: uint32): void;
```
Allocates `size` bytes from the kernel heap and returns a pointer to the allocated memory.
### klalloc
```pascal
function klalloc(size: uint32): void;
```
Performs a large kernel allocation of `size` bytes and returns a pointer to the allocated memory.
### klfree
```pascal
procedure klfree(address: uint32);
```
Frees a large allocation previously obtained via `klalloc`.
### kpalloc
```pascal
function kpalloc(address: uint32): void;
```
Allocates a heap page at the specified address and returns a pointer to it.
### kfree
```pascal
procedure kfree(area: void);
```
Frees a standard allocation previously obtained via `kalloc`.
### lmm_total_free
```pascal
function lmm_total_free: uint32;
```
Returns the total number of free bytes available across all heap pages.
### lmm_page_count
```pascal
function lmm_page_count: uint32;
```
Returns the current number of heap pages managed by the allocator.
## Notes
- Every function and procedure in the implementation section is marked `inline`, so the compiler eliminates the wrapper overhead entirely.
- This unit exists solely for backward compatibility with the Wasuro WASM VM build. New kernel code should use `memory.heap` directly.
+16
View File
@@ -0,0 +1,16 @@
# types
Empty compatibility shim that satisfies `uses types` references from the Wasuro WASM VM project.
## Overview
Some units in the Wasuro WASM VM source tree include `uses types` to pull in shared type definitions from the Asuro kernel. In the kernel proper, those types may be declared elsewhere or may no longer be needed in the WASM context. This stub unit provides an empty `types` compilation unit so that `uses types` resolves without error during the Wasuro build.
## Dependencies
None.
## Notes
- The unit declares no constants, types, variables, or routines. Its only purpose is to exist as a valid compilation unit.
- If Wasuro code is ever updated to remove the `uses types` dependency, this shim can be deleted.
+32
View File
@@ -0,0 +1,32 @@
# Asuro OS
Asuro is a 32-bit x86 operating system kernel written in Free Pascal and x86 assembly.
## Documentation Structure
- **Kernel Entry** -- The `asuro.pas` main unit and boot sequence.
- **Architecture (x86)** -- CPU initialization, descriptor tables, interrupt handling, fault handlers, memory management, and process scheduling for the i386 target.
- **Boot** -- Splash screen and early boot visuals.
- **Core** -- Foundational libraries including data structures, encoding algorithms, string handling, graphics primitives, and the kernel panic subsystem.
- **Memory** -- Heap allocator (`kalloc`/`kfree`) and page-level allocation.
- **Processes** -- Process lifecycle, round-robin scheduling, and inter-process messaging.
- **I/O** -- Standard I/O (shell command dispatch) and the system log fan-out.
- **Debug** -- Execution tracer with ring-buffer call stack recording.
- **Drivers** -- Hardware abstraction covering PCI/USB buses, HID devices, networking (E1000, TCP/IP stack), storage (IDE, AHCI, VFS, file systems), video (VESA, LVGL, double-buffering), serial I/O, and timers.
- **Services** -- Background daemons for graphics rendering and USB hotplug.
- **Applications** -- Userland commands and utilities: terminal, text editor, disk tools, network tools, and a WebAssembly runtime.
- **Compatibility** -- Shim layers for legacy code.
- **LVGL Headers** -- Configuration and patches for the LVGL v9.2.2 GUI library.
- **Planning** -- Design documents and architectural notes for subsystems under development.
- **Toolchain** -- Build pipeline documentation covering compilation, linking, and ISO generation.
## Building
The kernel is built inside Docker using a containerized FreePascal 3.2.2 toolchain:
```bash
docker compose build builder
docker compose run builder
```
The documentation site will be available at `http://docs.asuro.xyz`.
+53
View File
@@ -0,0 +1,53 @@
# hack_14.c
LVGL bitmap font source for the Hack Regular typeface at 14 px.
## Overview
This file contains a pre-rendered bitmap font generated from the Hack Regular TrueType font (`Hack-Regular.ttf`) for use with LVGL. It provides a complete monospaced programmer font covering the full Basic Multilingual Plane (Unicode range 0x0000--0xFFFF). The font is intended for use in terminal emulators, code editors, or any UI element within Asuro that benefits from a fixed-width typeface.
The file was generated by the LVGL font converter tool and is approximately 12,900 lines (~548 KB) of static bitmap and glyph descriptor data.
## Configuration Options / Defines
### HACK_14
Value: `1` (default). Acts as a compile-time guard. Set to `0` to exclude this font from the build entirely.
## Font Properties
| Property | Value |
|----------|-------|
| Font family | Hack Regular |
| Size | 14 px |
| Bits per pixel | 4 (16-level anti-aliasing) |
| Compression | None (`--no-compress`) |
| Stride alignment | 1 byte |
| Data alignment | 1 byte |
| Line height | 19 px |
| Baseline | 5 px from bottom |
| Underline position | -2 |
| Underline thickness | 1 |
| Unicode range | 0x0000--0xFFFF |
| Subpixel rendering | None |
## Public Symbol
```c
const lv_font_t hack_14;
```
This is the font descriptor exposed for use in LVGL widget styles. Reference it as `&hack_14` when assigning fonts to labels, text areas, or other text-bearing widgets.
## Generation Command
```
--bpp 4 --size 14 --no-compress --stride 1 --align 1 \
--font Hack-Regular.ttf --range 0-65535 --format lvgl -o hack_14.c
```
## Notes
- This is a machine-generated file. Do not edit by hand; regenerate using the LVGL font converter if changes are needed.
- The full 0--65535 Unicode range makes this a large file. If binary size is a concern, the range could be narrowed to only the code points actually used.
- The font includes version-conditional compilation guards for compatibility across LVGL 6.x through 9.x, though Asuro targets LVGL 9.2.2.
- The `LV_ATTRIBUTE_LARGE_CONST` annotation on the glyph bitmap array allows the linker to place it in an appropriate read-only section.
+133
View File
@@ -0,0 +1,133 @@
# lv_conf.h
LVGL v9.2.2 configuration header tailored for the Asuro bare-metal kernel environment.
## Overview
This file configures the LVGL graphics library for use inside the Asuro kernel, where no standard C library, operating system, or GPU hardware is available. It selects a 32-bit XRGB8888 color depth to match the VESA framebuffer, routes all stdlib functionality through LVGL's built-in implementations, enables only the software renderer, and disables every hardware backend, filesystem driver, and image decoder. The result is a minimal but functional GUI stack that runs entirely in kernel space.
## Configuration Options / Defines
### Color Settings
#### LV_COLOR_DEPTH
Value: `32`. Matches the VESA XRGB8888 framebuffer used by Asuro.
### Standard Library Wrappers
#### LV_USE_STDLIB_MALLOC / LV_USE_STDLIB_STRING / LV_USE_STDLIB_SPRINTF
Value: `LV_STDLIB_BUILTIN`. All three are set to use LVGL's own built-in implementations since no libc is available in the bare-metal environment.
### Memory Pool
#### LV_MEM_SIZE
Value: `256 * 1024U` (256 KB). Size of LVGL's internal memory pool for widget allocations and draw buffers.
#### LV_MEM_POOL_EXPAND_SIZE
Value: `0`. Pool expansion is disabled; the 256 KB allocation is fixed.
#### LV_MEM_ADR
Value: `0`. LVGL allocates the pool itself rather than using a fixed address.
### HAL Settings
#### LV_DEF_REFR_PERIOD
Value: `33` (milliseconds). Targets approximately 30 frames per second.
#### LV_DPI_DEF
Value: `96`. Standard screen DPI assumption.
### Operating System
#### LV_USE_OS
Value: `LV_OS_NONE`. No OS abstraction layer; LVGL runs in a bare-metal cooperative model.
### Rendering Configuration
#### LV_USE_DRAW_SW
Value: `1`. The software renderer is the sole rendering backend.
Only the color formats actually used are enabled within the software renderer:
| Define | Value | Description |
|--------|-------|-------------|
| `LV_DRAW_SW_SUPPORT_XRGB8888` | 1 | Primary framebuffer format |
| `LV_DRAW_SW_SUPPORT_ARGB8888` | 1 | Alpha-blended surfaces |
| `LV_DRAW_SW_SUPPORT_RGB888` | 1 | 24-bit fallback |
| `LV_DRAW_SW_SUPPORT_RGB565` | 0 | Disabled |
| All other formats | 0 | Disabled |
#### LV_DRAW_SW_COMPLEX
Value: `1`. Enables complex draw operations (shadows, rounded corners). Shadow cache is disabled (`LV_DRAW_SW_SHADOW_CACHE_SIZE = 0`); circle cache is set to 4 entries.
#### LV_DRAW_LAYER_SIMPLE_BUF_SIZE
Value: `24 * 1024` (24 KB). Buffer for simple layer rendering.
#### GPU Backends
All GPU-accelerated backends are disabled: VGLite, PXP, Dave2D, SDL, VG-Lite.
### Logging
#### LV_USE_LOG
Value: `1`. Logging is enabled at `LV_LOG_LEVEL_WARN`. Printf-based logging, timestamps, and file/line info are all disabled to reduce overhead. All trace categories (memory, timer, indev, display refresh, events, object creation, layout, animation, cache) are disabled.
### Assertions
#### LV_USE_ASSERT_NULL / LV_USE_ASSERT_MALLOC
Value: `1`. Null-pointer and malloc-failure assertions are active.
#### LV_ASSERT_HANDLER
Value: `{}` (no-op). The assert handler intentionally does nothing to avoid hanging the kernel on a failed assertion.
### Fonts
#### LV_FONT_MONTSERRAT_14
Value: `1`. The only built-in Montserrat size enabled.
#### LV_FONT_DEFAULT
Value: `&lv_font_montserrat_14`. All other Montserrat sizes (8--48), compressed variants, and alternative font families (DejaVu, SimSun, UNSCII) are disabled.
### Text Settings
#### LV_TXT_ENC
Value: `LV_TXT_ENC_UTF8`. UTF-8 text encoding. BiDi and Arabic/Persian character support are disabled.
### Widgets
Enabled widgets: AnimImg, Arc, Bar, Button, ButtonMatrix, Checkbox, Dropdown, Image, Keyboard, Label, Line, List, MsgBox, Roller, Slider, Spinner, Switch, TextArea, Table, TabView, Win.
Disabled widgets: Calendar, Canvas, Chart, ImageButton, LED, Lottie, Menu, Scale, Span, SpinBox, TileView.
### Themes
#### LV_USE_THEME_DEFAULT
Value: `1`. Dark mode enabled (`LV_THEME_DEFAULT_DARK = 1`) with 80 ms transition time.
#### LV_USE_THEME_SIMPLE
Value: `1`.
#### LV_USE_THEME_MONO
Value: `0`.
### Layouts
Both Flex and Grid layout engines are enabled.
### Third-Party Libraries
All filesystem drivers are disabled (stdio, POSIX, Win32, FatFS, MemFS, LittleFS). All image decoders are disabled (PNG, BMP, JPEG, GIF, RLE). FreeType, TinyTTF, Rlottie, vector graphics, LZ4, and FFmpeg are all disabled.
### Device Drivers
All platform-specific device drivers are disabled (SDL, X11, Wayland, Linux FBDEV, Linux DRM, NuttX, various SPI display controllers, Windows, OpenGLES, QNX). Display and input are handled by Asuro's own HAL layer.
### Examples and Demos
All built-in examples and demo applications are disabled.
## Notes
- The configuration is designed for minimal footprint. Features are enabled only when required by the Asuro desktop shell.
- Since no libc is linked, all string, memory, and formatting operations fall through to LVGL's internal implementations.
- The assert handler is a deliberate no-op to prevent the kernel from halting on non-critical UI assertion failures.
- The 256 KB memory pool is fixed and cannot expand at runtime. UI complexity must stay within this budget.

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