Commit Graph

370 Commits

Author SHA1 Message Date
vasilito 4f5b35bb62 QUIRKS-SYSTEM: mark R11 (ACPI DMI rules) RESOLVED
R11 lands in two commits this session:

  - 5d06b0fa0 (redox-driver-sys): AcpiQuirkFlags (13 bits),
    DmiAcpiQuirkRule, DMI_ACPI_QUIRK_RULES,
    load_dmi_acpi_quirks, apply_dmi_acpi_quirk_rules,
    ACPI_FLAG_NAMES, [[dmi_acpi_quirk]] TOML parser.
    +2 unit tests. 122/122 redox-driver-sys tests pass.
  - e3c41b834 (redbear-quirks): Four ACPI DMI TOML files
    with 18 DMI rules from Linux 7.1 sources
    (drivers/acpi/{osi,sleep,button,battery}.c).

QUIRKS-SYSTEM.md updates:
  - Recent Activity (2026-06) table: two new rows with
    commit SHAs and one-line summaries.
  - Test count progression: 153 → 155 across the new
    redox-driver-sys tests.
  - Headline: 'R11 (ACPI DMI rules) RESOLVED' added.
    R12 (ACPI consumer wiring) is the next priority.

R12 is a 1-day task: wire load_dmi_acpi_quirks() into
acpid / acpi-handlers so the matched flags drive
acpi_osi_setup(), acpi_old_suspend_ordering(),
LID_INIT_DISABLED/OPEN, and battery quirk handler
flags. The infrastructure is now ready for this; the
consumer side is the only missing piece.
2026-06-07 21:27:10 +03:00
vasilito 0756a4d4f2 QUIRKS-SYSTEM: mark Blocker 3 + Gaps 10/11/12/15 RESOLVED
This session landed four more audit items:

  - Blocker 3 (9f250dbe, base fork): usbhidd HID/USB wiring
  - Gap 10 (a24cfe64c, evdevd recipe): evdevd HID registration
  - Gap 11: redox-drm GPU wiring (was already resolved; the
    audit's 'Gap 11 PENDING' was based on a misread of
    src/drivers/mod.rs:161 — full.quirks() IS the lookup)
  - Gap 12 (1561767ac, redbear-iwlwifi recipe): Wi-Fi NIC quirks
  - Gap 15 (98982cc2f, amdgpu recipe): extract pci_*_quirk_flags
    out of redox_stubs.c into a new redox_quirk_bridge.c TU

QUIRKS-SYSTEM.md updates:

  - Recent Activity (2026-06) table: adds four rows with commit
    SHAs and one-line summaries.
  - Blocker status block: Blocker 3 promoted to RESOLVED.
  - New Gap status block: 4/4 gaps RESOLVED.
  - Test count progression: 140 → 153 across the four new
    unit test suites.
  - Cross-Cutting Consumer Wiring Checklist: rows for evdevd,
    redox-drm, iwlwifi, amdgpu promoted from PENDING to
    RESOLVED (or ALREADY RESOLVED for redox-drm).
  - Implementation Order: Gap 15 + Gap 10-12 entries marked
    RESOLVED with commit SHAs and dates.
  - Headline: '5/5 P0 critical blockers RESOLVED, 4/4
    medium-low gaps RESOLVED'.

R11 is the next priority. With all blockers + gaps landed,
the data tables are live at every consumer site. R11 is
data-only work (mining ~60 ACPI DMI rules into
quirks.d/45-acpi-osi.toml through 48-acpi-battery.toml)
and becomes the first phase to ship user-visible benefit
on real hardware.
2026-06-07 21:09:27 +03:00
vasilito 2838894c65 QUIRKS-SYSTEM: mark Blocker 1 RESOLVED + refresh wiring checklist
The Blocker 1 commit lands in the base fork (commit 676af02e on
redbear-working). This commit:

  1. Bumps the three submodule pointers to the new commits that
     the gitea force-pushes landed this session (one per fork).
  2. Updates QUIRKS-SYSTEM.md to reflect the new state.

In QUIRKS-SYSTEM.md:

  - Recent Activity (2026-06) table: adds a row for Blocker 1
    with the commit SHA + summary.
  - Blocker status block: Blocker 1 promoted to RESOLVED, Blocker
    4 re-tagged as reduced to a 1-2 day follow-up (the loop is
    mechanically unblocked now that Blocker 1 is in), Blocker 3
    flagged as the next priority.
  - Test count progression: extends to 140 (12 new pcid unit
    tests).
  - Blocker 1 section: new 'Status: RESOLVED 2026-06-07' block
    with the three pieces (PcidConfigWriter, build_device_info,
    apply_pci_quirks), the wiring location, the test coverage,
    and the clean check / clippy result.
  - Cross-Cutting Consumer Wiring Checklist: pcid row promoted
    from PENDING to RESOLVED, with the commit SHA + test count.
    The '3 of 5' line below becomes '4 of 5'.
  - Adjusted Phase Estimates: R17 and R19 drop from 5-7 days to
    2-3 days (the Blocker 1 dependency is gone). New total is
    42-62 days (was 47-72); the +2-day remainder is Blocker 3
    plus the xhcid QuirkAction follow-up.
  - Recommended Implementation Order: Blocker 1 step promoted
    from PENDING to RESOLVED, with the new commit SHA and
    test count inline.

