Commit Graph

594 Commits

Author SHA1 Message Date
vasilito 8f8c69a04e docs: Remove named AI references from commit policy
Make the anti-pattern description generic instead of naming a
specific tool or service.
2026-05-20 13:55:53 +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 b1af8a356f acpid: Add ACPI thermal zone discovery and evaluation (P44)
Implement full thermal zone backend in acpid:
- thermal.rs: Discover \_TZ_.TZ* zones, evaluate \_TMP, \_CRT, \_PSV,
  \_AC0, \_TC1, \_TC2, \_TSP, \_TZP methods
- scheme.rs: Expose /scheme/acpi/thermal/ with per-zone temperature files
- acpi.rs: Add thermal_state and thermal_zone_names() to AcpiContext

Wired as P44 patch in base recipe.toml.
2026-05-20 13:47:04 +03:00
vasilito 6ca3e47383 Add coretempd CPU temperature sensor daemon
New local recipe coretempd reads IA32_THERM_STATUS MSR via the
new sys:msr scheme and exposes per-CPU temperatures via scheme:coretemp.

- Reads IA32_THERM_STATUS (0x19C) and IA32_TEMPERATURE_TARGET (0x1A2)
- Calculates Celsius from digital readout relative to TjMax
- Exposes /scheme/coretemp/ directory with per-CPU temperature files
- Added to redbear-mini.toml (inherited by redbear-full)
- Added 15_coretempd.service init file
2026-05-20 13:46:43 +03:00
vasilito 7999a896d0 cpufreqd: Use new sys:msr scheme for P-state control
Replace non-existent /dev/cpu/{n}/msr path with /scheme/sys/msr/{cpu}/{msr}
now that the kernel exposes MSR access via the sys scheme.
2026-05-20 13:40:45 +03:00
vasilito 56be23ce6e kernel: Add sys:msr scheme for userspace MSR read/write
Expose MSR access via /scheme/sys/msr/<cpu>/<msr> for root only.
Required for cpufreqd P-state control and thermal sensor drivers.
2026-05-20 13:38:53 +03:00
vasilito 9233726f58 P0..P71 baseline before fbcond/fbbootlogd init fix 2026-05-20 00:30:18 +03:00
vasilito 861e6f88d2 driver-manager: fix scheme collision and scheme availability check; redox-driver-sys: CPU affinity logging; redbear-hwutils: timer characterization 2026-05-19 23:50:32 +03:00
vasilito a9051ebb91 base: P25-P32 patch chain — fbcond VESA fallback, driver-manager initfs, init conditions, acpid graceful boot, xhcid interrupts 2026-05-19 23:50:01 +03:00
vasilito 2a5eff93ec P24: ACPI S5 derivation with shutdown semantics and error propagation
Add deterministic S5 (soft-off) state derivation and structured error
handling to acpid. Derive S5 parameters once at startup (or retry at
shutdown if AML was not ready) instead of re-parsing the _S5 package
on every shutdown attempt. Replace unit-return set_global_s_state()
with ShutdownResult enum for proper error propagation and fallback
handling.

Changes:
- S5State struct caches SLP_TYPa/b, PM1a/b ports, derivation timestamp
- ShutdownError enum: MissingFadt, Pm1aZero, AmlNotReady, S5NotFound,
  S5NotPackage, SlpTypNotInteger, S5WriteFailed
- ShutdownResult enum: Ok, FallbackReset, Err(ShutdownError)
- derive_s5_state() method with early init attempt and lazy fallback
- set_global_s_state() returns ShutdownResult instead of ()
- Early S5 derivation in AcpiContext::init() logs AML readiness status
- main.rs logs shutdown result for debugging

This is W2.1/W2.2 from ACPI-IMPROVEMENT-PLAN.md.
2026-05-19 02:43:58 +03:00
vasilito ba5e010bb7 P21-P23: boot daemon panic fixes, x2APIC MADT fallback, rootfs hard dep on drivers
P21: Replace 67 panic-grade calls across 9 boot daemon files with
graceful error handling. Affected: ps2d, inputd, fbcond, fbbootlogd.

P22: Add x2APIC MADT fallback for processors with LocalApic entries
instead of LocalX2Apic entries. QEMU KVM boots now correctly detect
all vCPUs via zero-extended APIC ID fallback.

P23: Change 50_rootfs.service from requires_weak to requires on
40_drivers.target, ensuring redoxfs waits for disk drivers before
attempting filesystem mount. This fixes the boot race where rootfs
mount failed before drivers were ready, causing init to have no
userland services after switchroot.
2026-05-19 02:18:17 +03:00
vasilito b1022dfa39 fix: ramfs depends hard on randd before startup (P20)
ramfs@.service required randd as requires_weak, which doesn't enforce
readiness ordering. When ramfs called std::random before randd registered
/scheme/rand, it panicked with 'failed to generate random data'.

