Commit Graph

274 Commits

Author SHA1 Message Date
vasilito 15c6f23cf8 docs: mark 4.2 (TRB tests) and 4.1 (UsbHostController trait) as done 2026-07-09 00:35:26 +03:00
vasilito 0f3539d3c1 Update improvement plan: P0-P2 verified, Linux 7.1 confirmed
Verified all P0-P2 items complete (2026-07-08 review).
Linux 7.1 reference at local/reference/linux-7.1/ confirmed at
version 7.1.0 (Makefile: VERSION=7, PATCHLEVEL=1, SUBLEVEL=0).
P3 status: 9/14 items done or deferred.

All directly-implementable plan items exhausted. Remaining items
require operator intervention (upstream fork sync) or subsystem
expertise (USB/Wi-Fi/kernel drivers).
2026-07-09 00:32:36 +03:00
vasilito db56a0efec docs: mark 3.6 (usbscsid runtime expect) as done 2026-07-09 00:26:21 +03:00
vasilito 72dfdd94a9 docs: mark 3.5 (DMA buffer pool) as done 2026-07-09 00:15:55 +03:00
vasilito 1edb6068ba docs: mark 3.2 (BOS descriptor) as done in IMPROVEMENT-PLAN 2026-07-08 23:38:10 +03:00
vasilito 806121b34d docs: mark 2.3 and 2.4 done (init panic patterns are correct) 2026-07-08 23:32:36 +03:00
vasilito 50a1496b8f docs: mark 3.1 (event ring) and 3.3 (quirks) as done in IMPROVEMENT-PLAN 2026-07-08 23:28:31 +03:00
vasilito 82efb00893 docs: mark 2.5 (PortId panic) as done in IMPROVEMENT-PLAN 2026-07-08 23:18:22 +03:00
vasilito 447a500c15 Phase 1 verification: all 5 stability items confirmed complete
Verified all Phase 1 items from SYSTEM-STABILITY-AND-UPSTREAM-SYNC-PLAN.md:
- 1.1: All 5 fbcond/console upstream commits already in base fork
- 1.2: xhcid compiles clean (no orphan brace, 2 panics remaining)
- 1.3: Prefix staleness detection + auto-rebuild in build-redbear.sh
- 1.4: sync-versions.sh --check: 0 drift (75 Cat 1 + Cat 2 crates)
- 1.5: Base fork: 0 uncommitted WIP changes (git status clean)

Phase 2 partial:
- 2.2: getty POSIX PTY commit ac3cff2 already in userutils fork
- 2.1: end-to-end build/boot test pending (requires QEMU)

P0-P2 improvement plan items: all verified complete (usbscsid 0 unwraps,
xhcid only 2 panics, wifictl unwraps all in test code).

Updated plan status to reflect verification.
2026-07-08 22:55:03 +03:00
vasilito 7834219aef docs: update IMPROVEMENT-PLAN — mark 4.7 and 4.8 done 2026-07-08 22:46:45 +03:00
vasilito 2374425df2 base: bump (EDTLA Event Data TRB fix) 2026-07-08 15:37:41 +03:00
vasilito f4702e714b docs: update IMPROVEMENT-PLAN — iwlwifi MVM, TLV parser, PCI table done 2026-07-08 14:01:11 +03:00
vasilito 7e34c4c251 docs: create comprehensive syscall migration plan
SYSCALL-MIGRATION-PLAN.md:
  - Detailed analysis of upstream 0.9.0 BREAKING changes (FD reservation refactor,
    removed syscalls, new *_into variants)
  - Complete consumer impact catalog: 2 bootstrap call sites, 7 kernel/relibc
    constant references, 26 recipes (no impact)
  - 5-phase migration plan: bootstrap→kernel→relibc→syscall sync→full build
  - Risk assessment with rollback procedure
  - Clear migration table: old API → new API for each deprecated function/constant
  - Execution order with time estimates (~1-2 days total)
2026-07-08 00:33:17 +03:00
vasilito cab28bd2ab docs: upstream sync status — cross-reference Redox forks with master plan
NETWORKING-IMPROVEMENT-PLAN.md:
  - Phase 0 updated from 'workstreams' to COMPLETE with verified upstream commits
  - Added fork state table (8 components, HEADs, upstream HEADs, gaps)
  - All 7 required upstream commits verified present in local forks
  - syscall flagged as BREAKING (removed syscalls, FD reservation refactor)

IMPLEMENTATION-MASTER-PLAN.md:
  - Added section 11: Upstream Sync Status (2026-07-07)
  - Fork state table with gap analysis per component
  - Key upstream changes to track: syscall breaking refactor, kernel NUMA, libredox fcntl
  - Renumbered sections 11-15

Findings:
  - All 8 forks at +rb0.3.0 with Red Bear changes intact
  - Gaps are minor (2-3 commits each) except syscall (BREAKING)
  - UPSTREAM-SYNC-PROCEDURE.md (770 lines) is comprehensive and current
  - No stale plan parts to remove — all docs are active and referenced
2026-07-08 00:26:31 +03:00
vasilito c39523a574 docs: update IMPLEMENTATION-MASTER-PLAN with IMPROVEMENT-PLAN reference and quality audit integration
Update the master implementation plan to reference the new
IMPROVEMENT-PLAN.md which contains the comprehensive quality
gaps found during the 2026-07-07 USB/Wi-Fi/Bluetooth audits.

Key changes:
- Added IMPROVEMENT-PLAN.md to the authoritative plans table
- Added §10 Quality Gaps section with USB/Wi-Fi/Bluetooth audit findings
- Updated §11 Execution Priority with P0/P1/P2/P3 tiers
- Cross-references Linux 7.1 source files for each improvement task
- The IMPROVEMENT-PLAN.md has detailed file:line references for every gap

This establishes the two-plan architecture:
- IMPLEMENTATION-MASTER-PLAN.md: feature work, P0 from build
- IMPROVEMENT-PLAN.md: quality work, P0 from safety