No other sections changed. The 15 medium/low gaps from the
R1-R10 audit remain PENDING; the next session will land
Blocker 3 (usbhidd HID/USB wiring) as the only remaining P0
critical blocker.
2026-06-07 20:21:11 +03:00
Red Bear OS Builder ab9f520f85 QUIRKS-SYSTEM: mark Blocker 2 + Blocker 4 RESOLVED; refresh P0 wiring checklist
Documents the three-commit chain (bootloader 259a621 + kernel
a4ba465 + acpid fa91cee4) that lands end-to-end SMBIOS delivery
into userspace and updates the audit doc to reflect that Blocker 2
and Blocker 4 are no longer P0 critical blockers.

  1. Top of the document: new 'Recent Activity (2026-06)' table
     listing every commit this audit/cleanup cycle landed, with
     a one-line summary per commit and a Blocker status block.

  2. Blocker 2 (acpid DMI producer) section: status updated to
     RESOLVED 2026-06-07 with a per-commit report. Documents
     - bootloader: find_smbios() searches UEFI Configuration
       Tables for SMBIOS3_TABLE_GUID, copies EPS + table to
       page-aligned buffers, exposes them via four new u64
       KernelArgs fields;
     - kernel: new SmbiosScheme serves
       /scheme/kernel.smbios/{eps,table} to userspace;
     - acpid: new dmi.rs module walks the SMBIOS table, splits
       each structure into formatted area + 1-based string
       area, fills 9 DmiInfo fields, exposes
       /scheme/acpi/dmi and /scheme/acpi/dmi/{field}.
     Net effect: every compiled-in DMI rule and every
     [[dmi_system_quirk]] / [[dmi_xhci_system_quirk]] TOML
     entry now fires against real firmware data, not synthetic
     fixtures.

  3. Blocker 4 (xhcid full lookup) section: status updated to
     RESOLVED with the partial-scope note that DMI lookup is
     in but QuirkAction iteration awaits Blocker 1. Documents
     the graceful-degradation path: when /scheme/acpi/dmi is
     absent, the call falls through to non-DMI rules only.

  4. Cross-Cutting Consumer Wiring Checklist: every P0/P1/P2/P3
     row now has a 'Status (2026-06-07)' column showing
     resolved vs pending. The section heading notes that 3 of
     5 P0 critical blockers are RESOLVED, leaving 2 (Blocker 1
     + Blocker 3) as the next priority.

  5. Adjusted Phase Estimates: R11 estimate drops from 5-7
     days back to 2-3 days (Blocker 2 + Blocker 5 already
     resolved; R11 is now data-only). Net total estimate
     drops from 65-100 days to 47-72 days. R17, R18, R19
     still carry the Blocker 1 / Blocker 3 surcharge since
     those blockers are still pending.

  6. Recommended Implementation Order: each blocker entry
     now shows RESOLVED/PARTIAL/PENDING. R11 status note
     updated to call out the chain completion. R12 and R13
     prerequisite notes now say DONE 2026-06-07 instead of
     'MUST FIX FIRST'.

  7. Phase R11 / R12 / R13 entries: 'Infrastructure' notes
     updated to point to the resolved commit ids and the
     remaining acpid-side work (DMI-rule ownership for
     _OSI override dispatch, ec timing consumer, etc.).

The 'three of five' P0 resolution is the headline result:
R11 (ACPI DMI rules) is now data-only and is the next
phase to ship user-visible benefit on real hardware.
2026-06-07 15:47:36 +03:00
vasilito 9a28b68ef8 quirks: resolve Blocker 5 — add bios_vendor + bios_date to DMI structs
Phase R10 audit (2026-06-07) identified that DmiInfo and DmiMatchRule
were missing the bios_vendor and bios_date fields that Linux SMBIOS
Type 0 (BIOS Information) provides. Many DMI-based quirk rules in
Linux drivers/acpi/osi.c, drivers/acpi/ec.c, and drivers/platform/x86/
match on BIOS vendor or BIOS release date for firmware-version
workarounds.

Changes:
  - dmi.rs: add bios_vendor: Option<String> and bios_date: Option<String>
    to both DmiInfo and DmiMatchRule structs
  - dmi.rs: extend is_empty() and matches() to consider the new fields
  - dmi.rs: extend parse_dmi_data() to handle bios_vendor and bios_date
    keys in /scheme/acpi/dmi text format
  - dmi.rs: extend all 8 compiled-in DmiPciQuirkRule literals and 3
    DmiInfo test fixtures with the new fields
  - toml_loader.rs: extend parse_dmi_match_rule() to parse bios_vendor
    and bios_date from [[dmi_system_quirk]] match tables
  - toml_loader.rs: extend all 4 DmiInfo test fixtures
  - dmi.rs: 5 new unit tests (bios_vendor match, bios_date match,
    combined match, parse_dmi_data, is_empty with bios fields)
  - toml_loader.rs: 1 new integration test (TOML bios_vendor+date
    parse and match, miss, and absent cases)
  - QUIRKS-SYSTEM.md: mark Blocker 5 as RESOLVED

Tests: 120/120 pass (was 114, +6 new).
Clippy: +2 warnings (same map_or pattern as existing 7 DMI fields,
follows existing convention; not a new defect).

Source-of-truth: drivers/firmware/dmi_scan.c (dmi_decode_table) and
include/linux/mod_devicetable.h (dmi_system_id).

Depends on Blocker 2 (acpid DMI producer at /scheme/acpi/dmi) for
runtime data; the fields are now in place and will activate when
acpid is updated to populate the new keys.
2026-06-07 14:14:45 +03:00
vasilito 60b2006011 docs(quirks): R1-R10 audit + comprehensive R11-R22 plan
Synthesize three parallel audit reports (bg_714f844f gap audit,
bg_1219aaa3 consumer audit, bg_c8826a88 adjacent-tech audit) into a
single R1-R10 audit section that captures the current consumer-wiring,
dormant-feature, and adjacent-technology state of the hardware quirks
system after R0-R10 implementation (commits 86902d481, 5e44191c9,
b56b810c0, b324cf67e, 6f1df4f04 on 0.2.3).

Five critical blockers identified:
  1. PciConfigWriter production impl missing (QuirkAction dead code)
  2. acpid does not serve DMI/SMBIOS at /scheme/acpi/dmi
  3. usbhidd has zero HID/USB quirk consumption
  4. xhcid does not call lookup_xhci_controller_quirks_full
  5. DmiInfo/DmiMatchRule missing bios_vendor + bios_date fields

Fifteen medium/low gaps catalogued (TOML hot-reload, amdgpu stubs,
evdevd/redox-drm/iwlwifi wiring, etc.).

Comprehensive R11-R22 plan specifies for each phase:
  - Infrastructure prerequisites (including the 5 blockers above)
  - Data sources (compiled-in vs TOML vs DMI vs SMBIOS)
  - Consumer drivers that must call lookup functions
  - Test coverage expectations
  - Runtime verification harness

Cross-cutting consumer wiring checklist ranks the work by priority (P0
through P3). Adjusted phase estimates reflect that the 5 blockers add
~20 days to the 44-68 day baseline, for a 65-100 day total.