Changed requires_weak to requires so init waits for randd to register
its scheme before starting ramfs.

Also patched Rust stdlib sys/random/redox.rs to fall back to xorshift64
seeded from ASLR rather than panicking when /scheme/rand is unavailable.
This is a belt-and-suspenders fix: even with proper ordering, the stdlib
should not panic on missing entropy during early boot.
2026-05-18 17:43:33 +03:00
vasilito f3bef6b403 fix: remove P18-5 duplicate RSDP hunk, fix P19-init log crate dependency
P18-5 had a duplicate acpi.rs RSDP probing hunk that reversed P5's
BIOS probing code, causing P19-acpid hunk #8 to fail. Removed the
duplicate, keeping only aml_physmem.rs hunks.

P19-init used log::warn!() but init in initfs has no log crate
dependency. Replaced with init_warn(&format!(...)) from the existing
color module.

All 58/58 patches validate. redbear-mini builds successfully.
2026-05-18 17:00:01 +03:00
vasilito 419ff3c536 fix: regenerate P18-9, P19-init, P19-acpid patches as -U0 -w resilient format
All 58 base patches now pass repo validate-patches base.

- P18-9-msi-allocation-resilience: regenerated against P0-P18-8 baseline
  with correct upstream content (deamon typo preserved for virtio-netd)
- P19-init-startup-hardening: regenerated against P0-P18-9 baseline
- P19-acpid-startup-hardening: regenerated against P0-P18-9 + P19-init
  baseline with all 39 hunks in -U0 -w format (zero context lines)
2026-05-18 16:05:52 +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 20853c41f5 fix: correct P20 patch line numbers from actual diff
- Derived line offsets from real pre-P20 vs post-P20 diff
- x86.rs: 3 hunks at @@ -446/-456/-468 converting hardcoded <<32 to
  local_apic.x2-gated format with xAPIC <<56 fallback
- local_apic.rs: 1 hunk promoting debug! to info! for bootlog visibility
2026-05-17 14:51:58 +03:00
vasilito 081ed10a8b fix: x2APIC ICR format + build system durability docs
- Fix LocalX2Apic handler: use local_apic.x2 to select correct ICR
  format (<<32 for x2APIC, <<56 for xAPIC) instead of hardcoded <<32
- Promote x2APIC/xAPIC detection from debug! to info! for bootlog
- Document build system durability in AGENTS.md: cardinal rule,
  two-layer architecture, correct workflow, anti-patterns
2026-05-17 13:57:37 +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 7914626765 fix: update KWin and Qt6 cross-compile patches for Redox
KWin: add Redox compat for libinput device, wl-socket Unix domain socket\nwrapper, RamFile mmap, tablet mode manager, and CMake fixes for helpers\nand systembell plugins.

Qt6: add Redox compat for qplatformdefs (posix), corelib CMake,\nqtypes.h sizing, native socket engine, and Wayland client buffer\nintegration header.
2026-05-15 07:25:45 +01:00
vasilito a5df2280bc fix: update KF6 cross-compile patches for Redox
CMakeLists.txt patches for kf6-attica, kf6-kcmutils, kf6-kcolorscheme,\nkf6-kcompletion, kf6-kconfigwidgets, kf6-kdeclarative, kf6-kiconthemes,\nkf6-kitemmodels, kf6-kitemviews, kf6-kjobwidgets, kf6-ktextwidgets,\nkf6-kwayland, kf6-kxmlgui, kf6-pty, kf6-solid — disable missing dependencies,\nadd Redox compatibility definitions, and fix build errors.
2026-05-15 07:24:51 +01:00
vasilito 13c5d239ca feat: add Mesa EGL hardware GPU probe with virgl support
P5: Enable PRIME export for GBM dumb buffers so virgl can import scanout\nbuffers via fd-to-handle.

