Compare commits

..
17 Commits
Author SHA1 Message Date
Aaron 9d4323ca53 Merge pull request 'Automate boot unit inclusion with architecture-aware Moderne analysis' (#74) from feature/dangling-unit-resolution into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #74
2026-11-07 22:32:22 +00:00
t3hn3rd dd3bb1e016 Automate boot unit inclusion with architecture-aware Moderne analysis
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Replace boot.mgr's static unit list with generated dangling_units.inc
- Generate Pascal LSTs and run the dangling-unit recipe before compilation
- Exclude Wasuro, inactive architectures, and NOT_DANGLING units
- Add ASURO_ARCH selection with an x86 default
- Mark unfinished legacy units as NOT_DANGLING
- Inherit pinned Moderne tooling in the builder image
- Ensure Drone pulls the latest builder image
- Document the updated build pipeline in MkDocs

Validation:
- Full x86 ISO build and VirtualBox boot succeeded
- 1,133 kernel tests passed with no failures
- x86_64 build failed clearly due to unavailable sources
2026-11-07 21:49:06 +00:00
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
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
166 changed files with 75291 additions and 916 deletions

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ steps:
- name: compile - name: compile
image: t3hn3rd/asuro-build:latest image: t3hn3rd/asuro-build:latest
pull: always
depends_on: depends_on:
- build-image - build-image
commands: commands:
+5 -1
View File
@@ -19,4 +19,8 @@ lessons_learnt.md
wasuro wasuro
src/core/core.version.pas src/core/core.version.pas
site/* site/*
!site/.gitkeep !site/.gitkeep
/src/boot/dangling_units.inc
/lib/dangling/
.moderne
CLAUDE.md
+5 -5
View File
@@ -1,4 +1,5 @@
FROM ubuntu:latest ARG RECIPES_IMAGE=t3hn3rd/moderne-asuro-recipes:0.1.1@sha256:eaf54188053511dad9c620a8fb98b0f50c41770cd49a0b3d71a0538386522011
FROM ${RECIPES_IMAGE}
VOLUME ["/code"] VOLUME ["/code"]
@@ -6,8 +7,8 @@ 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 xorriso grub-pc-bin gcc gcc-multilib \ curl dos2unix wget git make nasm binutils xorriso grub-pc-bin gcc gcc-multilib \
python3 python3-pip && \ python3 python3-pip python3-pil && \
apt-get clean my room apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir --break-system-packages "mkdocs>=1.6,<2" mkdocs-material RUN pip3 install --no-cache-dir --break-system-packages "mkdocs>=1.6,<2" mkdocs-material
@@ -20,6 +21,5 @@ RUN curl -sL https://sourceforge.net/projects/freepascal/files/Linux/$FPC_VERSIO
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 chmod +x /usr/bin/semver RUN chmod +x /usr/bin/semver
WORKDIR /code WORKDIR /code
RUN find . -type f -print0 | xargs -0 dos2unix
ENTRYPOINT ["/bin/bash", "-c"] ENTRYPOINT ["/bin/bash", "-c"]
CMD ["find toolchain -name '*.sh' -exec dos2unix {} + 2>/dev/null; find toolchain -name '*.sh' -exec chmod +x {} +; bash toolchain/compile.sh"] CMD ["find toolchain -name '*.sh' -exec dos2unix {} + 2>/dev/null; find toolchain -name '*.sh' -exec chmod +x {} +; bash toolchain/compile.sh"]
+8
View File
@@ -0,0 +1,8 @@
**/.git
**/.gradle
**/build
**/.moderne
wasuro
site
lib
release
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+4
View File
@@ -17,6 +17,10 @@ Central initialization manager for all baked-in terminal programs and kernel-lev
- `core.version`, `arch.x86.cpu` - `core.version`, `arch.x86.cpu`
- `app.diskcmd`, `driver.bus.usb.core`, `app.diskutil`, `app.notepad`, `app.partcmd`, `app.volcmd` - `app.diskcmd`, `driver.bus.usb.core`, `app.diskutil`, `app.notepad`, `app.partcmd`, `app.volcmd`
## Boot Registration
Registered with `boot.mgr` as `app.mgr` at the `late` barrier.
## Functions and Procedures ## Functions and Procedures
### init ### init
+28
View File
@@ -0,0 +1,28 @@
# app.wasm
WebAssembly VM backend initialiser.
## Overview
This unit initialises the Wasuro WebAssembly virtual machine backend. It wires up the VM's character output to the syslog interface and calls the main `wasm_init` entry point.
## Boot Registration
Registered with `boot.mgr` as `app.wasm` at the `final` barrier.
## Dependencies
- `boot.mgr`
- `io.syslog`
- `wasm.vm.io`
- `wasm`
## Procedures
### init
```pascal
procedure init;
```
Sets the WASM VM's write-character callback to `io.syslog.logchar` and calls `wasm.wasm_init` to initialise the VM runtime.
+4
View File
@@ -13,6 +13,10 @@ This unit probes the processor using the CPUID instruction to discover the vendo
- `driver.timer.rtc` - `driver.timer.rtc`
- `io.stdio` - `io.stdio`
## Boot Registration
Registered with `boot.mgr` as `arch.x86.cpu` at the `early` barrier.
## Types ## Types
### TCapabilities_Old / PCapabilities_Old ### TCapabilities_Old / PCapabilities_Old
+4
View File
@@ -10,6 +10,10 @@ This unit defines the GDT data structures and provides procedures to set individ
- `io.syslog` - `io.syslog`
## Boot Registration
Registered with `boot.mgr` as `arch.x86.gdt` at the `early` barrier.
## Types ## Types
### TGDT_Entry / PGDT_Entry ### TGDT_Entry / PGDT_Entry
+4
View File
@@ -12,6 +12,10 @@ This unit defines the 256-entry IDT used by the x86 interrupt system. It provide
- `arch.x86.util` - `arch.x86.util`
- `io.syslog` - `io.syslog`
## Boot Registration
Registered with `boot.mgr` as `arch.x86.idt`, depending on `arch.x86.gdt`.
## Constants ## Constants
### ISR_RING_0 ### ISR_RING_0
+4
View File
@@ -12,6 +12,10 @@ This unit reinitialises and remaps the two 8259A Programmable Interrupt Controll
- `arch.x86.util` - `arch.x86.util`
- `io.syslog` - `io.syslog`
## Boot Registration
Registered with `boot.mgr` as `arch.x86.irq`, depending on `arch.x86.idt`.
## Functions and Procedures ## Functions and Procedures
### init ### init
+4
View File
@@ -6,6 +6,10 @@ ISR driver initialisation stub.
This is a minimal stub unit that satisfies compile-time dependencies on an ISR initialisation entry point. The `init` procedure body is empty; actual ISR handler registration and IDT gate setup are performed by `arch.x86.isr.mgr` and the individual handler units in the `isr/` and `fault/` subdirectories. This is a minimal stub unit that satisfies compile-time dependencies on an ISR initialisation entry point. The `init` procedure body is empty; actual ISR handler registration and IDT gate setup are performed by `arch.x86.isr.mgr` and the individual handler units in the `isr/` and `fault/` subdirectories.
## Boot Registration
Registered with `boot.mgr` as `asuro.x86.isr`, depending on glob `driver.storage.*.mgr` (waits for all matching entries).
## Functions and Procedures ## Functions and Procedures
### init ### init
+4
View File
@@ -12,6 +12,10 @@ This unit acts as the glue layer between the x86 interrupt subsystem and the arc
- `arch.x86.util` (implementation) - `arch.x86.util` (implementation)
- `arch.x86.isr.types` (implementation) - `arch.x86.isr.types` (implementation)
## Boot Registration
Registered with `boot.mgr` as `arch.x86.panic`, depending on glob `driver.video*` (waits for all matching entries).
## Functions and Procedures ## Functions and Procedures
### init ### init
+4
View File
@@ -22,6 +22,10 @@ A minimal TSS is installed in GDT gate 5 so the CPU can locate the ring-0 stack
- `arch.x86.idt` - `arch.x86.idt`
- `arch.x86.isr.types` - `arch.x86.isr.types`
## Boot Registration
Registered with `boot.mgr` as `arch.x86.v86` at the `early` barrier.
## Constants ## Constants
| Constant | Value | Description | | Constant | Value | Description |
+4
View File
@@ -28,6 +28,10 @@ This unit is the single entry point for registering all x86 CPU exception handle
- `arch.x86.fault.snpe` - `arch.x86.fault.snpe`
- `arch.x86.fault.uie` - `arch.x86.fault.uie`
## Boot Registration
Registered with `boot.mgr` as `arch.x86.fault`, depending on `arch.x86.isr.mgr`.
## Functions and Procedures ## Functions and Procedures
### init ### init
+4
View File
@@ -18,6 +18,10 @@ Each ISR stub is declared with the Free Pascal `interrupt` directive, which caus
- `io.syslog` (implementation) - `io.syslog` (implementation)
- `arch.x86.isr.ioapic` (implementation) - `arch.x86.isr.ioapic` (implementation)
## Boot Registration
Registered with `boot.mgr` as `arch.x86.isr.mgr`, depending on `arch.x86.irq`.
## Constants ## Constants
`MAX_HOOKS` is imported from `arch.x86.isr.types` and defines the maximum number of callbacks per vector. `MAX_HOOKS` is imported from `arch.x86.isr.types` and defines the maximum number of callbacks per vector.
@@ -16,6 +16,10 @@ During initialisation, the Multiboot memory map is walked to populate `PhysPrese
- `core.util` - `core.util`
- `arch.x86.util` - `arch.x86.util`
## Boot Registration
Registered with `boot.mgr` as `arch.x86.memory.physical`, depending on `arch.x86.idt`.
## Constants ## Constants
| Constant | Value | Description | | Constant | Value | Description |
@@ -17,6 +17,10 @@ During `init`, the current page directory loaded by the bootloader is adopted as
- `debug.tracer` - `debug.tracer`
- `memory.heap` (implementation) - `memory.heap` (implementation)
## Boot Registration
Registered with `boot.mgr` as `arch.x86.memory.virtual`, depending on `arch.x86.memory.physical`.
## Types ## Types
### TPageDirEntry / PPageDirEntry ### TPageDirEntry / PPageDirEntry
+37 -1
View File
@@ -93,8 +93,44 @@ A bitpacked array of 8 Booleans.
| FileRec | Internal file descriptor record | | FileRec | Internal file descriptor record |
| TextRec | Internal text file record with buffer | | TextRec | Internal text file record with buffer |
### INITFINAL Table Types
#### TInitFinalRec
```pascal
TInitFinalRec = packed record
InitProc : CodePointer;
FinalProc: CodePointer;
end;
```
A single entry in the compiler-generated INITFINAL table. `InitProc` points to the unit's `initialization` section code (or nil if the unit has no initialization section). `FinalProc` points to the `finalization` section code (or nil).
#### TInitFinalTable / PInitFinalTable
```pascal
TInitFinalTable = packed record
TableCount : longint;
Procs : array[1..1] of TInitFinalRec;
end;
```
The top-level INITFINAL table structure. `TableCount` is the number of entries. `Procs` is declared as a single-element array but the compiler generates `TableCount` entries (accessed via 1-based indexing up to `TableCount`).
#### TProcedure
`TProcedure = procedure` — Procedure type used to cast `CodePointer` values from the INITFINAL table before calling them.
## Variables ## Variables
### InitFinalTable
```pascal
var InitFinalTable : TInitFinalTable; external name 'INITFINAL';
```
The compiler-generated INITFINAL table. Contains one `TInitFinalRec` for every unit in the program that has an `initialization` or `finalization` section. Referenced by `fpc_initializeunits` to walk and call each unit's initialization code before `kmain` runs.
### AK_START / AK_END ### AK_START / AK_END
```pascal ```pascal
@@ -152,7 +188,7 @@ All `compilerproc` stubs are mapped to their standard `FPC_*` aliases:
| Procedure | Alias | Description | | Procedure | Alias | Description |
|-----------|-------|-------------| |-----------|-------|-------------|
| fpc_initializeunits | FPC_INITIALIZEUNITS | No-op; boot sequence handles unit init | | fpc_initializeunits | FPC_INITIALIZEUNITS | Walks the INITFINAL table and calls each unit's initialization procedure |
| fpc_do_exit | FPC_DO_EXIT | CLI + HLT | | fpc_do_exit | FPC_DO_EXIT | CLI + HLT |
| fpc_handleerror | FPC_HANDLEERROR | Sets ErrorCode, CLI + HLT | | fpc_handleerror | FPC_HANDLEERROR | Sets ErrorCode, CLI + HLT |
| fpc_rangeerror | FPC_RANGEERROR | HandleErrorInternal(201) | | fpc_rangeerror | FPC_RANGEERROR | HandleErrorInternal(201) |
Loaded 20 of 166 files, more files were not shown because too many files have changed in this diff. Show more