Recommended implementation order: Blocker 5 -> Blocker 2 -> Blocker 1 ->
Blocker 3 -> Blocker 4, then Phases R11-R22 incrementally.
2026-06-07 14:02:23 +03:00
vasilito 6f1df4f044 quirks: add R10 runtime TOML data and implementation report
Adds:
- local/recipes/system/redbear-quirks/source/quirks.d/40-hid.toml:
  967-line runtime override file with all 191 HID quirk entries
  (mirrors the compiled-in hid_table.rs; lets operators override,
  extend, or disable flags without rebuilding the driver)
- local/docs/QUIRKS-SYSTEM.md: 103-line R10 implementation report
  covering scope completed (items 1-6, 8 of the 8-item R10 plan),
  item 7 (consumer wiring) deferred to input-stack maturity,
  entry-count audit (191 not 500), flag-count audit (24 defined,
  9 used), bit-position audit (gaps at 0/8/9/15/24-27 for removed
  upstream flags), test progression (106 -> 114, +8 R10 tests)

Follows the commit pattern of R6 (5e44191c9) and R7-R9 (b56b810c0)
where the structural Rust code is committed first, then the runtime
data and docs update are committed as a follow-up.
2026-06-07 13:17:08 +03:00
vasilito b56b810c07 quirks: implement R7-R9 — xHCI closure, PciQuirkPhase, USB storage resync
Phase R7 (xHCI closure, multi-session R7-R10 first commit):

* R7-A xHCI TOML layer: brings xHCI to 3-layer parity with PCI
  (compiled-in + TOML + DMI). Adds XHCI_CONTROLLER_FLAG_NAMES (28
  entries: 19 pre-R6 + 5 R6 + 3 R7-C with chronological markers),
  read_toml_xhci_entries(), parse_xhci_toml(),
  load_xhci_controller_quirks_toml(), updated
  lookup_xhci_controller_quirks() to OR TOML flags, new
  lookup_xhci_controller_quirks_full() as 3-layer entry point.
  New quirks.d/25-xhci.toml with 8 example entries sourced from
  Linux 7.1 xhci-pci.c.

* R7-B DMI xHCI bridge: mirrors the PCI DMI bridge. Linux itself
  has no DMI-based xHCI quirks so DMI_XHCI_QUIRK_RULES is empty;
  the wiring exists so future DMI rules can be added without
  re-architecting. Adds DmiXhciQuirkRule struct,
  apply_dmi_xhci_quirk_rules() OR-accumulator, DMI_XHCI_QUIRK_RULES
  constant, load_dmi_xhci_quirks() public function,
  read_toml_dmi_xhci_toml()/parse_dmi_xhci_toml() in toml_loader
  for the new [[dmi_xhci_system_quirk]] section.

* R7-C 3 high-priority xHCI flags (already in 0.2.3 branch from
  R7-C stand-alone commit): DEFAULT_PM_RUNTIME_ALLOW (bit 33),
  SNPS_BROKEN_SUSPEND (bit 35), RESET_TO_DEFAULT (bit 44). Bit
  positions match Linux 7.1 xhci.h:1586-1660 exactly. Six new
  PCI entries: AMD 0x43f7, 0x15e0, 0x15e1, Intel 0x9a13/0x51e0/0x54ee.
  Seven new R7-C tests.

Phase R8 (PciQuirkPhase data structure, no PM consumers):

* PciQuirkPhase enum: Header, Final, Enable, Resume, ResumeEarly.
  Mirrors Linux DECLARE_PCI_FIXUP_* macro family.
* phase: PciQuirkPhase field on PciQuirkEntry. All 31 existing
  compiled-in entries default to Final via ..WILDCARD.
* phase_visible(phase, pm_available) helper. Boot-time phases
  always visible; Resume/ResumeEarly gated by pm_available.
* lookup_pci_quirks_full_with_pm() public function gates all
  three layers. load_pci_quirks() defaults to pm_available=false
  for safe existing-caller behavior.
* TOML parser reads phase = "header"|"final"|"enable"|"resume"
  |"resume_early" per [[pci_quirk]] entry. Unknown/omitted
  defaults to Final (graceful degradation).
* Seven R8 tests: header/resume/resume_early parse, omitted default,
  unknown default, boot-phase visibility, resume-phase gating.

Phase R9 (USB storage gap closure, data-only):

* Resynced 30-storage.toml header to reference Linux 7.1 (was 7.0).
* Fixed one entry: VIA Labs VL817 SATA Bridge (0x2109:0x0715)
  revision was "9999-9999" — corrected to wildcard "0000-9999"
  to match Linux UNUSUAL_DEV(0x2109, 0x0715, 0x0000, 0x9999, ...).
* Verification: python3 local/scripts/extract-linux-quirks.py
  local/reference/linux-7.1/drivers/usb/storage/unusual_devs.h
  produces 214 entries. diff against 30-storage.toml = 0 lines.
  The R1-R6 review's "108 missing" estimate was stale; the file
  is in full sync with Linux 7.1.

Test count: 90 (R7-C) + 9 (R7-A, R7-B) + 7 (R8) = 106/106 passing.
No new clippy warnings beyond two Result<_, ()> stylistic lints
that follow the existing convention (7+ functions use this pattern).

Consumer wiring status: BROKEN_MSI consumer in xhcid main.rs:69,
ZERO_64B_REGS consumer in xhci/mod.rs:524,542. R7-C and R7-A new
flags are observability-only via log_unenforced_xhci_quirks()
(R6) until xhcid's suspend/resume path lands.

Deferred to next session: R10 HID infrastructure (24 flags +
500 entries) and any R7/R8 PM execution work when PM lands.

Multi-session plan: this is the first of 4 atomic commits for
R7-R10. R10 HID lands in a separate session.
2026-06-07 11:57:24 +03:00
vasilito 5e44191c90 quirks: implement R6 — xHCI controller flag expansion
Phase R6 (2026-06-07) extends the xHCI controller quirk layer with five
new XHCI_* bit positions from Linux 7.1's drivers/usb/host/xhci.h, three
new PCI table entries from xhci-pci.c, and an xhcid-side observability
hook for the unenforced flags. Bit positions match Linux exactly per
the existing docstring convention on XhciControllerQuirkFlags.