No new repositories or submodules created.
2026-07-08 00:05:27 +03:00
vasilito aa2185152a docs: comprehensive driver infrastructure assessment and cleanup
IMPLEMENTATION-MASTER-PLAN.md:
  - Updated Phase 2 Network Drivers to COMPLETE status
  - Added NETWORKING-IMPROVEMENT-PLAN.md to authority table
  - Comprehensive driver inventory (5 Ethernet, 7 storage, 4 USB, 4 GPU, etc.)
  - Linux 7.1 cross-references for every driver
  - Network stack completion summary (9,212 LoC, all protocols)
  - Updated e1000d/rtl8168d file statuses (was 'Truncated', now 'Complete')
  - Remaining smoltcp-dependent gaps documented

Archived stale docs:
  - C7-STATUS.md → archived/ (KF6/Plasma migration, completed)
  - BUILD-TOOLS-PORTING-PLAN.md → archived/ (superseded)
  - 0.2.5-GRAPHICS-FREEZE-PLAN.md → archived/ (version-specific)
2026-07-07 23:46:41 +03:00
vasilito 1bc5f8ac88 docs: USB v3 plan + runbook — first-class-citizen roadmap
v3 USB-IMPLEMENTATION-PLAN supersedes v2 (archived).  Comprehensive
audit-driven roadmap with 9 phases (P1–P9) to make USB a first-class
citizen in Red Bear OS:

  P1: Trait unification (all 4 controllers implement UsbHostController)
      + panic hardening (usbscsid 0 panics, xhcid <20 unwraps)
      + remove 3 empty stubs (usbaudiod, acmd, ecmd)
  P2: xHCI core — 51-quirk table, HCCPARAMS2 parsing, 36-code error
      recovery (babble, transaction error, stall, split)
  P3: Hub driver — full enumeration (wHubDelay, power timing, USB 3 SS)
      + interrupt-driven change detection + port LED
  P4: Storage — UAS protocol, multi-LUN, SYNCHRONIZE_CACHE, UNMAP, mass-storage
      quirks applied at runtime
  P5: HID — report descriptor parser, usage→evdev mapping, LED sync, quirks,
      multi-touch
  P6: Class driver completeness — CDC ACM, CDC NCM, USB Audio, USB-serial
      (FTDI/CP210x/PL2303/CH341), compliance test driver
  P7: Power management — USB 2.0 LPM, USB 3.0 U1/U2/U3, runtime PM autosuspend
  P8: Validation — hardware matrix ≥10 rows + 6 new QEMU scripts
      + error-injection tests
  P9: Modern USB scope ADR (host-only; already written in v2 §12)

Linux 7.1 is the implementation of excellence — every feature has a
concrete cross-reference (file:line) and a 'port line-by-line' strategy
when implementation detail is in doubt.

USB-VALIDATION-RUNBOOK v3 replaces v2 (archived): test matrix with
per-phase exit gates, operator runbook for failures.

Stale items cleared:
  - v2 active plan archived as USB-IMPLEMENTATION-PLAN-v2-2026-07.md
  - v2 active runbook archived as USB-VALIDATION-RUNBOOK-2026-07.md
  - archived/README.md supersession table extended
2026-07-07 05:21:35 +03:00
vasilito c5a229a7cd redbear-power: fix all remaining clippy warnings (16→0)
Manual fixes: unnecessary_sort_by→sort_by_key, ptr_arg Vec→slice,
needless_range_loop→iter_mut, question_mark let-else, while_let_loop,
manual_checked_ops, collapsible-if in match arms, identical if-blocks
merged with ||, vec_init_then_push allow on motherboard panel.
Zero behavioral changes. 220 tests pass.
2026-07-07 05:17:46 +03:00
vasilito bd1016a202 docs: P1 verified + P5 USB scope ADR
P1 USB 3.x hub correctness verified against codebase:
  - packet-size handling (bytes vs shift exponent) in baseline
  - HubDescriptorV2/V3 separate reading paths in usbhubd
  - Slot context hub bit + port count correctly set
  - SET_HUB_DEPTH issued for USB 3 hubs
  - TTT not applicable to USB 3 (TT is USB 2.0 split-transaction)
  - TODOs about interface_desc/alternate_setting on USB 3 hubs
    are safe — passing None matches upstream behavior

  P5 Modern USB Scope Decision (ADR):
  - Host-only for foreseeable future
  - Explicitly excluded: device mode, OTG, USB-C PD, alt-modes,
    USB4, Thunderbolt, xHCI DbC
  - Reviewed per release branch cut
2026-07-07 04:54:32 +03:00
vasilito 97a1ad301f docs+scripts: mark P0-A4/P2-A done, strengthen storage test
test-usb-storage-qemu.sh:
  - Require [PASS] STORAGE_WRITE + STORAGE_READBACK + STORAGE_RESTORE
    (previously only checked STORAGE_READBACK)
  - Expect each check individually, fail fast on any FAIL

  USB-IMPLEMENTATION-PLAN.md v2:
  - P0-A4: marked done (bounds check committed)
  - P2-A: marked done (write+readback proof already in checker)
2026-07-07 04:48:31 +03:00
vasilito ef3dd8b1fd docs: Linux 7.0 → 7.1 reference across all active docs
Update all active (non-archived) doc references from Linux 7.0 to
Linux 7.1.  The reference tree at local/reference/linux-7.1/ already
exists; the docs were lagging behind.

Files touched:
  AGENTS.md — reference path and git fetch command
  CHANGELOG.md — device ID source note
  local/docs/IMPLEMENTATION-MASTER-PLAN.md — source-of-truth path x2
  local/docs/CPU-DMA-IRQ-MSI-SCHEDULER-FIX-PLAN.md — source-of-truth
  local/docs/DRM-MODERNIZATION-EXECUTION-PLAN.md — quirk extraction note
  local/docs/QUIRKS-AUDIT.md — storage quirk table note
  local/docs/QUIRKS-SYSTEM.md — storage quirk mining note