P6: Add redox_probe_device_hw() that opens /scheme/drm/card0, resolves the\nDRI driver via PCI ID lookup (loader_get_driver_for_fd), and initializes the\nhardware path through dri2_load_driver_dri3 with __DRIimageLoaderExtension.\nIncludes fprintf(stderr) debug logging tagged [REDOX-EGL] for tracing the\nHW init sequence. Falls back to software rendering if HW probe fails.
2026-05-15 07:24:31 +01:00
vasilito 104edae141 feat: rewrite libdrm ioctl bridge with VirtGPU support
Wire P1/P2 patches into recipe.toml. Source reflects the full ioctl bridge\nrewrite: VirtGPU NR mappings, EXECBUFFER/GET_CAPS special handlers,\nPCI info bridge for drmGetDevice2, and removal of the old per-ioctl C\nhandler functions in favor of unified redox_drm_simple_ioctl() dispatch.
2026-05-15 07:24:15 +01:00
vasilito dd0cc3725a feat: add VirtGPU ioctl bridge and PCI info patches for libdrm
P1: Replaces the old per-ioctl C handlers with a unified dispatch through\nredox_drm_simple_ioctl(), adds VirtGPU NR mappings (MAP, EXECBUFFER,\nGETPARAM, RESOURCE_CREATE, GET_CAPS, etc.), and special handlers for\nEXECBUFFER (inline command buffer) and GET_CAPS (variable response).

P2: Adds __redox__ blocks to drmParsePciBusInfo, drmParsePciDeviceInfo,\nand drmGetDevice2 using the DRM scheme GET_PCI_INFO ioctl to populate\nPCI device identification without /sys access.
2026-05-15 07:23:57 +01:00
vasilito 3129fdccd2 fix: correct VirtIO GPU command opcodes and enable virgl feature
Align 2D command opcodes, response opcodes, and 3D command opcodes with\nthe Linux UAPI definitions in include/uapi/linux/virtio_gpu.h. Enable\nVIRTIO_GPU_F_VIRGL feature negotiation during device initialization to\nactivate the virgl 3D rendering path.
2026-05-15 07:23:40 +01:00
vasilito a23484237c fix: align MMIO mappings to page boundaries for VirtIO capabilities
VirtIO capability structures can start at non-page-aligned offsets within\nBARs. The kernel physmap requires page-aligned addresses. Align the physical\naddress down, adjust the size, and apply the page offset to the returned\npointer. Track the original map pointer/size separately for correct unmapping.
2026-05-15 07:23:25 +01:00
vasilito 8e5792303a fix: correct BAR size probing for non-zero base addresses
The previous BAR size calculation used !(inverted & mask) & mask which\nproduces incorrect results when the BAR has a non-zero base address.\nUse lowest-set-bit extraction (masked & (!masked + 1)) to correctly\ncompute the BAR size from the writable bit pattern read back from hardware.
2026-05-15 07:23:11 +01:00
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00
vasilito 28c97afe8e diag: add full DMA buffer hex dump and descriptor table logging for VirtIO GPU debugging 2026-05-14 10:52:39 +01:00
vasilito 19c65be7b1 feat: VirtIO GPU driver, libdrm DRM ioctls, KWin/KF6 build fixes, display stack additions
- Add full VirtIO GPU driver with command submission, resource management,
  VirtQueue implementation, and transport layer; includes diagnostic probes
  for resource_create_2d ERR_INVALID_RESOURCE_ID investigation
- Expand libdrm Redox support with DRM ioctl wrappers (ADDFB, RMFB,
  CREATE_DUMB, MAP_DUMB, DESTROY_DUMB, GET_RESOURCES, GET_CONNECTOR,
  GET_CRTC, SET_CRTC, MODE_OBJ_GET_PROPERTIES, etc.) and xf86drm_redox.h
- Add redox-drm scheme handlers for VirtIO GPU-specific DRM ioctls
  (VIRTGPU_RESOURCE_CREATE, VIRTGPU_MAP, VIRTGPU_WAIT, VIRTGPU_INFO, etc.)
- Add display stack recipes: freetype2, lcms2, libdisplay-info, libepoxy,
  libxcvt
- Fix KWin build (recipe.toml expanded, kf6-ksvg added)
- Fix KF6 CMakeLists for cross-compilation (attica, kcmutils, kcolorscheme,
  kcompletion, kconfigwidgets, kdeclarative, kiconthemes, kitemmodels,
  kitemviews, kjobwidgets, ktextwidgets, kwayland, kxmlgui, kpty, solid)
