Compare commits

..
13 Commits
Author SHA1 Message Date
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
45 changed files with 6587 additions and 622 deletions

No files matched your search

+94 -1
View File
@@ -1 +1,94 @@
# Placeholder
# 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 -1
View File
@@ -1 +1,16 @@
# Placeholder
# 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.
+53 -1
View File
@@ -1 +1,53 @@
# Placeholder
# 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 -1
View File
@@ -1 +1,133 @@
# Placeholder
# 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.
+55 -1
View File
@@ -1 +1,55 @@
# Placeholder
# lv_font_fa_solid_16.c
LVGL bitmap font source for Font Awesome 7 Free Solid at 16 px.
## Overview
This file contains a pre-rendered bitmap font generated from the Font Awesome 7 Free Solid TrueType font (`Font Awesome 7 Free-Solid-900.ttf`) for use with LVGL. It provides a library of solid-style vector icons rendered as bitmaps, suitable for toolbar buttons, status indicators, navigation elements, and general iconography in the Asuro GUI.
The file was generated by the LVGL font converter tool and is approximately 35,800 lines (~1.6 MB) of static bitmap and glyph descriptor data.
## Configuration Options / Defines
### LV_FONT_FA_SOLID_16
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 | Font Awesome 7 Free Solid 900 |
| Size | 16 px |
| Bits per pixel | 4 (16-level anti-aliasing) |
| Compression | None (`--no-compress`) |
| Stride alignment | 1 byte |
| Data alignment | 1 byte |
| Line height | 20 px |
| Baseline | 4 px from bottom |
| Underline position | 0 |
| Underline thickness | 0 |
| Unicode range | 0x0000--0xFFFF |
| Subpixel rendering | None |
## Public Symbol
```c
const lv_font_t lv_font_fa_solid_16;
```
This is the font descriptor exposed for use in LVGL widget styles. Reference it as `&lv_font_fa_solid_16` when assigning icon fonts to labels or buttons. Font Awesome icons are addressed by their Unicode code points (e.g., `LV_SYMBOL_*` constants or raw `\uXXXX` escape sequences).
## Generation Command
```
--bpp 4 --size 16 --no-compress --stride 1 --align 1 \
--font "Font Awesome 7 Free-Solid-900.ttf" --range 0-65535 --format lvgl \
-o lv_font_fa_solid_16.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 includes all Font Awesome solid icons. Since most code points in this range are blank (Font Awesome only defines glyphs for its icon set), the actual rendered glyph count is much smaller than the range suggests, but the descriptor tables still consume significant space.
- The file is the largest in the `lvglh/` directory at approximately 1.6 MB. If binary size becomes a constraint, the Unicode range should be narrowed to only the icon code points actually used by the Asuro shell.
- 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.
File diff suppressed because it is too large. Load diff
+587
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+12
View File
@@ -106,6 +106,12 @@ function intToString(i : uint32) : pchar;
```
Returns a heap-allocated decimal string representation of `i`.
### int64ToString
```pascal
function int64ToString(i : int64) : pchar;
```
Returns a heap-allocated decimal string representation of the signed 64-bit integer `i`. Negative values are prefixed with `'-'`.
### hexStringToInt
```pascal
function hexStringToInt(str : pchar) : uint32;
@@ -118,6 +124,12 @@ function boolToString(b : boolean; ext : boolean) : pchar;
```
Returns a heap-allocated string for the boolean `b`. When `ext` is `true`, returns `'true'` or `'false'`; when `false`, returns `'1'` or `'0'`.
### doubleToStr
```pascal
function doubleToStr(d : Double) : pchar;
```
Returns a heap-allocated decimal string representation of the 64-bit floating-point value `d`. Integer values are emitted without a decimal point (e.g. `42`). Fractional values include up to 15 significant digits with trailing zeros removed. Very large or very small values use scientific notation (e.g. `1.5e+20`).
### UnitTest
```pascal
procedure UnitTest;
File diff suppressed because it is too large. Load diff
+44 -1
View File
@@ -1 +1,44 @@
# Placeholder
# compile.sh
Top-level build orchestrator for the Asuro kernel.
## Overview
`compile.sh` is the main entry point for building the Asuro operating system. It sequentially invokes each stage of the build pipeline, halting on the first failure. After all stages complete (or a failure occurs), it calls `compile_finish.sh` to generate a build-status badge and set the exit code.
## Prerequisites
- All sub-scripts must be present in the same directory as `compile.sh`.
- The Docker build container must provide: `bash`, `nasm`, `fpc`, `gcc`, `ld`, `grub-mkrescue`, `git`, `wget`, and standard POSIX utilities.
## Inputs
None directly. Each sub-script reads its own inputs from the source tree.
## Outputs
- All artifacts produced by the sub-scripts (object files, kernel binary, ISO image, version info, badges, documentation).
- Final exit code: `0` on success, `1` on failure.
## Behavior
1. Clears the `lib/` directory to ensure a clean build.
2. Defines a helper function `runOrFail` that runs a command and increments `ERRCOUNT` on failure.
3. Resolves its own directory (`TOOLCHAIN_DIR`) so sub-scripts can be located by absolute path.
4. Declares an ordered list of build steps (script name and error message pairs):
- `compile_stub.sh` -- Assemble boot stubs.
- `compile_vergen.sh` -- Generate version information.
- `compile_lvgl.sh` -- Compile the LVGL graphics library.
- `compile_wasuro.sh` -- Pull the Wasuro WASM runtime sources.
- `compile_sources.sh` -- Compile Free Pascal kernel sources.
- `compile_link.sh` -- Link all object files into `kernel.bin`.
- `compile_isogen.sh` -- Create the bootable ISO image.
- `compile_docs.sh` -- Generate project documentation.
5. Iterates through the steps. If `ERRCOUNT` is non-zero, all remaining steps are skipped.
6. Calls `compile_finish.sh` with either `"success"` or `"failed"` depending on whether any errors were recorded.
7. Changes directory back up one level (`cd ..`).
## Notes
- `compile_finish.sh` is sourced (`. script`) rather than executed as a sub-process, so its `exit` call terminates the entire pipeline.
- The build is fail-fast: the first failing step prevents all subsequent steps from running, but the finish step always runs to produce a status badge.
+38 -1
View File
@@ -1 +1,38 @@
# Placeholder
# compile_checksum.sh
Generates MD5 checksums for all Pascal source files.
## Overview
`compile_checksum.sh` iterates over every `.pas` file under `src/` and appends its MD5 hash to `checksums.md5`. This file serves as a source-level fingerprint used by `compile_vergen.sh` to produce a build integrity checksum.
## Prerequisites
- `md5sum` and `find` must be available.
- The `src/` directory must exist and contain `.pas` files.
## Inputs
All `*.pas` files found recursively under `src/`, up to 10 levels deep.
## Outputs
| File | Description |
|------|-------------|
| `checksums.md5` | A file containing one `md5sum`-format line per Pascal source file. |
## Behavior
1. Truncates (or creates) `checksums.md5` with an empty write (`echo >`).
2. Finds all directories under `src/` (up to 10 levels deep).
3. For each directory, iterates over `*.pas` files and computes their MD5 checksum.
4. Skips files matching any of the following conditions:
- Path contains `.svn` (Subversion metadata).
- The glob matched no files (literal `*.pas` string).
- Path contains `include/asuro.pas`.
5. Appends each valid checksum line to `checksums.md5`.
## Notes
- The resulting `checksums.md5` is consumed by `compile_vergen.sh`, which hashes the checksum file itself to produce a single build fingerprint constant embedded in the kernel.
- The `.svn` exclusion is a legacy filter from when the project used Subversion for version control.
-14
View File
@@ -18,20 +18,6 @@ Builds the static documentation website from the Markdown files in the `doc/` di
3. Runs `mkdocs build --strict` to generate the static site.
4. Output is written to the `site/` directory at the project root.
## Docker Usage
The documentation site can also be built and served via Docker Compose:
```bash
# Live development server with hot-reload
docker compose up docs
# Static build only
docker compose run docs build --strict
```
The development server listens on `http://localhost:8000`.
## Configuration
The site is configured by `mkdocs.yml` in the project root. The navigation structure mirrors the `doc/` directory hierarchy.
+40 -1
View File
@@ -1 +1,40 @@
# Placeholder
# compile_finish.sh
Reports build status and generates the build result badge.
## Overview
`compile_finish.sh` is the final step in the Asuro build pipeline. It is sourced (not executed) by `compile.sh` and receives a single argument indicating whether the build succeeded or failed. It downloads the appropriate shields.io badge and exits with the corresponding exit code.
## Prerequisites
- `wget` must be available (though badge download failure is non-fatal).
- The `release/` directory must exist.
## Inputs
| Input | Description |
|-------|-------------|
| `$1` | A string argument: `"failed"` or `"success"`. Passed by `compile.sh`. |
## Outputs
| File | Description |
|------|-------------|
| `release/build.svg` | A shields.io badge: red "build-failed" or green "build-succeeded". |
## Behavior
1. If `$1` is `"failed"`:
- Prints an error message directing the user to review the log.
- Downloads a red "build-failed" badge to `release/build.svg`.
- Exits with code 1.
2. Otherwise:
- Prints a success message.
- Downloads a green "build-succeeded" badge to `release/build.svg`.
- Exits with code 0.
## Notes
- This script is sourced (`. compile_finish.sh`) by `compile.sh`, meaning its `exit` call terminates the parent shell. This is intentional -- it sets the final exit code for the entire build pipeline.
- Badge download is silent and non-blocking; if `wget` fails (e.g., no network), the build still reports the correct exit code.
+37 -1
View File
@@ -1 +1,37 @@
# Placeholder
# compile_isogen.sh
Creates a bootable GRUB ISO image containing the Asuro kernel.
## Overview
`compile_isogen.sh` copies the compiled kernel binary into the ISO directory structure and invokes `grub-mkrescue` to produce a bootable CD-ROM image. The resulting `Asuro.iso` can be booted in any x86 emulator (QEMU, VirtualBox, etc.) or written to physical media.
## Prerequisites
- `grub-mkrescue` (from GRUB utilities) and `xorriso` (its backend) must be available.
- `bin/kernel.bin` must exist (produced by `compile_link.sh`).
- The `iso/boot/` directory must exist and contain a GRUB configuration file (`iso/boot/grub/grub.cfg`).
## Inputs
| Source | Description |
|--------|-------------|
| `bin/kernel.bin` | The linked kernel binary. |
| `iso/` | Pre-existing ISO directory tree with GRUB configuration. |
## Outputs
| File | Description |
|------|-------------|
| `Asuro.iso` | Bootable GRUB rescue ISO image. |
| `iso/boot/asuro.bin` | Copy of the kernel binary placed into the ISO tree. |
## Behavior
1. Copies `bin/kernel.bin` to `iso/boot/asuro.bin`.
2. Runs `grub-mkrescue -o Asuro.iso iso` to generate the bootable ISO from the `iso/` directory tree.
## Notes
- The GRUB configuration in `iso/boot/grub/grub.cfg` must reference `asuro.bin` as the kernel to load.
- The ISO is generated in the project root directory.
+47 -1
View File
@@ -1 +1,47 @@
# Placeholder
# compile_link.sh
Links all object files and libraries into the final kernel binary.
## Overview
`compile_link.sh` collects every `.o` object file in `lib/`, locates `libgcc` for i386, and invokes the GNU linker (`ld`) to produce `bin/kernel.bin`. The linker script `toolchain/linker.script` controls the memory layout of the resulting binary.
## Prerequisites
- `ld` (GNU linker) and `gcc` must be available.
- All object files must have been produced by prior build steps (`compile_stub.sh`, `compile_sources.sh`).
- `lib/liblvgl.a` must exist (produced by `compile_lvgl.sh`).
- `toolchain/linker.script` must exist.
- The `bin/` output directory must exist.
## Inputs
| Source | Description |
|--------|-------------|
| `lib/*.o` | All ELF object files (boot stub, Pascal units, splash screen, etc.). |
| `lib/liblvgl.a` | Static LVGL library archive. |
| `libgcc` (system) | GCC runtime support library for i386, located via `gcc -m32 -print-libgcc-file-name`. |
| `toolchain/linker.script` | Linker script defining section layout and entry point. |
## Outputs
| File | Description |
|------|-------------|
| `bin/kernel.bin` | The final linked, stripped kernel binary. |
## Behavior
1. Collects all `.o` files from `lib/`, excluding `lib/stub.o` from the general list.
2. Prepends `lib/stub.o` to the front of the object list so the boot entry point is linked first.
3. Locates `libgcc` for the 32-bit target using `gcc -m32 -print-libgcc-file-name`.
4. Invokes `ld` with the following flags:
- `-m elf_i386` -- Target i386 ELF format.
- `-s` -- Strip all symbol information.
- `--gc-sections` -- Remove unused sections (works with FPC's `-CX -XXs` smart-linking).
- `-T toolchain/linker.script` -- Use the project linker script.
- `--start-group` / `--end-group` -- Wraps `liblvgl.a` and `libgcc` to resolve circular references between them.
## Notes
- `stub.o` must be first in the link order because it contains the multiboot header and the initial entry point that GRUB transfers control to.
- The `--start-group` / `--end-group` construct allows the linker to iterate over `liblvgl.a` and `libgcc` multiple times to resolve all symbols, which is necessary when C library objects have mutual dependencies.
+51 -1
View File
@@ -1 +1,51 @@
# Placeholder
# compile_lvgl.sh
Downloads and compiles LVGL v9.2 into a static library for the kernel.
## Overview
`compile_lvgl.sh` clones the LVGL graphics library source, cross-compiles every C source file to 32-bit freestanding ELF objects, and archives them into `lib/liblvgl.a`. It also compiles any custom Asuro-specific LVGL extension files found in `lvglh/`. A caching mechanism on the host-mounted `/code/lvgl/` directory allows subsequent builds to skip the entire compilation.
## Prerequisites
- `git`, `gcc`, `ar`, and standard POSIX utilities must be available.
- The `lvglh/` directory must contain an `lv_conf.h` configuration header (and optionally custom `.c` files).
- The `lib/` output directory must exist.
## Inputs
| Source | Description |
|--------|-------------|
| LVGL Git repository | Cloned from `https://github.com/lvgl/lvgl.git` at tag `v9.2.2`. |
| `lvglh/` | Project-local directory containing `lv_conf.h` and optional custom C source files. |
| `/code/lvgl/liblvgl.a` | Optional cached artifact from a previous build (host mount). |
## Outputs
| File | Description |
|------|-------------|
| `lib/liblvgl.a` | Static archive containing all compiled LVGL and custom extension objects. |
| `/code/lvgl/` | Cached copy of the static library, LVGL source, and object files for future builds. |
## Behavior
1. **Cache check**: If `/code/lvgl/liblvgl.a` exists, copies it to `lib/` and exits immediately.
2. **Clone**: Shallow-clones the LVGL repository at the specified version tag into `/tmp/lvgl`.
3. **Discover sources**: Finds all `.c` files under the LVGL `src/` directory, excluding test files.
4. **Compile**: Compiles each source file with GCC using the following key flags:
- `-m32 -march=i686` -- 32-bit i686 target.
- `-ffreestanding -fno-builtin -fno-stack-protector -fno-pic -fno-pie` -- Bare-metal environment.
- `-O2` -- Optimization level 2.
- `-DLV_CONF_INCLUDE_SIMPLE` -- Tells LVGL to include `lv_conf.h` via a simple path.
- Include paths for `lvglh/` and the LVGL source tree.
5. **Archive**: Collects all `.o` files into `lib/liblvgl.a` using `ar rcs`.
6. **Custom extensions**: If `lvglh/` contains `.c` files, compiles them with the same flags and appends the resulting objects to `liblvgl.a`.
7. **Cache write**: Copies the static library, source, and objects to `/code/lvgl/` on the host mount for future builds.
Progress is reported every 50 files. The script aborts with exit code 1 if any compilation errors occur.
## Notes
- All intermediate work (clone, object files) happens in `/tmp` for speed on container-local filesystems.
- The cache lives on the host mount at `/code/lvgl/`. Deleting `lvgl/liblvgl.a` from the project root forces a full rebuild.
- The static library is linked into the kernel by `compile_link.sh` using `--start-group` / `--end-group` alongside `libgcc`.
+32 -1
View File
@@ -1 +1,32 @@
# Placeholder
# compile_sourcelist.sh
Generates a list of all Pascal source files in the project.
## Overview
`compile_sourcelist.sh` scans the parent directory for all `.pas` files and writes their paths to `sources.list`. This file can be used by other tools or scripts that need a manifest of Pascal source files.
## Prerequisites
- `find` must be available.
- Must be run from a subdirectory of the project root (it searches `..`).
## Inputs
The entire project directory tree (searched recursively for `*.pas` files).
## Outputs
| File | Description |
|------|-------------|
| `sources.list` | A newline-delimited list of absolute paths to all `.pas` files found. |
## Behavior
1. Uses `find` to locate all files matching `*.pas` in the parent directory.
2. Writes the results to `sources.list` in the current working directory.
3. Exits with code 0.
## Notes
- This script is not currently listed in the `compile.sh` build pipeline steps. It may be used as a standalone utility or by external tooling.
+55 -1
View File
@@ -1 +1,55 @@
# Placeholder
# compile_sources.sh
Compiles the Asuro kernel Pascal sources with Free Pascal.
## Overview
`compile_sources.sh` invokes the Free Pascal Compiler (FPC) to compile the main kernel unit (`src/asuro.pas`) along with all dependent units. It dynamically discovers every subdirectory under `src/`, `wasuro/`, and `compat/` and passes them as unit search paths (`-Fu`) so that FPC can resolve all unit references.
## Prerequisites
- `fpc` (Free Pascal Compiler 3.2.2 or compatible) must be available.
- `find` must be available.
- The `src/`, `wasuro/`, and `compat/` directories must be populated with their respective Pascal sources.
- The `lib/` output directory must exist.
## Inputs
| Source | Description |
|--------|-------------|
| `src/asuro.pas` | The top-level kernel program unit. |
| `src/**/*.pas` | All kernel Pascal source units. |
| `wasuro/**/*.pas` | Wasuro WASM runtime units (pulled by `compile_wasuro.sh`). |
| `compat/**/*.pas` | Compatibility layer units. |
## Outputs
| File | Description |
|------|-------------|
| `lib/*.o` | ELF object files for each compiled unit. |
| `lib/*.ppu` | FPC precompiled unit files. |
## Behavior
1. Discovers all subdirectories under `src/`, `wasuro/`, and `compat/` using `find`.
2. Builds a `-Fu` flag string containing every discovered directory.
3. Invokes `fpc` with the following key flags:
- `-Aelf` -- Output ELF-format assembly.
- `-gw -g -gl` -- Generate DWARF debug info and line info.
- `-n` -- Ignore `fpc.cfg`; do not load default configuration.
- `-v0e` -- Verbosity: errors only.
- `-O3` -- Aggressive optimization.
- `-OpPENTIUM3` -- Optimize for Pentium III instruction scheduling.
- `-Si -Sc -Sg` -- Enable inline, C-style operators, and goto support.
- `-Xd` -- Do not search default library path.
- `-CX -XXs` -- Create smartlinkable units and strip unused code.
- `-CfSSE -CfSSE2` -- Use SSE/SSE2 floating-point.
- `-Rintel` -- Use Intel assembler syntax.
- `-Pi386 -Tlinux` -- Target i386 Linux (ELF).
- `-FElib/` -- Output compiled files to `lib/`.
## Notes
- The `-n` flag is critical: it prevents FPC from loading any system-wide configuration that might introduce incompatible settings for the bare-metal target.
- The `-Xd` flag ensures FPC does not try to link against system libraries, since the kernel is freestanding.
- Object files produced here are later consumed by `compile_link.sh`.
+37 -1
View File
@@ -1 +1,37 @@
# Placeholder
# compile_stub.sh
Assembles the low-level boot stub and splash screen objects.
## Overview
`compile_stub.sh` uses NASM to assemble two assembly source files into ELF object files. These objects contain the initial boot entry point and an embedded splash-screen TGA image, both of which are linked into the final kernel binary.
## Prerequisites
- `nasm` must be available on the PATH.
- The source files `src/arch/x86/boot/stub.asm` and `src/boot/splash_tga.asm` must exist.
- The `lib/` output directory must exist (created by `compile.sh` which clears it beforehand).
## Inputs
| File | Description |
|------|-------------|
| `src/arch/x86/boot/stub.asm` | x86 boot stub -- the kernel entry point before Pascal code takes over. |
| `src/boot/splash_tga.asm` | Embeds a TGA splash screen image as a binary blob. |
## Outputs
| File | Description |
|------|-------------|
| `lib/stub.o` | ELF object for the boot stub. |
| `lib/splash_tga.o` | ELF object for the splash screen data. |
## Behavior
1. Assembles `stub.asm` into `lib/stub.o` using NASM with the ELF output format (`-f elf`).
2. Assembles `splash_tga.asm` into `lib/splash_tga.o` using the same format.
## Notes
- Both files are assembled as 32-bit ELF objects, consistent with the i386 target architecture.
- `stub.o` is treated specially during linking: `compile_link.sh` places it first in the link order so that the boot entry point appears at the expected address.
Loaded 20 of 45 files, more files were not shown because too many files have changed in this diff. Show more