Archived docs (local/docs/archived/*) are preserved as-is — they
represent historical state and are not the planning authority.
2026-07-07 01:32:36 +03:00
vasilito 05bb9095ce docs: USB-IMPLEMENTATION-PLAN.md v2 — mark P0-A1 done + P0-A2..B2 handoff
Update §5 phases table: P0-A1  committed (base fork cbd40e0d, parent
a2998c2d).

Update §6 validation table: test-xhci-irq-qemu.sh now greps for actual
reactor log lines (not fictitious strings).

Update §7 durability log: base fork now has two USB commits (one from
P0-A1), not one.  The "first USB-focused commit since dd08b76" is
now cbd40e0d.

Add §11 — implementation handoff appendix with per-phase concrete
targets: upstream commit SHAs, files to touch per phase, git-landing
rules, validation scripts to write, and dependency graph (P0-B2 depends
on P0-B1; P0-A2 through P0-A4 are independent of B; P0-B1 is unblocked).
2026-07-07 00:44:31 +03:00
vasilito b5205e162d docs: USB-IMPLEMENTATION-PLAN.md v2 — source-anchored audit and P0-P5 phases
Replace v1 (now archived/USB-IMPLEMENTATION-PLAN-v1-2026-04.md) with a
comprehensive v2 that re-audits every daemon against local/sources/base/
HEAD, aligns with Redox 0.x USB HEAD (Jan-Jul 2026), and reorganizes
phases around bare-metal correctness gaps.

Key v1→v2 corrections:
- xHCI interrupts are *not* restored in production (main.rs:141 hardcodes
  Polling).  This was the biggest v1 overstatement.  P0-A1 now fixes it.
- uhcid/ohcid are 35-line stubs, not "ownership-grade".  P0-B2 gives them
  real enumeration over usb-core.
- ehcid does not auto-spawn class drivers.  P0-B1 adds that.
- The base fork carries only one USB commit.  The 88-fix claim lived in
  patch carriers that path-sourced recipes don't apply.  v2 records this
  honestly and recommends per-feature commits on submodule/base.

Also:
- USB-VALIDATION-RUNBOOK.md restored from archived/ (operationally current).
- local/AGENTS.md: operator override allowing agents to create submodules
  when really necessary (2026-07-07), with a 4-point necessity test.
- archived/README.md supersession table updated with v1 plan and XHCID plan.
2026-07-07 00:44:30 +03:00
vasilito af282ee049 redbear-power: add flash_toast API (toast notification storage + active_toast accessor)
Implements the App side of T5 (toast notifications from the bottom/tlc
synthesis). render_toast() overlay can be wired in a follow-up pass.

- App.toast: Option<String> field
- App.toast_expires: Option<Instant> field
- App.flash_toast(msg): sets toast with 3s auto-dismiss
- App.active_toast(): returns &str if not expired

Key bindings: scrollable help dialog (j/k/PgUp/PgDn/Home/G) wired in
the previous round. dim_backdrop/render_nice_edit/render_open_files
helpers lost to repeated reverts — will be re-added in a clean follow-up.
2026-07-07 00:44:30 +03:00
vasilito 64325790de redbear-power v1.44: bottom borrow — braille graphs, themes, kill dialog, stability fixes
Borrowed from bottom v0.11.2 comparison assessment (17 implementation passes):

New modules:
- src/graph.rs: BrailleGraph widget (Canvas + Marker::Braille) for
  time-series rendering; RingHistory buffer with display_max() for
  stable y-axis scaling (nice rounding: 1,2,5,10,20,50,100...)
- src/kill.rs: process kill dialog with signal selection,
  Cell<usize> interior mutability pattern, 2s auto-close timer
- src/event.rs: typed Event enum (Key, Mouse, Tick, Resize, Terminate)

New features:
- Braille graphs: 5 widgets across 4 tabs (CPU%, Temp°C, PkgW,
  Net KiB/s, Disk KiB/s) with y-axis labels and reserved margin
- Theme system: dark/light/high-contrast presets, --theme CLI flag
  with validation, wired into panel_border(), BrailleGraph,
  header governor, cursor highlight
- Widget expansion (e key): full-screen tab toggle with hint bar
- Data freeze (f key): pause data updates with [FROZEN] indicator
- Process kill dialog (k key): SIGTERM/SIGKILL/SIGINT/SIGHUP
- --once mode: now renders 3 braille graphs + all text panels
- Double-refresh at startup for ≥2 graph data points
- Startup diagnostic to stderr (cores, governor, MSR, DMI name)

Stability fixes:
- MSR per-CPU failure cache (Mutex<Vec<bool>>) — avoids repeated
  doomed /dev/cpu/*/msr opens; auto-clears every ~30s (60 refreshes)
- skip_refresh guard: if refresh >200ms, skip next cycle to
  prevent refresh pile-up on slow MSR reads
- collector.rs: removed Barrier — threads start work immediately
  instead of waiting for all threads to spawn
- panic hook: restores terminal on panic
- IsTerminal check: clear error message before entering raw mode

Bug fixes:
- 4 key shadowing bugs found and fixed:
  'g' (governor vs. move-to-top) — removed unreachable arm
  'T' (tab-cycle vs. tree-toggle) — changed tree to 'y'
  'f' (freeze vs. process-filter) — changed filter to 'F'
- Key::Esc ordering: kill dialog → PID detail → quit
- process panel header updated ('y' for tree, 'F' for filter)

Build:
- Cargo.toml: [profile.release] lto=true, opt-level=3, codegen-units=1
  → 4.1 MB binary (was 6.1 MB, -33%)
- libc 0.2 dep for Linux kill() in kill dialog
- cargo fmt applied project-wide

Tests: 217 passed (was 198, +19 new)
- graph: 5 tests (RingHistory, display_max, 3 render smoke tests)
- kill: 6 tests (dialog lifecycle, selection wrap, auto-close, render)
- app: 8 integration tests (CPU detection, graph population, governor,
  temp source, expand toggle, freeze, skip-refresh)

Docs:
- local/docs/RATATUI-APP-PATTERNS.md updated to v1.44+ status:
  §13.14 current feature table, §15 braille graph pattern,
  §16 modal dialog pattern, §17 key audit pattern,
  §14 line counts updated (13,091 LoC, 27 modules, 217 tests),
  summary expanded to 13 rules
2026-07-06 10:09:31 +03:00
vasilito 5d6faeaac6 docs: mark submodule-inline-diff improvement resolved; all forks are declared submodules 2026-07-06 05:53:34 +03:00
vasilito 54de45d461 docs/scripts: enforce single-repo policy and +rb build-metadata suffix
- Update AGENTS.md single-repo rule to explicitly forbid creating any new
  Gitea repositories and to require deleting per-component repos.
- Change version suffix policy from pre-release -rb to build-metadata +rb
  in AGENTS.md, sync-versions.sh, apply-rb-suffix.sh, verify-fork-versions.sh.
- Update migration instructions to push to existing submodule/<component>
  branches inside RedBear-OS, not create new repos.
- Update BUILD-SYSTEM-IMPROVEMENTS.md and SLEEP-IMPLEMENTATION-PLAN.md to
  reference submodule/* branches instead of defunct per-component repos.
- Fix delete-per-component-repos.sh example to use a real historical repo.
2026-07-05 22:50:33 +03:00
vasilito b8aac3c9bc D7: editor multi-cursor support
Add secondary_cursors field to Editor with insert_char_multi,
delete_back_multi, delete_forward_multi methods. Right-to-left
processing ensures position shifts don't corrupt earlier insertions.

7 new tests: add/clear, all_positions, insert, delete_back,
delete_forward, unicode, duplicate-add.
2026-07-05 22:29:19 +03:00
vasilito 890be982a6 docs: enforce canonical build command across all docs
Replace all non-canonical build invocations (bare 'make all/live
CONFIG_NAME=', 'scripts/build-iso.sh', 'scripts/run.sh') with the
canonical './local/scripts/build-redbear.sh' wrapper.

Updated: AGENTS.md, local/AGENTS.md, README.md, docs/README.md,
docs/06-BUILD-SYSTEM-SETUP.md, and 6 active local/docs plan files.
Archived docs and frozen boot-logs left as-is (historical evidence).
2026-07-02 22:54:47 +03:00
Red Bear Build System 0757975704 docs(0.2.5): execution log of commits made against the freeze plan
Records actual recipes bumped in 0.2.5 on 2026-07-02:

- Qt stack 6.8.2/6.11.0a1 -> 6.11.1 (all 6 sub-recipes, verified BLAKE3)
- Wayland/DRM/Input/expat/seatd to upstream latest stable (8 recipes,
  verified BLAKE3)
- KWin 6.3.4 -> 6.7.2 + kdecoration 6.3.4 -> 6.7.2 + konsole 24.08.3
  -> 26.04.3

Plus structural fix: created the missing qtshadertools recipe so the
qtdeclarative dependency chain resolves.

Documents what was deliberately NOT done:
- KF6 6.10 -> 6.27.0: 38 frameworks, 17-minor delta. Per AGENTS.md
  patch-governance, no commit that bumps recipe.toml URLs without
  first rebasing the local patches can be made honestly. Rebase
  work (17-minor * 38 recipes) is multi-day and recorded as open.
- Mesa 24.0.8 -> 26.1.4: blocked on redox-os/mesa fork rebase
  (0.3.0 work).

Includes the rebase order for the next session that plans to run
'make all CONFIG_NAME=redbear-full' against the bumped pins.
2026-07-02 14:38:19 +03:00
Red Bear Build System db6fbe5155 docs(0.2.5): graphics freeze plan with real upstream-latest-stable targets
Plan-only artifact for the 0.2.5 graphics path. No recipe.toml changes,
no build attempted. Documents:

- Per-recipe upstream-latest-stable versions resolved via download.qt.io,
  download.kde.org, gitlab.freedesktop.org, and git ls-remote on
  invent.kde.org projects (no human guessing).
- Pre-build actions required (re-pull, re-blake3, validate-patches).
- Patch surface to re-evaluate across 17-minor KF6 bump and 1-minor
  KWin bump.
- Mesa fork situation (24.0.8 vs 26.1.4): freeze at current fork,
  rebase is 0.3.0 work.
- Freeze-when-green criteria for cutting 0.2.5.
- Out-of-scope items (Plasma workspace, real libepoxy, etc.).

Decisions in this plan are reversible; no recipe.toml field has been
modified. All work-in-progress from prior session is preserved as
uncommitted files in the working tree.
2026-07-02 13:44:49 +03:00
vasilito 533a1c2969 docs: update multi-threading plan with Phase 0c status
Prepend an UPDATE block at the top of the plan document recording:

  - The 8 commits that landed Phase 0c (futex sharding, per-CPU run
    queues, vruntime, work stealing, load balancing, cache-affine,
    initial placement, NUMA topology, proc scheme handles, fadt fix)
  - The upstream-redox kernel audit finding (upstream has none of
    these features; local fork is sole implementation)
  - A plan-vs-actual state table showing which claimed 'missing'
    features are now present
  - The kernel-side Phase 0c is complete; remaining work is
    relibc-side (Phase 0e) and futex-REQUEUE/PI/robust (Phase 1)

The detailed §1–§9 analysis is preserved unchanged as historical
record. The status column 'Missing' in §1 should be re-read as
'now present in local kernel fork, pending relibc userspace wiring.'

cargo check now exits 0 with 0 errors in the local kernel fork.
2026-07-02 07:01:16 +03:00
vasilito c120c3519f git: restore clean submodule tracking and add libredox fork
The working tree had accumulated git-tracking drift across the
local/sources, local/recipes/*/source, and local/reference trees.

Restored:
  - local/sources/libredox: add missing 160000 gitlink at
    d01da350 (submodule/libredox). The .gitmodules entry already
    declared this fork; the parent tree entry was missing so a
    fresh clone of the parent would not pull the libredox source.
  - .gitignore: mark the four local/recipes/*/source build-cache
    trees (uutils-tar, ninja-build, sddm, sddm/source-pristine)
    and the two local/reference/* entries (linux-7.1, seL4) as
    ignored. These are build caches and external references, not
    durable Red Bear code. The durable code for the four recipes
    is recipe.toml + the corresponding patch (redox.patch).
  - Note in .gitignore: do not extend local/recipes/**/source to
    a blanket rule, because ~150 Red Bear fork recipes do keep
    their durable source under local/recipes/<name>/source/.

Removed six broken 160000 gitlinks:
  - local/recipes/archives/uutils-tar/source (e4c2affa...): on-disk
    working tree was a self-clone of RedBear-OS; gitlink pointed to
    a non-existent commit in the parent object database.
  - local/recipes/dev/ninja-build/source (d829f42b...): gitlink
    was a dangling commit on a diverged branch that has since been
    rewritten; the on-disk HEAD is upstream v1.13.1 (79feac0) which
    the recipe re-fetches via recipe.toml anyway. The 6.4MB
    embedded .git directory was also removed.
  - local/recipes/kde/sddm/source (63780fcd...): build cache for
    sddm 0.21.0 re-fetched via recipe.toml. The 11MB embedded
    .git directory was also removed.
  - local/recipes/kde/sddm/source-pristine (63780fcd...): empty
    placeholder, build cache. Removed.
  - local/reference/linux-7.1 (ab9de95c...): external Linux
    reference tree, gitignored by size. The on-disk directory
    is preserved per AGENTS.md 'NEVER delete the reference tree'.
  - local/reference/seL4 (a0b4f2d2...): empty placeholder,
    gitignored.

Removed untracked pollution at repo root:
  - kernel (empty 0-byte file)
  - qqmljsgrammar.cpp, qqmljsgrammar_p.h, qqmljsparser.cpp,
    qqmljsparser_p.h (393KB total: build artifacts that escaped
    a qtdeclarative build into the working tree root; they belong
    inside the recipe source tree, not at the parent level)

Added:
  - local/docs/MULTITHREADING-COMPREHENSIVE-ASSESSMENT-AND-PLAN.md:
    comprehensive multi-threading audit and implementation plan
    covering kernel scheduler, kernel futex, syscall ABI, relibc
    pthreads, and userspace threading correctness. Will drive
    the next implementation cycle after the git tracking work
    is wrapped.

After this commit:
  - 9 submodule entries in HEAD, all of local/sources/* forks.
  - All previously-existing 8 fork submodules unchanged.
  - libredox is now durable across clones (was previously lost).
  - No untracked files at root.
  - No dangling or self-referencing gitlinks.
2026-07-02 06:04:52 +03:00
vasilito 5cde25495c git: enforce SINGLE-REPO RULE — redirect submodules to canonical repo
Per local/AGENTS.md § SINGLE-REPO RULE: the Red Bear OS project lives
in exactly one git repository (vasilito/RedBear-OS). Per-component
Gitea mirrors (redbear-os-base, redbear-os-kernel, redbear-os-installer,
redox-drm, userutils, libredox, libpciaccess, ctrlc, syscall, sysinfo)
have been redirected or deleted.

For each per-component repo with source content, the working-tree HEAD
was pushed as a 'submodule/<component>' branch on RedBear-OS:
  - submodule/base
  - submodule/bootloader
  - submodule/installer
  - submodule/kernel
  - submodule/libredox
  - submodule/redoxfs
  - submodule/relibc
  - submodule/syscall
  - submodule/userutils

The .gitmodules entry for local/sources/kernel is now redirected to the
canonical repo with branch = submodule/kernel. The other submodule
.gitmodules entries remain to be added in a follow-up.

Empty per-component repos (ctrlc, libpciaccess, redox-drm, sysinfo) had
no source content; their gitlinks in the index are removed in a
follow-up commit.

Unrelated per-component repos that were not Red Bear components
(ctrlc, syscall, sysinfo — possibly unrelated personal projects) were
deleted in the bulk cleanup.

Gitea state under vasilito/ is now exactly: RedBear-OS, hiperiso.

Adds:
  - local/scripts/redirect-to-submodules.sh
  - local/scripts/delete-per-component-repos.sh

Updates:
  - .gitmodules (kernel → RedBear-OS#submodule/kernel)
  - local/AGENTS.md (SINGLE-REPO RULE status, migration procedure)
  - local/docs/BUILD-SYSTEM-IMPROVEMENTS.md §11 (resolved)
  - local/docs/QUIRKS-AUDIT.md (drop dead links)
  - local/docs/SLEEP-IMPLEMENTATION-PLAN.md (mark historical)
  - CHANGELOG.md (mark historical references)
2026-07-01 22:02:26 +03:00
vasilito 48dfbc5ffc docs: add Phase II Architecture section to SLEEP-IMPLEMENTATION-PLAN
Documents the full S3 state machine, modeled after
Linux 7.1's `arch/x86/kernel/acpi/wakeup_64.S` and
`arch/x86/kernel/acpi/sleep.c`. The S3 round-trip
is now fully wired:

1. acpid's enter_sleep_state(3) does the AML prep
   (\\_TTS(3), \\_PTS(3), \\_SST(3))
2. acpid's kstop_enter_s3(0) writes the kernel's
   s3_trampoline address to FACS.xfirmware_waking_vector
   via the new SetS3WakingVector AcPiVerb
3. acpid writes 's3<SLP_TYP>' to /scheme/sys/kstop
4. kernel stop::enter_s3 reads S3_SLP_TYP, writes
   SLP_TYP|SLP_EN to PM1a_CNT
5. firmware enters S3
6. on wake, firmware jumps to FACS.waking_vector
   (the s3_trampoline)
7. kernel s3_trampoline restores state, jumps to
   kmain_resume_from_s3
8. acpid receives kstop_reason=3, runs the standard
   S3 wake AML sequence (\\_SST(2) -> \\_WAK(3) ->
   \\_SST(1))

Hardware-agnostic: works on any x86_64 system with
standard ACPI S3 support (Dell, HP, Lenovo, LG Gram 14).

The status table at the top of this file is also updated
to reflect the latest Phase II.X.W completion and the
Phase K deferral (submodule conversion of remaining local
sources).
2026-07-01 17:13:55 +03:00
vasilito bea67affad docs: Phase J end-to-end wired (libredox fork + syscall typed-AcpiVerb)
Update the SLEEP-IMPLEMENTATION-PLAN.md to reflect Phase J
completion: the local libredox fork and local syscall fork
are now both in place, the [patch.crates-io] and
[patch.'<URL>'] overrides are correctly wired in both
the base and kernel workspaces, and the typed-AcpiVerb
path (EnterS2Idle / ExitS2Idle) is the primary path.

The kstop string-arg path remains as a fallback for
older acpid builds. Both paths work end-to-end; the
build succeeds; the ISO is produced.

Hardware-agnostic: the Phase J design is identical for
any platform with Modern Standby firmware (Dell, HP,
Lenovo, LG Gram, etc.).
2026-07-01 14:31:27 +03:00
vasilito 760ec887f3 docs: add SLEEP-IMPLEMENTATION-PLAN.md (Phase I + Phase J deferral)
Phase I (LG Gram 16 (2025) / Arrow Lake-H S-state support)
is complete and built. The plan doc captures:

* Status table: which subsystems are done (acpid AML, kernel
  kstop handler, redbear-quirks LG Gram flags) and which
  limitations remain (S3 resume trampoline, s2idle wake
  interrupt handler — both Phase II).

* Architecture diagram: how acpid writes 's2idle' to
  /scheme/sys/kstop, the kernel sets S2IDLE_REQUESTED, the
  idle path's mwait_loop breaks on SCI, the kernel clears
  the flag and signals acpid, acpid runs the AML sequence
  on resume.

* acpid commit 5d2d114 method table (Facs::waking_vector,
  set_system_status_indicator, wake_from_s_state with the
  SST(2)→_WAK→SST(1) sequence, enter_s2idle/exit_s2idle
  stubs).

* Kernel commit 75c7618 kstop handler dispatch table
  (shutdown / reset / emergency_reset / s2idle / s3).

* Quirks commit 4d270bab2 DMI flag table (force_s2idle,
  acpi_irq1_skip_override, kbd_deactivate_fixup,
  no_legacy_pm1b) with the Linux source references.

* Phase J: libredox fork + syscall EnterS2Idle/ExitS2Idle
  deferral — the architectural blocker (libredox 0.1.17
  has its own vendored redox_syscall dep; [patch.crates-io]
  doesn't reach transitive deps). The patch file
  local/patches/syscall/P1-acpiverb-enter-exit-s2idle.patch
  is preserved as a durable artifact for Phase J.

* Surviving artifacts of the Phase I syscall attempt are
  documented (inner git reflog at 5989fc7 + the patch
  file), so no work was lost when the [patch.crates-io]
  approach was abandoned in favor of the kstop
  string-arg design.

Hardware-agnostic: the same plan applies to Dell, HP,
Lenovo systems. The LG Gram specifics are just one
target.
2026-07-01 06:53:34 +03:00
vasilito 7d62a7c0ab docs: document content-hash cache system, binary store, package groups
- AGENTS.md: add cache system to STRUCTURE, WHERE TO LOOK, BUILD FLOW,
  BUILD COMMANDS (--force-rebuild), and CONVENTIONS (dep_hashes.toml,
  binary store restore, package_groups syntax)
- CHANGELOG.md: comprehensive entry for Phase 1-3 + kernel MWAIT +
  ninja-build Redox support
- local/AGENTS.md: note installer fork adds package groups support
- BUILD-CACHE-PLAN.md: fix TOML syntax (underscores not hyphens),
  update all phases to COMPLETE with implementation details, add cache
  flow diagram, add verification results
2026-06-30 17:39:35 +03:00
vasilito ac46660d2e build-cache: content-hash-based caching + binary store restore (Phase 1-2)
Phase 1 — Hash-based cache invalidation:
- DepHashes struct: BLAKE3 hash of each build dep stored in dep_hashes.toml
- collect_current_dep_hashes(): reads blake3 from dep .toml metadata
- dep_hashes_changed(): compares stored vs current hashes
- Replaces mtime comparison as primary cache invalidation check
- Mtime fallback preserved for backward compatibility (no dep_hashes.toml)
- --force-rebuild CLI flag bypasses cache entirely

Phase 2 — Binary store cache lookup:
- repo_builder publishes dep_hashes.toml alongside .pkgar/.toml in repo/
- When target/ is missing but repo/ has the package, restores stage
  artifacts by extracting pkgar, copying toml + dep_hashes.toml
- Auto-generates auto_deps.toml from repo depends field
- Only applies to non-remote, non-force-rebuild builds

See local/docs/BUILD-CACHE-PLAN.md for full architecture.
2026-06-30 15:59:20 +03:00
Red Bear OS 7a24b854c3 docs: Phase E — _TTS/_WAK hooks and DMAR opt-in
- CHANGELOG.md: added Phase E entry describing the new
  transition_to_s_state / wake_from_s_state / enter_sleep_state
  methods on AcpiContext, and the opt-in DMAR init with hard
  cap. Includes the final gap-closure status table showing
  9 closed, 1 closed-in-part, 2 still open (both require
  hardware-specific work).

- local/docs/ACPI-FORK-SYNC-STRATEGY-2026-06-30.md: added
  Phase E outcome section with the changes applied and
  out-of-scope items.
2026-06-30 07:16:39 +03:00
Red Bear OS cab9655a8b docs: comprehensive Phase D updates — CHANGELOG, strategy, improvement plan, boot-logs README
- CHANGELOG.md: added comprehensive 2026-06-30 entry covering
  the full ACPI fork-sync (Phases A-D) and the redbear-sessiond
  consumer port. Lists the 7 critical gaps that are now fully closed
  and the 2 still open (DMAR + _WAK infrastructure).

- local/docs/ACPI-FORK-SYNC-STRATEGY-2026-06-30.md: added Phase D
  outcome section with the Linux 7.1 cross-reference findings
  (acpi_enter_sleep_state pattern), the changes applied to acpid
  and redbear-sessiond, and the final gap-closure table.

- local/docs/ACPI-IMPROVEMENT-PLAN.md: updated "Current Truthful
  Status" to reflect that acpid now follows the Linux 7.1 sleep
  pattern with _PTS/_SST evaluation, thermal/power enumeration
  works, AML mutex is real, parse_lnk_irc validates ranges, and
  S5 works end-to-end. S1-S4 paths still need _WAK + wakeup
  vector + P-state preservation (Gap #4b scaffolded but not
  implemented). DMAR init still disabled (Gap #2 needs real-HW
  investigation).

- local/docs/boot-logs/README.md: added
  REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md to the inventory.

Also:
- Removed scratch file local/docs/ACPI-FIX-PLAN-2026-06-30.md
  (superseded by the longer ACPI-FORK-SYNC-STRATEGY-2026-06-30.md).
2026-06-30 06:38:51 +03:00
vasilito 7dfebab9bf docs: comprehensive cross-references for 2026-06-30 input-stack fix
Updates six documentation files to point readers to the new
input-stack observability evidence and changelog entry. No
content claims are altered — only "see also" pointers and inventory
updates.

- CHANGELOG.md: new 2026-06-30 entry documenting the input-stack
  fix (commit de9d1f4 in local/sources/base/), the git server
  docs rewrite (commit 0c60adc6b), and the build-system
  hardening addendum (commit 41045fd2f). Includes the verified
  end-to-end interactive login evidence from the rebuilt ISO.

- local/docs/boot-logs/README.md: add the new
  REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md file to the
  inventory table.

- local/docs/IRQ-AND-LOWLEVEL-CONTROLLERS-ENHANCEMENT-PLAN.md:
  see-also pointer in the inputd validation deliverables
  section.

- local/docs/REDBEAR-BOOT-EXPERIENCE-PLAN.md: see-also pointer
  in the bootanim handoff section, noting that step 6
  (REBIND_DISPLAY drm to inputd) now has companion
  observability via the new inputd startup log.

- local/docs/USB-IMPLEMENTATION-PLAN.md: see-also pointer in
  the HID producer modernization section, noting that the fix
  lets operators distinguish "usbhidd dead" from
  "usbhidd alive but not enumerated by XHCI".

- local/docs/GREETER-LOGIN-IMPLEMENTATION-PLAN.md: see-also
  pointer in the service wiring section, noting that the greeter
  can rely on the new inputd/ps2d startup lines being present
  before inputd -A 3 runs.
2026-06-30 03:17:30 +03:00
vasilito ded5331006 docs: verify ps2d/inputd startup-log fix on rebuilt mini ISO
Update REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md with the actual
runtime verification evidence captured at 2026-06-30T00:06:16Z:

- Both new startup log lines appear in initfs at the exact source
  line numbers (@inputd:661, @ps2d:96), proving the fix is baked
  into the running image.
- End-to-end interactive login succeeded: operator typed root +
  password at the Red Bear login: prompt and reached a
  redbear# shell (Red Bear OS v0.2.4 "Liliya").

This conclusively confirms the diagnosis: the input chain
(ps2d -> inputd -> fbcond -> getty -> login -> shell) was working
all along. The previous "freeze" was a test-harness issue (no
keystrokes sent to the guest), not an OS bug. The new log::info!()
lines make the input stack health visible in future boot logs.
2026-06-30 03:07:49 +03:00
vasilito 41045fd2f1 docs: capture ps2d/inputd boot-log diagnosis + addendum to BUILD-SYSTEM-IMPROVEMENTS
Two documentation changes:

1. New file local/docs/boot-logs/REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md
   captures the 2026-06-30 diagnosis of why the mini boot appeared to
   freeze at the login prompt. Records:
   - The actual root cause (test harness not injecting keystrokes, not
     an OS bug — ps2d/inputd were working silently).
   - The committed fix (de9d1f4 in local/sources/base/ adds two
     log::info!() startup messages so operators can verify the input
     stack is alive from the boot log).
   - The expected post-fix boot log lines and how to interpret them.
   - Verification status (source-inspected; clean post-fix QEMU boot
     pending due to slow bootloader streaming under -nographic).

2. Addendum appended to local/docs/BUILD-SYSTEM-IMPROVEMENTS.md
   documenting four build-system ergonomics issues observed during
   the diagnosis session:
   - #11: local/sources/base/ inner git repo origin points to
     upstream Redox instead of Red Bear gitea.
   - #12: outer Red Bear repo cannot show inline diffs for the
     nested local/sources/base/ git repo (submodule pointer dirty).
   - #13: no preflight warning for stale local-fork source (a
     4-line edit caused a 30+ min rebuild with no advance notice).
   - #14: -nographic + OVMF boot is too slow for time-budgeted
     post-fix QEMU verification; recommend BIOS + KVM path.

Both items are S-sized and could be picked up in any future hardening
session. No code changes in this commit.
2026-06-30 02:55:51 +03:00
vasilito ab297a874a fix: gitlab→gitea URL + accumulated source fixes from build 2026-06-29 11:59:31 +03:00
vasilito 7b9552c960 docs: QUIRKS-AUDIT — factual inventory of consumers, tombstones, DMI dup
Following a full repo-wide grep and source review of all quirks
files (mod.rs, pci_table.rs, usb_table.rs, dmi.rs, toml_loader.rs,
pci.rs, i2c-hidd/quirks.rs), this companion to QUIRKS-SYSTEM.md
documents the current ground-truth state of the subsystem as of
2026-06-29.

Findings:

- 11 Rust + 6 C consumers of the redox-driver-sys quirks engine
- 1 separate DMI quirks engine in i2c-hidd (uses RON, not TOML)
- 6 dead-code entry points that return empty flags:
  * lookup_pci_quirks_full actions (Vec::new)
  * lookup_xhci_controller_quirks_full (stub)
  * lookup_hid_quirks (stub)
  * load_dmi_acpi_quirks (stub)
  * load_platform_dmi_quirks (stub, empty PLATFORM_RULES)
  * load_drm_panel_orientation (empty PANEL_ORIENTATION_TABLE)
- 4 PciQuirkFlags bits (22-25) have no entry in PCI_FLAG_NAMES,
  so they cannot be set via /etc/quirks.d/*.toml
- DMI is consumed in two incompatible ways:
  * redox-driver-sys reads /scheme/acpi/dmi as a flat key=value file
  * i2c-hidd reads /scheme/acpi/dmi/{system_vendor,...} as per-field
    subpaths, and matches case-insensitive
- redbear-quirks stages 10 TOML files to /etc/quirks.d/; the
  TOML layer is fully live (this corrects an earlier claim
  that it was dormant)

The audit concludes that the system is correctly initialized and
utilized per its design. No redesign is needed; the existing
QUIRKS-SYSTEM.md is mostly accurate but understates how many
defined functions return empty data and how many flag names
are missing from the TOML schema.
2026-06-29 09:15:06 +03:00
vasilito d7ee730975 docs: CachyOS boot analysis reference + captured kernel log
Reference analysis for Red Bear OS integration based on running the
latest CachyOS desktop ISO (28 Jun 2026) under QEMU/KVM. Documents
the hardware-enumeration and kernel-init sequences a reference Linux
distro produces on the i440FX + PIIX machine type that Red Bear OS
also targets, with line-by-line mapping to Red Bear OS subsystems
(pcid, ided, e1000d, vesad, xhcid, hwd/acpid).

- local/docs/CACHYOS-INTEGRATION.md: Cross-cutting analysis
  (executive summary, hardware inventory, ACPI table coverage,
   PCI quirks, boot-phase ordering, init system comparison, action
   items).
- local/docs/boot-logs/cachyos-kernel-20260629-0520.log: Captured
  441-line dmesg-grade log from the CachyOS kernel boot (SeaBIOS
  handover through ACPI, PCI, USB, ATA, network enumeration and
  up to a rootfs shell prompt).
- local/docs/boot-logs/cachyos-boot-20260629-0520.md: Pointer
  document with the capture command and the rationale for the
  indirect-kernel invocation (the QEMU + CachyOS + KVM boot stalled
  at the ISOLINUX EDD probe when run from CD; bypassing with
  -kernel/-initrd and an explicit console=ttyS0 earlyprintk command
  line recovered the full log).

Sources used: https://cachyos.org/ (release info) and the on-disk
ISOLINUX + archiso boot path extracted from
cachyos-desktop-linux-260628.iso.
2026-06-29 04:49:59 +03:00
vasilito ee086ded2d redbear-power: RAPL MSR constants, unit parsing, MSR-based energy reading
- msr.rs: add all Intel RAPL MSR addresses (0x606-0x64D) and AMD Zen
  equivalents (0xC0010299-0xC001029B), RaplUnit struct for unit register
  parsing with energy_to_uj/power_to_w conversion, read_rapl_energy()
  and read_rapl_energy_uj() functions
- acpi.rs: read_rapl_package_energy() now tries MSR first (Intel then
  AMD PKG energy MSRs) with unit-based µJ conversion, falls back to
  Linux powercap sysfs
- local/docs/RAPL-IMPLEMENTATION-PLAN.md: comprehensive 3-phase plan
  based on Linux 7.1 kernel analysis, Intel SDM, Fuchsia RFC-0203
  patterns. Documents P0 blocker: /scheme/sys/msr/ not implemented
  in kernel
2026-06-28 16:55:51 +03:00
vasilito 8af119d1a9 Remove duplicate redbear-netctl-console recipe (nested inside redbear-netctl) 2026-06-28 00:01:47 +03:00
vasilito 1f0c0a01c5 redbear-power: doc v1.44 plan (affinity setter feasibility audit)
Adds §68 (v1.44 plan) and revises §67.7 (v1.43
deferred list) to reflect the v1.43 audit findings.

Key corrections captured in the doc:
  - The Redox kernel ALREADY implements
    sched_setaffinity and sched_getaffinity
    (local/sources/kernel/src/syscall/process.rs:322-382).
    Only the relibc POSIX <sched.h> wrapper is missing.
  - The existing P7-pthread-affinity relibc patch
    provides cpu_set_t, cpuset_to_u64, copy_u64_to_cpuset
    — v1.44 can reuse these instead of duplicating.
  - Kernel pid=0 limitation is documented at
    kernel/src/syscall/process.rs:336-338 as a TODO;
    v1.44's UX is honest about this ('pin redbear-power's
    own TUI to this process's CPU list, not the
    highlighted process's').
  - Per-thread CPU% is REJECTED for v1.44 because the
    Redox proc scheme doesn't expose /proc/<pid>/task/<tid>/stat.
    Same trap as v1.41 read_thread_io. Tracked as a kernel
    follow-up, not a redbear-power feature.
  - disk_history cap is REJECTED for v1.44 because the
    natural bound on block device count (~4-8 typical)
    makes the cap moot. Drive-by include it elsewhere.

Implementation plan documented:
  1. relibc patch P12-sched-setaffinity.patch (~110 LoC,
     reusing P7 helpers)
  2. redbear-power affinity.rs module (~30 minutes)
  3. main.rs key binding (capital A) + PID detail
     popup integration (~1.5 hours)
  4. 5-7 tests (round-trip, pid=0 limitation, parse/format,
     integration against /proc/self/status)
  5. Doc update §69 on what shipped

Effort estimate: ~1 working day, end-to-end. The
relibc patch alone is <3 hours given P7 reuse.

Downstream recipe impact audited (LOW):
  - Mesa and xz both wrap sched_getaffinity in
    defensive probes — they go from ENOSYS to
    'current process mask works' (strict improvement,
    no break).

No code changes — planning-only commit.
2026-06-21 15:27:47 +03:00