- Add Qt6 futex support patch
- Add relibc patches: P3 strtold, P3 ld-so search path, P5 DRM ioctl removal
- Add base P4 pcid config scheme patch
- Update driver-manager hotplug/config, PCI config in redox-driver-sys
- Update greeter compositor and KDE session scripts
- Update AGENTS.md with zero-tolerance stubs policy and project knowledge
2026-05-14 10:31:13 +01:00
vasilito 9012a0b55b docs: update project knowledge base
Update AGENTS.md with current patch chain state, KWin integration
status, and consolidated patch governance.
2026-05-11 10:11:14 +01:00
vasilito daa875fc56 fix: update build system tooling and configuration
Update cookbook fetch.rs for protected recipe handling and atomic
patch application. Update config.mk, device services, and legacy
base configs. Add patch-inclusion-gate script.
2026-05-11 10:10:35 +01:00
vasilito 4e24760a22 fix: update custom recipe implementations
Update cpufreqd, driver-params, firmware-loader, seatd, redox-drm,
and redox-driver-sys. Add XHCI controller quirk table. Update
redbear-compositor protocol handlers.
2026-05-11 10:10:25 +01:00
vasilito d551d5dc41 feat: add display stack dependency recipes
Add lcms2, libdisplay-info, libepoxy, and libxcvt recipes required
by the KWin/Mesa display stack.
2026-05-11 10:10:11 +01:00
vasilito b35977b654 feat: add KWin compositor integration with QML-free build
Add P0-disable-qml-quick.patch for building KWin without QML/Quick
dependencies. Update greeter scripts to prefer kwin_wayland. Enable
kwin in redbear-full config.
2026-05-11 10:09:58 +01:00
vasilito 49f9cb2f29 fix: update KF6 cross-compile build configurations
Patch CMakeLists.txt across 15 KF6 packages for Redox cross-compile.
Add kf6-ksvg recipe for KWin dependency chain.
2026-05-11 10:09:48 +01:00
vasilito e5366f3ce5 fix: update Qt cross-compile toolchain and remove absorbed patches
Remove absorbed qtbase include and OpenGL guard patches. Update
toolchain cmake for cross-compile. Fix QtWayland cursor guards.
2026-05-11 10:09:34 +01:00
vasilito 2b8dd96a5c fix: absorb redundant base daemon and driver patches
Consolidate ~30 absorbed base patches into surviving carriers. Add
new init service files, driver sources, and network/storage modules
for the base recipe. Move absorbed patches to local/patches/base/absorbed/.
2026-05-11 10:09:25 +01:00
vasilito c27a28a0c8 fix: consolidate bootloader patches
Absorb P1-P4 bootloader patches into P5 carrier. Move absorbed
patches to local/patches/bootloader/absorbed/ for reference.
2026-05-11 10:08:39 +01:00
vasilito cfddfe4ebe fix: consolidate relibc patch chain
Remove absorbed prerequisite patches and fd-event test patch. Add
statvfs constants patch. Update recipe.toml wiring.
2026-05-11 10:08:30 +01:00
vasilito 7dfb749b3d fix: consolidate kernel patch chain
Absorb redundant kernel patches into v2 carriers, remove debug and
suspend patches no longer needed. Wire v2 patches in recipe.toml.
2026-05-11 10:08:20 +01:00
vasilito bea8595fd4 docs: update local driver-manager execution notes 2026-05-09 01:34:16 +01:00
vasilito 4c6a53c76d fix: update phase0 boot evidence diagnostics 2026-05-09 01:33:45 +01:00
vasilito 4672ddd20c fix: expose driver-manager boot observability 2026-05-09 01:33:34 +01:00
vasilito bf803aed94 fix: pass driver-manager PCI targets to wifi 2026-05-09 01:33:22 +01:00
vasilito 8ea2ac82ed fix: add driver-core removal lifecycle 2026-05-09 01:33:08 +01:00
vasilito 84416f679e fix: harden driver-manager lifecycle 2026-05-09 01:32:57 +01:00
vasilito c1f2082a72 docs: -i interactive TUI convention in local/AGENTS.md
All Red Bear desktop apps use -i/--interactive for TUI mode.
Pattern: ratatui 0.30 + termion, feature-gated behind 'tui' feature.
Apps: cub, redbear-info, redbear-netctl.
2026-05-08 12:16:19 +01:00
vasilito 987350d9f5 fix: cub -i interactive flag, -S auto-build on Linux 2026-05-08 12:09:51 +01:00
vasilito cd6d23b3b4 fix: cub production recipe, serde_derive import, minor cleanup
- recipe: use cargo install for proper binary installation
- aur.rs: serde_derive for explicit derive path
- main.rs: final noconfirm/force flow cleanup
2026-05-08 11:58:36 +01:00
vasilito 12d773a380 feat: -i interactive ratatui TUI for redbear-info and redbear-netctl
- redbear-info: -i launches ratatui dashboard (System/Hardware/Network/Integrations/Health tabs)
- redbear-netctl: -i wires existing netctl-console ratatui TUI
- Same -i switch convention as cub
- Feature-gated behind 'tui' feature for both apps
2026-05-08 11:56:55 +01:00