Five new xHCI flags (24 total, no collisions):
- XHCI_SSIC_PORT_UNUSED   (bit 22) — Intel Cherryview 0x22b5
- XHCI_MISSING_CAS        (bit 24) — Intel CV/SP/APL/DV
- XHCI_BROKEN_PORT_PED    (bit 25) — platform-only in Linux
- XHCI_HW_LPM_DISABLE     (bit 29) — platform-only in Linux
- XHCI_BROKEN_D3COLD_S2I  (bit 41) — AMD Renoir 0x1639

XHCI_EP_CTX_BROKEN_DCS (bit 42) was the fifth entry on the plan's list
but is a Linux reserved-but-unused bit: only the BIT_ULL(42) definition
exists, with no consumer code anywhere and no PCI/vendor association.
Adding it would have been a stub. XHCI_SSIC_PORT_UNUSED is added in its
place — it has both a PCI association and a consumer site.

PCI table entries (3 new, 89 total):
- Intel Cherryview 0x22b5 → SSIC_PORT_UNUSED + MISSING_CAS
- AMD Renoir 0x1639 → BROKEN_D3COLD_S2I

BROKEN_PORT_PED and HW_LPM_DISABLE have no PCI entries — Linux sets
these only from xhci-plat.c / xhci-mtk.c / xhci-histb.c (non-PCI host
adapters). They are defined for forward-compatibility with future
platform xHCI support.

xhcid consumer wiring (in local/sources/base submodule):
- log_unenforced_xhci_quirks() called from Xhci::init() emits a
  warn! line for each set-but-unenforced R6 flag, citing the Linux
  consumer site and the missing Red Bear code path. Observability,
  not fake enforcement.
- Real enforcement for consumer sites that require suspend, LPM,
  port-disable, or CAS code paths in xhcid is deferred to Phase R8
  (PM infrastructure) and follow-up work.

Tests: 8 new (75 → 83 total passing).
Clippy: 26 warnings, all pre-existing R0–R5 baseline. No new warnings.
TOML validator: 244 entries, 0 undefined (no TOML changes for R6 —
xHCI controller flags are compiled-in only).

Source of truth: Linux 7.1 drivers/usb/host/{xhci.h, xhci-pci.c,
xhci.c, xhci-hub.c, xhci-plat.c, xhci-mtk.c, xhci-histb.c}.
2026-06-07 09:50:50 +03:00
vasilito 86902d4819 quirks: implement R0-R5 — data-driven PCI/USB/DMI bitmask system
Foundational data-driven hardware-quirk system with all entries through
Phase R5. Source of truth: Linux 7.1 DECLARE_PCI_FIXUP_* and PCI_DEV_FLAGS_*
conventions. Targets AMD64 bare metal, QEMU, and modern peripherals.

Code (redox-driver-sys/src/quirks/):
- PciQuirkFlags: 46 bits used (0-45), 18 reserved
- UsbQuirkFlags + XhciControllerQuirkFlags tables
- PciConfigWriter trait + QuirkAction enum (7 variants)
- 14 named callbacks (intel_no_aspm_l0s, amd_ide_class_fix,
  ht_enable_msi_mapping, p64h2_1k_io, intel_ntb_bar_fix, 7 DMA-alias
  callbacks, amd_fe_gate_ordering, amd_8131_mmrbc)
- lookup_pci_quirks_full, lookup_pci_quirks, lookup_usb_quirks,
  lookup_xhci_controller_quirks, lookup_dmi_rules
- find_standard_capability for PCI cap walks
- TOML loader with [[pci_quirk]] / [[usb_quirk]] / [[dmi_rule]] sections
- 75 tests pass (mod.rs + toml_loader + dmi + others)

Phase R5 adds (2026-06-07):
- 10 new flag bits (36-45): BROKEN_INTX_MASKING, NO_PME, PCI_PROBLEM_*,
  PCI_AGP_FAIL, BUS_NO_MMRBC
- 2 new callbacks: cb_amd_fe_gate_ordering (AMD-762 two-register write),
  cb_amd_8131_mmrbc (rev-gated < 0x12, sets BUS_NO_MMRBC)
- Inline ClearBit/SetBit actions for Mellanox, Cyrix, Intel, VIA
- 18 new Phase R5 tests (10 mod.rs + 8 toml_loader)

TOML (10 files, 244 entries in 07-pci-final-quirks.toml total):
  00-core.toml                  (41)
  05-pcie-quirks.toml           (52)
  06-pci-header-quirks.toml     (37)
  07-pci-final-quirks.toml      (64)  — R5 DECLARE_PCI_FIXUP_FINAL
  10-gpu.toml                   (33)
  15-audio.toml                  (7)

Verified: 38 distinct flag names used, 46 defined, 0 undefined references.

Docs: local/docs/QUIRKS-SYSTEM.md — R0-R5 implementation reports (2424 lines)
2026-06-07 09:18:40 +03:00
vasilito 7345ac1d14 docs: comprehensive VIRGL + Intel driver quality assessment and plan v3.0
Detailed assessment of all 3 GPU drivers (VIRGL, Intel, AMD) with
16,909 metric analysis across 111+ files. Both VIRGL and Intel are at
production quality with zero stubs.

Key findings:
- VIRGL: 0/12 gaps remaining, 28/28 GpuDriver overrides, 2,937 lines
- Intel: 0 stubs, 66 modules, 15,972 lines, complete execbuffer chain
- AMD: 3 DC-dependent gaps, 2,347 lines, 5 files

Production hardening plan: 7 phases covering GuC submission,
workarounds expansion, advanced display features, and Mesa validation.
2026-06-02 17:55:42 +03:00
vasilito 7686729069 drm: implement syncobj and fence for VIRGL/VirtIO driver
Extract protocol-agnostic FenceTimeline from Intel to shared
src/drivers/fence.rs — atomic-based fence tracking suitable
for Intel, VIRGL, and AMD drivers.

Extract protocol-agnostic SyncobjManager from Intel to shared
src/drivers/syncobj.rs — syncobj create/destroy/signal/reset/
wait/query and sync_file fd export/import.

Wire both into VirtioDriver:
- Add FenceTimeline + SyncobjManager fields
- Implement all 5 GpuDriver syncobj trait methods
  (create, destroy, wait, export_fd, import_fd)
- Track fence seqnos in virgl_submit_3d (allocate
  before submit, signal after completion)

Intel fence.rs and syncobj.rs converted to thin re-export
modules pointing at shared sources — no behavioral change
for Intel driver.

This gives Mesa VIRGL userspace the standard DRM syncobj
API for GPU/compositor synchronization.
2026-06-02 14:33:28 +03:00
vasilito 1632a59b02 docs: VIRGL driver comprehensive implementation plan
6 phases, 28 tasks, ~3,600 lines, 10-16 weeks
40% code reuse from Intel driver (GEM, syncobj, fence, KMS, scheme)
Linux 7.1 reference: 16 files, 5,837 lines

Architecture map: guest Mesa → redox-drm → virtio queue → QEMU → host GPU
Reuse assessment: 35 shared files (~8,200 lines) — all protocol-agnostic
VIRGL-specific: virtio command submission, capset negotiation, GL contexts
2026-06-02 14:13:38 +03:00
vasilito 62d2b232f2 docs: update Intel driver plan with comprehensive status
Version 2.0 — reflects current state after ~100 commits:
  66 compiled modules, 125 total .rs files, ~20,000 lines
  19 dead modules wired, EOI fix, all 8 phases complete
  GEM 81% Linux coverage, all 7 PHY types, DP 2.1 + HDMI 2.1
  Integration gaps documented with mitigation status
2026-06-02 13:51:45 +03:00
vasilito b19dd74f39 intel: fix pre-Gen9 per-gen flags, enable Gen8 PPGTT, expand plan
info.rs:
- Gen8 now has has_ddi/has_dp_aux: true (Broadwell uses DDI display engine)
- Gen7+ now has has_gmbus: true (Ivy Bridge introduced GMBUS at 0xC5100)
- Gen4-Gen7 pre-Gen8: num_ports=3 (3 display ports, not 4 DDI ports)
- Added is_gen8_or_later() for PPGTT gate

mod.rs: PPGTT gate extended from is_gen9_or_later() to is_gen8_or_later()
  Broadwell (Gen8) supports 48-bit PPGTT

INTEL-DRIVER-FULL-IMPLEMENTATION-PLAN.md: comprehensive pre-Gen9 gap catalog
  FDI vs DDI register table for all generations
  Per-generation forcewake, power well, PLL, interrupt differences
  Implementation priority: P0 (Gen8 flags) done, P1 (FDI) documented
2026-06-01 22:59:09 +03:00
vasilito cf3b11a5f6 docs: pre-Gen9 assessment — Gen4-Gen8 display engine analysis
Haswell+ (2013+) uses DDI display engine — same as Gen9, should work.
Gen4-Gen7 pre-Haswell uses FDI display engine — different register set.
FDI (FDI_TX_CTL/FDI_RX_CTL/PCH transcoders) vs DDI (DDI_BUF_CTL).
56 pre-Gen9 device IDs added to info.rs (Total: 161, 46% of Linux 7.1)
2026-06-01 22:55:12 +03:00
vasilito 2ae3eb9d02 intel: P0 fixes — wire ATOMIC ioctl, fix SYNCOBJ caps, update plan
scheme.rs:
- DRM_IOCTL_MODE_ATOMIC: actually call driver.atomic_commit() instead of returning
  empty. This was dead code — the Intel driver's atomic_commit was fully implemented
  but unreachable from userspace. Single-line fix unblocks KWin/Wayland.
- DRM_CAP_SYNCOBJ: 0 → 1. Syncobjs were fully implemented but advertised as unavailable.
- DRM_CAP_SYNCOBJ_TIMELINE: 0 → 1. Timeline-based syncobj manager exists.
- DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP: 0 → 1. Async page flip support advertised.

INTEL-DRIVER-FULL-IMPLEMENTATION-PLAN.md:
- Cross-reference analysis from 3 background agents vs Linux 7.1 i915
- P0 gaps: MOCS tables absent, HuC/GSC firmware missing, render state needed
- P1 gaps: GT interrupts, VBT LFP/eDP/DTD parsing, missing device IDs
- Updated priority with effort estimates per gap
2026-06-01 22:27:25 +03:00
vasilito 5c21aaba00 docs: comprehensive Intel driver assessment vs Linux 7.1 i915
- Cross-reference DRM ioctl coverage (Wayland/Mesa readiness)
- GpuDriver trait implementation status
- Generation support comparison (Linux vs Red Bear)
- Workaround coverage analysis (~15 lines vs Linux's 3,131)
- VBT/GuC/HuC firmware gap analysis
- Updated priority order: workarounds → device IDs → GuC submission → hotplug
- Wayland/KDE path assessment: KMS ready, needs Mesa Iris for 3D
2026-06-01 22:22:33 +03:00
vasilito 7cfef2633e fix: m4 recipe - fix_types.h for cross-compiler header ordering
The cross-compiler's GCC built-in stddef.h is blocked by relibc's
_STDDEF_H guard, causing size_t/off_t/ptrdiff_t to be undefined.
Add fix_types.h with guarded typedefs and force-include via CPPFLAGS.

Also: comprehensive upstream relibc comparison for systematic import.

Remaining: redoxer env overrides CC, injecting broken stdint typedefs
from its toolchain. This needs a redoxer-level fix to clean the
injected flags before passing to build commands.
2026-06-01 18:53:05 +03:00
vasilito 24584eb3c6 fix: remove garbled lines in AMD hotplug IRQ handler
Lines 649-651 had VramManager and info!() calls that don't belong
in handle_irq(). These were likely from a bad merge. The variables
fb_phys and fb_size are local to new() and don't exist in handle_irq().
2026-05-31 23:12:56 +03:00
vasilito 3431bbfeb2 Fix duplicate atomic_t typedef conflicting with types.h 2026-05-31 05:50:29 +03:00
vasilito 98326148ef Add Intel display subsystem reference: backlight, PPS, hangcheck, reset
Extracted from local/reference/linux-7.1/drivers/gpu/drm/i915/:
- Panel backlight: BLC_PWM_CTL/CTL2 register layouts, PWM frequency
  formulas for all platforms (Gen2 through BXT/CNP), enable/disable sequences
- Panel power sequencing: PP_STATUS/PP_CONTROL/PP_*_DELAYS/PP_DIVISOR
  register offsets and bit layouts, power-on/off/VDD sequences, delay computation
- GPU hang detection: ACTHD comparison, ring head/tail tracking,
  hangcheck state machine, timeout thresholds
- GPU engine reset: GEN6_GDRST/GEN8_GDRST/RING_RESET_CTL register
  definitions, per-engine reset sequences for Gen8+, global reset flows,
  platform variations (Gen2 through MTL+)

Intended as technical reference for Intel driver implementation in
local/recipes/gpu/redox-drm/source/src/drivers/intel/.
2026-05-30 12:52:11 +03:00
vasilito 381c2984b7 docs: update Intel driver plan with implementation status
INTEL-DRIVER-MODERNIZATION-PLAN.md updated:
- Add implementation status header: all 5 phases complete
  (26 files, 4,692 lines, 28 commits, Arrow Lake supported)
- Update effort summary with actual vs planned metrics
- Remove obsolete patch discipline section (migrated to source ownership)
- Update out-of-scope: Xe2/Arrow Lake no longer out of scope
  (integrated GPU uses i915 display engine with Xe2 GT register table)
- Update dependencies section status

Code fix: add safety justification for unsafe slice in CS submit
2026-05-30 09:52:22 +03:00
vasilito df5b6d1c6f migrate: finalize source ownership — mini ISO builds and boots
- Restore all fork repos from properly pre-patched 0.1.0 release archives
  (kernel, relibc, base, bootloader, userutils — all now have full git history)
- Fix installer Cargo.toml: comment out broken ext4-blockdev path dependency
- Add initfs-storage.toml to base fork for base-initfs build
- Remove stale Phase 6 from BUILD-SYSTEM-HARDENING-PLAN.md
- Delete 282 archived .patch files (non-fork components, unused)
- Delete local/patches/ directory (empty, historical)
- Remove local/AGENTS.md stale references
- Fix pkgar signing keys: regenerate all 77 package signatures

Build verification (redbear-mini):
- kernel: BUILDS from local/sources/kernel
- relibc: BUILDS from local/sources/relibc
- base: BUILDS from local/sources/base
- bootloader: BUILDS from local/sources/bootloader
- userutils: BUILDS from local/sources/userutils
- installer: BUILDS from local/sources/installer
- redoxfs: BUILDS from local/sources/redoxfs
- 77 packages total in repo
- harddrive.img: 1.5GB, boots in QEMU (Stage 1 → Stage 2 confirmed)
- Final harddrive.img verified with SeaBIOS → iPXE → boot chain
2026-05-30 00:38:25 +03:00
vasilito a23012cee0 migrate: remove patch system, adopt direct source ownership
BREAKING CHANGE: The patch-based build system is removed.
All Red Bear source now lives in local/sources/<component>/ as git repos.

Changes:
- src/recipe.rs: remove patches field from SourceRecipe::Git/Tar, add Local variant
- src/cook/fetch.rs: delete fetch_apply_patches, validate_patches, normalize_patch,
  fetch_compute_patches_hash, fetch_write_patches_state, fetch_patches_state_stale,
  fetch_validate_patch_symlinks, fetch_is_patches_newer. Simplify fetch and
  fetch_offline. Remove recipe_has_patches. Add Local source handler.
- src/bin/repo.rs: remove validate-patches command and handle_validate_patches
- 70 recipe.toml files: remove patches arrays, convert core recipes to Local source
- 272 .patch symlinks deleted from recipe directories
- integrate-redbear.sh: replace patch symlink logic with source fork validation
- Makefile: replace validate-patches with validate-sources target
- AGENTS.md: remove 369 lines of patch documentation, add source ownership model
- local/docs/PATCH-GOVERNANCE.md: deleted (replaced by SOURCE-OWNERSHIP-MODEL.md)
- local/docs/SOURCE-OWNERSHIP-MODEL.md: new canonical reference
- local/sources/: Red Bear fork repos created (kernel, relibc, base, bootloader,
  installer) from frozen 0.1.0 pre-patched archives
- .gitignore: exclude local/sources/ (separate git repos)
- create-forks.sh: new script for initializing fork repos

Build: cargo check passes (5 warnings, 0 errors).
Developer workflow is now: edit local/sources/ → repo cook → test. No patches.
2026-05-29 22:32:36 +03:00
vasilito aa9d14a90e docs: update AGENTS.md and PATCH-GOVERNANCE.md
AGENTS.md: updated session progress, coretempd/login fix notes, Intel plan references. PATCH-GOVERNANCE.md: added mega-patch discipline section and P-patch workflow documentation.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-29 21:50:28 +03:00
vasilito 44bcf2b75a docs: add Intel driver modernization plan
Comprehensive 6-phase plan (1,055 lines) for updating the Intel GPU driver from current 1,590-line stub to full Gen9+ support ported from Linux 7.1 i915. Covers register abstraction, GMBUS I2C, DMC firmware, power wells, CDCLK, display pipeline, modesetting, and hardware validation.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-29 21:50:07 +03:00
vasilito 328d1abbcd rate-limit scheme error spam to prevent serial log flood 2026-05-28 00:36:17 +03:00
vasilito b9de373b31 Merge bootprocess branch overlay into 0.2.0
Restore all bootprocess branch files that were overwritten by later 0.2.0
commits. This overlay brings back the complete boot infrastructure:

- Configs: redbear-full, redbear-mini, redbear-device-services, driver .d files
- Kernel: IRQ affinity, x2APIC, C-states, NUMA (SLIT/SRAT), MCS locks, cpuidle
- Base patches: P0-P55 + new P6 (lived block_size=512) + P57 (fbbootlogd graceful init)
- Driver infra: driver-manager, udev-shim, thermald, cpufreqd, iommu, redox-driver-sys/core
- GPU: redox-drm with improved connector handling
- System: redbear-info, redbear-hwutils phase-timer-check
- Build system: fetch.rs improvements, build-iso.sh, run_full.sh
- Kernel source: new ACPI (SLIT, SRAT), cpuidle, cstate, MCS lock modules

83 files changed, +3966/-1248 lines
2026-05-27 06:47:23 +03:00
vasilito 0c8be761eb Merge master into 0.2.0 (688 commits, theirs pref for conflicts) 2026-05-21 21:37:43 +03:00
vasilito 7e21799845 Add low-level infrastructure reassessment and updated plan v1.0 2026-05-21 05:36:35 +03:00
vasilito 80c9bccc09 docs: Add hardware validation matrix template
Define 4 hardware target classes (AMD/Intel desktop/laptop),
per-target checklist, negative-result capture format, and
quick/full test procedures. Ready for bare-metal evidence.
2026-05-20 18:56:32 +03:00
vasilito ae46dabeb0 docs: Add comprehensive system assessment and improvement plan
Replace 5 stale planning docs with unified assessment:
- New: COMPREHENSIVE-SYSTEM-ASSESSMENT-AND-IMPROVEMENT-PLAN.md
  (12-subsystem audit vs Linux 7.1, 6 phases of work)
- Removed: IMPLEMENTATION-MASTER-PLAN, SUBSYSTEM-ASSESSMENT-2026-05,
  SMP-BOOT-HARDENING-PLAN, CPU-DMA-IRQ-MSI-SCHEDULER-FIX-PLAN,
  COMPREHENSIVE-BOOT-IMPROVEMENT-PLAN
2026-05-20 13:47:25 +03:00
vasilito f6c2eb2a8e feat: ACPI Wave 1 boot-critical hardening (P19) + robust patch generation
- P19-init-startup-hardening: Replace panic-grade expect/unwrap in init
  startup paths (getns, register_scheme_to_ns, setrens, filename parsing)
  with graceful error handling and logging
- P19-acpid-startup-hardening: Replace panic-grade calls in acpid with
  graceful degradation (rxsdt read failure → warn + exit 0, SDT parse →
  error + exit 1, I/O privilege → fatal, scheme registration → fatal,
  setrens → warn + continue, event loop errors → log + continue)
- P18-9-msi-allocation-resilience: Regenerate with git diff -U0 -w format
  for maximum context resilience
- fetch.rs: Change --fuzz=0 to --fuzz=3 for resilient patch application
- AGENTS.md: Document robust patch generation technique as mandatory
- Add P4/P5/P6/P7 patches (estale, dmi, i2c, ps2d hardening)
- Add P21 kernel x2apic SMP fix patch
- Multiple local recipe source improvements (redox-drm, driver-manager,
  driver-acpi, thermald)
- Config updates for redbear-mini and redbear-device-services
- Subsystem assessment document
2026-05-18 14:07:42 +03:00
vasilito cee25393d8 fix: boot process improvements — dependency cycle, INIT_NOTIFY, probing loop, and log spam fixes
- Fix P15-8-init-cycle-detection.patch: replace visiting+error with seen+silent-skip
  to eliminate 11 false-positive 'dependency cycle detected' errors on shared deps
- Fix P0-daemon-fix-init-notify-unwrap.patch: remove eprintln! for missing
  INIT_NOTIFY (expected for oneshot_async services, ~7 daemons affected)
- Fix driver-manager hotplug loop: add PERMANENTLY_SKIPPED static set shared
  between hotplug handler and DriverConfig::probe() to stop infinite re-probing
  of Fatal/NotSupported/deferred-exhausted device+driver pairs (e.g. ided)
- Fix driver-manager log_timeline: suppress repeated EPIPE/ENOENT errors with
  AtomicI32 dedup and AtomicBool one-shot guards for boot timeline JSON
- Add driver-manager SIGTERM handler, ACPI bus registration, --status mode,
  driver reap loop, graceful shutdown, and reduced deferred retries (30→3)
2026-05-17 12:34:02 +03:00
vasilito 81285f3a12 docs: update local driver-manager execution notes 2026-05-09 01:34:16 +01:00
vasilito bea8595fd4 docs: update local driver-manager execution notes 2026-05-09 01:34:16 +01:00
vasilito 7706617e7f cub: full AUR package manager + Phase 1-5 native build tools
cub redesign (local/recipes/system/cub/):
- AUR RPC v5 client (serde_json) with search/info
- ~/.cub/ user-local recipe/source/repo storage
- Enhanced PKGBUILD parser: optdepends, .SRCINFO, split packages, 19 linuxism patterns
- Recipe generation: host: prefix on dev-deps, shallow_clone, cargopath, installs, optional-packages
- Dependency resolver: scans build errors for missing commands/headers/libs/pkgconfig, maps to packages
- Dependency installation: checks installed packages, fetches AUR deps, interactive prompt
- ~110 Arc→Redox dependency mappings
- ratatui TUI: search, info, install, build, query views
- 14 Arch-style CLI switches (-S/-Si/-Syu/-G/-R/-Q/-Qi/-Ql)
- 65 tests, 0 failures, clean build

Phase 1-5 native build tools (local/recipes/dev/):
- P1 Substrate: tar, m4, diffutils (gnulib bypass), mkfifo kernel patch (1085 lines)
- P2 Build Systems: bison, flex, meson (standalone wrapper), ninja-build, libtool
- P3 Native GCC: gcc-native, binutils-native (cross-compiled for redox host)
- P4 Native LLVM: llvm-native (clang + lld from monorepo)
- P5 Native Rust: rust-native (rustc + cargo)
- Groups: build-essential-native, dev-essential expanded

Config:
- redbear-mini: +7 tools (diffutils, tar, bison, flex, meson, ninja, m4)
- redbear-full: +4 native tools (gcc, binutils, llvm, rust)
- All recipes moved to local/ with symlinks for cookbook discovery (Red Bear policy)

Docs:
- BUILD-TOOLS-PORTING-PLAN.md: phased porting roadmap
- CUB-WORKFLOW-ASSESSMENT.md: gap analysis and integration assessment
2026-05-08 00:13:31 +01:00
vasilito 950edaa65f cub: full AUR package manager + Phase 1-5 native build tools
cub redesign (local/recipes/system/cub/):
- AUR RPC v5 client (serde_json) with search/info
- ~/.cub/ user-local recipe/source/repo storage
- Enhanced PKGBUILD parser: optdepends, .SRCINFO, split packages, 19 linuxism patterns
- Recipe generation: host: prefix on dev-deps, shallow_clone, cargopath, installs, optional-packages
- Dependency resolver: scans build errors for missing commands/headers/libs/pkgconfig, maps to packages
- Dependency installation: checks installed packages, fetches AUR deps, interactive prompt
- ~110 Arc→Redox dependency mappings
- ratatui TUI: search, info, install, build, query views
- 14 Arch-style CLI switches (-S/-Si/-Syu/-G/-R/-Q/-Qi/-Ql)
- 65 tests, 0 failures, clean build

Phase 1-5 native build tools (local/recipes/dev/):
- P1 Substrate: tar, m4, diffutils (gnulib bypass), mkfifo kernel patch (1085 lines)
- P2 Build Systems: bison, flex, meson (standalone wrapper), ninja-build, libtool
- P3 Native GCC: gcc-native, binutils-native (cross-compiled for redox host)
- P4 Native LLVM: llvm-native (clang + lld from monorepo)
- P5 Native Rust: rust-native (rustc + cargo)
- Groups: build-essential-native, dev-essential expanded

Config:
- redbear-mini: +7 tools (diffutils, tar, bison, flex, meson, ninja, m4)
- redbear-full: +4 native tools (gcc, binutils, llvm, rust)
- All recipes moved to local/ with symlinks for cookbook discovery (Red Bear policy)

Docs:
- BUILD-TOOLS-PORTING-PLAN.md: phased porting roadmap
- CUB-WORKFLOW-ASSESSMENT.md: gap analysis and integration assessment
2026-05-08 00:13:31 +01:00
vasilito bcc42cc022 docs: document Cub package manager
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-07 21:15:08 +01:00
vasilito 8cd3f6035a docs: document Cub package manager 2026-05-07 21:15:08 +01:00
vasilito 499445e52c fix: Oracle review — delete 50 stale .bak files, update Wayland doc
- git rm 50 stale .bak patch backup files (surviving across 4+ sessions)
- Update WAYLAND-IMPLEMENTATION-PLAN.md: acknowledge kded6 offscreen
  workaround is temporary until Qt6 Wayland null+8 crash is fixed.
  kded6 is a headless D-Bus daemon — Wayland adds no functionality.

This addresses Oracle verification gaps: stale doc cleanup now committed,
doc/code contradiction resolved by acknowledging the temporary nature
of the kded6 offscreen workaround.
2026-05-06 15:29:04 +01:00
vasilito 408023e8fd fix: Oracle review — delete 50 stale .bak files, update Wayland doc
- git rm 50 stale .bak patch backup files (surviving across 4+ sessions)
- Update WAYLAND-IMPLEMENTATION-PLAN.md: acknowledge kded6 offscreen
  workaround is temporary until Qt6 Wayland null+8 crash is fixed.
  kded6 is a headless D-Bus daemon — Wayland adds no functionality.

This addresses Oracle verification gaps: stale doc cleanup now committed,
doc/code contradiction resolved by acknowledging the temporary nature
of the kded6 offscreen workaround.
2026-05-06 15:29:04 +01:00
vasilito b66431cbbe fix: restore libwayland redox.patch to working state, update docs
- Reverted redox.patch to original 39-line version (build-tested)
- Documented libwayland→qtbase→kded6 build dependency chain
- Updated WAYLAND-IMPLEMENTATION-PLAN.md to v2.1
- Deleted 45 stale .bak patch files
- pkgar restored from packages/ backup
2026-05-06 14:39:55 +01:00
vasilito 08411ea679 fix: restore libwayland redox.patch to working state, update docs
- Reverted redox.patch to original 39-line version (build-tested)
- Documented libwayland→qtbase→kded6 build dependency chain
- Updated WAYLAND-IMPLEMENTATION-PLAN.md to v2.1
- Deleted 45 stale .bak patch files
- pkgar restored from packages/ backup
2026-05-06 14:39:55 +01:00
vasilito 608b1bffbb docs: Wayland-only path — no framebuffer workarounds. Add Qt6 instrumentation.
- WAYLAND-IMPLEMENTATION-PLAN.md v2.0: document architecture decision
  that Wayland is the only supported display path. Remove all
  framebuffer fallback workarounds (offscreen QPA, redox QPA shim).
- qwaylanddisplay.cpp: add fprintf instrumentation for crash diagnosis;
  skip xkb_context_new on Redox to eliminate potential xkb crash vector.
- greeter-ui/main.cpp: remove QT_QPA_PLATFORM=redox workaround.
  The greeter must use Wayland. Accept the crash until Qt6 is fixed.
- Ruled out: relibc calloc (zeroes correctly), libwayland proxy_create
  (correct), compositor protocol (compliant). Root cause is in Qt6
  generated Wayland wrappers passing NULL to wl_proxy_add_listener.
2026-05-06 12:21:05 +01:00
vasilito 3ad461340b docs: Wayland-only path — no framebuffer workarounds. Add Qt6 instrumentation.
- WAYLAND-IMPLEMENTATION-PLAN.md v2.0: document architecture decision
  that Wayland is the only supported display path. Remove all
  framebuffer fallback workarounds (offscreen QPA, redox QPA shim).
- qwaylanddisplay.cpp: add fprintf instrumentation for crash diagnosis;
  skip xkb_context_new on Redox to eliminate potential xkb crash vector.
- greeter-ui/main.cpp: remove QT_QPA_PLATFORM=redox workaround.
  The greeter must use Wayland. Accept the crash until Qt6 is fixed.
- Ruled out: relibc calloc (zeroes correctly), libwayland proxy_create
  (correct), compositor protocol (compliant). Root cause is in Qt6
  generated Wayland wrappers passing NULL to wl_proxy_add_listener.
2026-05-06 12:21:05 +01:00
vasilito 2ca82fab28 docs: fix all remaining stale claims in assessment — S1-S4 fully reflected 2026-05-05 22:05:02 +01:00
vasilito 8761e80d44 docs: fix all remaining stale claims in assessment — S1-S4 fully reflected 2026-05-05 22:05:02 +01:00
vasilito 0a81b7e1e9 docs: update assessment — S1-S4 all implemented, remove stale 'no implementation' claims 2026-05-05 21:59:45 +01:00