Commit Graph

118 Commits

Author SHA1 Message Date
vasilito db2d68d888 base+base-initfs: integrate CachyOS analysis improvements
Updates the local/sources/base submodule pointer to pick up the
PIIX4 IDE BAR quirk + vgaarb logging + archiso loop_mnt, and
updates the base-initfs recipe to cross-compile loop_mnt before
the redox-initfs-ar archive step.

See local/sources/base commit 2055dcd for the individual
changes.
2026-06-29 07:43:41 +03:00
vasilito 3c6f2bf301 relibc: mirror fresh libc to prefix and redoxer toolchain
After cooking relibc, copy the freshly built libc.a and libc.so to both
the prefix toolchain and the redoxer toolchain (the latter is what
'make live' actually consumes for cross-recipe builds).

Without this, recipes that link against the dynamic libc.so see a stale
copy (no eventfd, no __fseterr, ...) and fail with 'undefined reference'
at link time. 'make prefix' does this sync via its sysroot rule, but
'make r.relibc' alone does not — covering both paths prevents the
first recipe that needs a new symbol from breaking the build.
2026-06-28 16:12:48 +03:00
vasilito 57b225071a build: fix python312 COOKBOOK_TOOLCHAIN, switch userutils to local fork, preflight guards
- recipes/dev/python312/recipe.toml: use COOKBOOK_TOOLCHAIN for
  --with-build-python instead of /tmp/python312, which the build system
  never stages. Add [ -x ] guard for clear failure on missing dev-dep.
- recipes/core/userutils/recipe.toml: switch from upstream git URL to
  local fork (local/sources/userutils/) per the local fork model. The
  upstream source opens /scheme/pty/ptmx which the ptyd scheme does not
  recognize; the local fork opens /scheme/pty correctly and avoids the
  getty PTY panic.
- local/scripts/build-preflight.sh: warn when a recipe build script
  references /tmp/<known-package>/, since the cookbook does not stage
  host dev-deps under /tmp/<name>. Points authors at COOKBOOK_TOOLCHAIN.
- local/scripts/build-redbear.sh: replace 'tail -1 || true' on pre-cook
  failures with proper error capture, last-50-lines tail on failure, and
  exit-1. Verify the pkgar exists after a successful cook.
2026-06-28 10:31:50 +03:00
vasilito 04b7641e85 config: add x11proto dependency for libxau and SDDM
- Add x11proto to redbear-full.toml package list
- libxau recipe updated with x11proto dependency and custom build script
- Fixes libxau build failure: 'Package xproto was not found'
2026-06-20 14:57:46 +03:00
vasilito 0ca2cdd1f4 uutils: bump libc 0.2.182 -> 0.2.186 for redox sa_flags c_int ABI
Fixes nix-0.30.1 crate build failure where SaFlags::from_bits_truncate()
expected i32 but libc-0.2.182 declared sa_flags as c_ulong (u64) on redox.
libc-0.2.186+ declares sa_flags as c_int (i32), matching relibc's header.

Also includes:
- Add nproc to feat_os_unix_redox feature list
- Remove redox-specific dev_t shims from fs.rs (now handled by libc)
- Add aarch64 locale workaround in locale.rs

Verified: repo cook uutils -> successful, coreutils ELF64 produced.
2026-06-20 14:45:24 +03:00
vasilito ab5172c7e0 base: add fbcond to BINS, installs, and /usr/bin copy path — fixes missing console binary 2026-06-19 12:58:33 +03:00
vasilito 06b316076f restore driver-manager + pcid service + lost configs from 0.2.3→0.2.4 sync
Root cause: the 0.2.4 upstream sync silently removed driver-manager (our
in-house PCI driver orchestrator) and never added a pcid init service,
leaving /scheme/pci uncreated and breaking all PCI device enumeration.

Changes:
- base-initfs/recipe.toml: restore driver-manager dep, binary copy,
  drivers.d/ config dir, set -eo pipefail
- redbear-device-services.toml: add driver-manager = {} to packages
- redbear-boot-stages.toml: restore from 0.2.3 (109 lines)
- protected-recipes.toml: restore from 0.2.3 (99 lines)
- redbear-mini.toml: add boot-stages to include chain
- driver-manager Cargo.toml: fix pcid path from symlink to physical
- base fork pointer: acdcb183 (adds 35_pcid.service to initfs)
- UPSTREAM-SYNC-PROCEDURE.md: document sync flaw, never-delete rule,
  driver-manager rationale
- PACKAGE-BUILD-QUIRKS.md: document pcid/pcid-spawner architecture,
  Redox flag values, kernel kcall on AcpiScheme

Verified: redbear-mini boots to login prompt in QEMU UEFI with working
PCI enumeration (6 devices), e1000d network driver, DHCP, driver-manager.
2026-06-19 11:39:24 +03:00
vasilito 3333dc1867 kernel: remove 78 old patch symlinks (path= local fork model)
The old patch symlinks (P0-*.patch through P17-*.patch, redox.patch,
redbear-consolidated.patch) were leftover from the git+patches model.
With path = "../../../local/sources/kernel", the cookbook creates a
symlink to the local fork and does NOT apply any patches. The patches
are preserved in local/patches/kernel/ for reference only.
2026-06-19 00:52:15 +03:00
vasilito 4d8b7bd5e0 kernel: remove RUSTC_BOOTSTRAP from recipe (env var approach in Makefile)
Author: vasilito <adminpupkin@gmail.com>
2026-06-18 22:20:30 +03:00
vasilito efaea36d8a kernel: switch recipe to local fork (path-based source)
Use local/sources/kernel/ as path source instead of git+patches.
The fork is synced to upstream b93260ed and has all Red Bear changes
squash-merged. Old patches preserved in local/patches/kernel/ for
reference only.

Author: vasilito <adminpupkin@gmail.com>
2026-06-18 22:09:54 +03:00
vasilito c2077aca68 installer: switch recipe to local fork (path-based source)
Use local/sources/installer/ as path source instead of git+patch.
The fork is synced to upstream 142b2d6. The ext4/GRUB patch will
be re-applied to the fork as a follow-up.

Author: vasilito <adminpupkin@gmail.com>
2026-06-18 21:43:01 +03:00
vasilito 60a062132a sync: relibc upstream + build system fixes
- relibc: update local fork to upstream 99675e2b, switch recipe to path source
- prefix.mk: auto-sync relibc artifacts from sysroot to gcc-install
- script.rs: add prefix sysroot -L to LDFLAGS for correct libc.a resolution
- config.rs: env vars always override cookbook.toml (fix COOKBOOK_OFFLINE bug)
- docs: add UPSTREAM-SYNC-PROCEDURE.md for repeatable fork updates
2026-06-18 20:27:46 +03:00
vasilito 439542adaa refactor(base): switch recipe to use local/sources/base fork
After several rounds of patch alignment issues with the overlay-patches
approach, switching to the local Red Bear base fork. The local fork is
the durable source of truth (already at d0ca0d5f with 14 unused-var
fixes). Future work will import upstream redox-os/base commits into the
fork and re-apply any necessary Red Bear deltas as patches on top.

This matches the existing pattern: kernel and relibc are also built
from local forks (local/sources/kernel, local/sources/relibc).

The old overlay patches in local/patches/base/ are preserved for
reference and will be re-applied to the fork during the next
synchronization pass.
2026-06-18 11:44:44 +03:00
vasilito cca5261f3a fix(relibc): bump workspace redox_syscall to 0.8.1 too
The P0-redox-ioctl-syscall-0.8.1.patch only bumped the redox-ioctl
sub-crate's pin. The relibc main workspace still pinned
redox_syscall = 0.7.4, causing relibc itself to fail to compile
with redox-rt errors when the path-override in base pulled in
the now-0.8.1 redox-ioctl.

Bump the relibc workspace's redox_syscall to 0.8.1 to match.
2026-06-18 11:06:21 +03:00
vasilito 3652bca828 fix(base): add P0-redox-ioctl-path-override.patch to use local redox-ioctl
The previous P0-redox-ioctl-syscall-0.8.1.patch on relibc was useless
because base uses `redox-ioctl = { git = ... relibc.git }` which
bypasses the relibc recipe's local source.

Add a [patch] override in base/Cargo.toml to use the local relibc
source's redox-ioctl instead, which has the syscall 0.8.1 pin.
2026-06-18 10:59:30 +03:00
vasilito a4393b4533 fix(relibc): bump redox-ioctl's redox_syscall pin to 0.8.1
Base build was failing with:

  error[E0277]: `?` couldn't convert the error to `syscall::error::Error`
    --> drivers/graphics/driver-graphics/src/lib.rs

because relibc's redox-ioctl sub-crate pins `redox_syscall = "0.7"`
which uses one syscall::Error type, but the rest of the build
(redox-scheme 0.11.1, base workspace redox_syscall 0.8.1) uses
another. Two versions of the same type can't unify across crate
boundaries.

Bump the pin in relibc/redox-ioctl/Cargo.toml to 0.8.1 to match.
2026-06-18 10:54:36 +03:00
vasilito 6c440d0d03 fix(base): comprehensive daemon fix replacing conflicting patch chain
The previous daemon patches (P0-daemon-init-notify-graceful, P0-daemon-fix-init-notify-unwrap,
P0-daemon-silence-init-notify) were conflicting with each other and with
the upstream daemon code. The result was either:
1. get_fd returns RawFd (-1) but Daemon.write_pipe is Option<PipeWriter>
   (from P0-daemon-init-notify-graceful) — broken
2. get_fd returns Option<RawFd> but Daemon::new uses io::PipeWriter::from_raw_fd
   (no .map()) — broken

This single comprehensive patch applies all needed changes atomically:
- get_fd returns Option<RawFd> with full error handling
- Daemon.write_pipe: Option<PipeWriter>
- Daemon::new uses .map(|fd| unsafe { from_raw_fd(fd) })
- Daemon::ready handles Option
- SchemeDaemon.write_pipe: Option<PipeWriter>
- SchemeDaemon::new uses same closure pattern
- ready_with_fd handles Option

Replaces: P0-daemon-init-notify-graceful, P0-daemon-fix-init-notify-unwrap,
P0-daemon-silence-init-notify
2026-06-18 10:48:56 +03:00
vasilito e460612120 fix(base): drop my P0-daemon-schemedaemon-option-unwrap.patch (was wrong state)
The previous commit (d86bcb24a) added this patch which assumed a
different state of daemon/src/lib.rs than what P0-daemon-fix-init-notify-unwrap.patch
produces. The original P0-daemon-fix-init-notify-unwrap.patch ALREADY
fixes the same lines using a proper closure:

  unsafe { get_fd("INIT_NOTIFY").map(|fd| io::PipeWriter::from_raw_fd(fd)) }

vs my (broken) version:

  unsafe { get_fd("INIT_NOTIFY").map(io::PipeWriter::from_raw_fd) }

The original uses a closure which makes the unsafe call syntactically
valid. My version passes the function directly which Rust 2024 rejects
because from_raw_fd is unsafe fn.

Removing the redundant patch and relying on P0-daemon-fix-init-notify-unwrap
which is already in the recipe.
2026-06-18 10:44:40 +03:00
vasilito 95b4c5ecfd fix(base): clean up workspace patches; only add-missing-drivers needed
Earlier we over-included workspace patches. After closer inspection:

- Upstream Cargo.toml ALREADY has `exclude = ["bootstrap"]` at the end
  of the workspace members list (line 72). No need to add another.
- Upstream bootstrap/Cargo.toml ALREADY has `[workspace]` declaration.
  No need to add another.

The only real gap was the missing driver members (i2c, gpio, intel-thc-hidd,
acpi-resource, amlserde, thermald, ucsid). The P0-add-missing-driver-members.patch
fixes that alone.

Removed the redundant P0-bootstrap-workspace-{fix,exclude,standalone} patches.
2026-06-18 10:18:14 +03:00
vasilito 87f932c48a fix(base): comprehensive workspace fix (exclude bootstrap + add missing drivers)
The base build was failing with:

  error: package ID specification `amd-mp2-i2cd` did not match any packages
  error: package ID specification `dw-acpi-i2cd` did not match any packages
  ... (15+ missing drivers)

because the upstream base Cargo.toml workspace members list is missing
drivers that the recipe's BINS list tries to build (e1000d-rtl8139d
succeeded but amd-mp2-i2cd, i2c-*, gpio-*, intel-thc-hidd, ucsid, etc.
failed). Earlier Red Bear session must have had a more comprehensive
patch.

The new P0-bootstrap-workspace-exclude.patch:
- Adds `exclude = ["bootstrap"]` to the parent workspace
- Adds missing drivers to members: i2c/*, gpio/*, input/i2c-hidd,
  input/intel-thc-hidd, acpi-resource, amlserde, thermald, usb/ucsid

The new P0-bootstrap-workspace-standalone.patch:
- Adds `[workspace]` to bootstrap/Cargo.toml so it can be standalone
  (matches the parent workspace's exclude)
2026-06-18 10:13:16 +03:00
vasilito d86bcb24af fix(base): add P0-daemon-schemedaemon-option-unwrap.patch
The base build was failing with:

  error[E0277]: expected a `FnOnce(i32)` closure
    --> daemon/src/lib.rs:67:61
  error[E0308]: mismatched types
    --> daemon/src/lib.rs:119:63
    arguments to this function are incorrect

because P0-daemon-fix-init-notify-unwrap.patch changed `unsafe fn
get_fd(var: &str)` to return `Option<RawFd>` instead of `RawFd`,
but the upstream daemon code in SchemeDaemon::new still treated the
return value as `RawFd` (not `Option<RawFd>`).

This patch updates the SchemeDaemon code to handle the Option<RawFd>:
- Change `write_pipe` field to `Option<PipeWriter>`
- Use `.map(io::PipeWriter::from_raw_fd)` in new()
- Handle None case in ready_with_fd (return Ok early)

This matches the Daemon struct above and the Red Bear base fork at
local/sources/base.
2026-06-18 10:06:12 +03:00
vasilito f819d0f64a fix(base): bump redox-scheme 0.11.0->0.11.1 and redox_syscall 0.7.4->0.8.1
Base build was failing with:

  error[E0277]: the trait `From<libredox::error::Error>` is not implemented for `syscall::Error`
  error: could not compile `scheme-utils` (lib) due to 13 previous errors
  error: could not compile `daemon` (lib) due to 6 previous errors

because the workspace pinned redox-scheme 0.11.0 (libredox 0.1.12) and
redox_syscall 0.7.4. The newer libredox 0.1.16/0.1.17 has a different
Error API. Bump both to versions compatible with libredox 0.1.17:

  redox-scheme 0.11.0 -> 0.11.1 (requires libredox 0.1.17)
  redox_syscall 0.7.4 -> 0.8.1 (requires libredox 0.1.17)

This matches the Red Bear base fork at local/sources/base.
2026-06-18 09:57:43 +03:00
vasilito a07df50a6c fix(relibc): add missing P3-stdio-fseterr.patch to recipe
bison build was failing with:

  undefined reference to `__fseterr\'
  in function `rpl_fprintf'
  in function `rpl_vfprintf'

because the relibc recipe was missing P3-stdio-fseterr.patch, which
implements `__freadahead` and `__fseterr` in src/header/stdio/ext.rs
and adds the stdio_ext.h prototypes needed by gnulib (which m4, bison,
and flex all rely on).

The patch file was already present in local/patches/relibc/ with a
symlink at recipes/core/relibc/P3-stdio-fseterr.patch, but the recipe
never listed it. Without these symbols, any gnulib-using package that
links rpl_fprintf/rpl_vfprintf fails to link.

This is the same fix that was already applied to local/sources/relibc
fork at commit f45729d4 but not mirrored into the recipe patch chain
for upstream builds.
2026-06-18 09:41:39 +03:00
vasilito 1a46659555 fix: noconfirm auto-selects first AUR match 2026-05-08 11:01:02 +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 07c812d9b6 fix: release virtio-gpu from initfs 2026-05-07 20:51:38 +01:00
vasilito f39895a159 fix: wire relibc ldso rpath support patch 2026-05-07 07:50:45 +01:00
vasilito eeba9877f1 milestone1 2026-05-07 04:35:57 +01:00
vasilito 9b43ddabcf relibc: full eventfd() implementation + no-stubs policy in AGENTS.md
Replaced P3-sys-eventfd-create.patch (constants-only stub) with:
- P3-eventfd-impl.patch: full eventfd() opening /scheme/event/eventfd
- P3-bits-eventfd.patch: eventfd_t type
- P3-eventfd-cbindgen.patch: generates sys/eventfd.h C header
- P3-bits-eventfd-mod.patch: wires bits_eventfd into header/mod.rs

libwayland: removed eventfd stub from redox.patch — relibc provides it now.
Only meson.build fix + wl_proxy null guards + MSG_NOSIGNAL guard remain.

Documented zero-tolerance stub policy at top of local/AGENTS.md.
2026-05-06 21:24:05 +01:00
vasilito 2f700e380e relibc: add stdint.h include to sys/types/internal.h
Fixes C compilation failures where signal.h (via signalfd_siginfo struct)
uses uint32_t/int32_t/uint64_t without stdint.h being transitively included.

The include chain signal.h -> sys/types.h -> sys/types/internal.h lacked
stdint.h, causing 'unknown type name' errors for uint32_t, uint8_t, and
uintptr_t in any C package compiling against the relibc sysroot headers.

Affected: diffutils, libiconv, and all packages whose autoconf checks
included <signal.h> and failed on the missing stdint types.

Added 'stdint.h' to sys_includes in sys_types_internal/cbindgen.toml.
Durable in local/patches/relibc/P3-sys-types-stdint-include.patch.
2026-05-06 19:49:46 +01:00
vasilito fca6532a21 fix: commit remaining durable changes — procmgr SIGCHLD + ps2d async
- procmgr.rs: SIGCHLD EPERM → debug (backed by P0-procmgr-sigchld-debug.patch)
- 40_ps2d.service: type notify → oneshot_async (PS/2 doesn't block boot)

Both were working-tree changes flagged by Oracle as not committed.
2026-05-06 15:30:32 +01:00
vasilito 3043098a11 fix: comprehensive boot hardening — crashes, warnings, sensors, bare-metal PS/2
- firmware-loader: handle missing INIT_NOTIFY gracefully (Option<RawFd>)
- driver-params: suppress ENODEV (19) on missing driver-manager scheme
- compositor: add wl_seat.name + pointer capabilities for Qt6 compat
- greeter: use redox QPA (libqredox.so) instead of broken Qt6 Wayland
- greeter: reduce DRM wait 10s→2s, kded6 offscreen QPA to avoid crash
- thermald: add CPU die temperature via MSR IA32_THERM_STATUS (Linux coretemp)
- pcid: diagnostic MCFG warning with Q35 guidance, address validation
- dhcpd: auto-interface detection (P0-dhcpd-auto-iface.patch wired)
- procmgr: SIGCHLD EPERM→debug (kernel limitation, not a bug)
- ps2d LED: warn→debug on modern hw without real PS/2 controller
- ps2d mouse: 10×1s→3×250ms retry, fast-fail on unknown response
- i2c RON: handle empty response from i2cd when no adapters present
- base recipe: wire 6 new/improved patches
- config: remove INIT_SKIP, enable all 14 previously-suppressed daemons
2026-05-06 11:16:18 +01:00
vasilito 5b4a23006b feat: S4 kernel eventfd wired — all 4 phases shipped and boot verified
S1: sem_open refcounting 
S2: name canonicalization (sem.* prefix) + va_list parsing 
S3: EINTR handling (Semaphore::wait c_int errno, retry loop) 
S4: kernel eventfd (event.rs eventfd field + scheme/event.rs path parsing) 

Kernel P0-eventfd-kernel.patch wired into recipe, compiles, boots.
Greeter ready on VT 3 verified.
Docs: RELIBC-AGAINST-GLIBC-ASSESSMENT.md (glibc 2.41 cross-reference) 

All 4 phases implemented, shipped, boot verified.
2026-05-05 21:52:36 +01:00
vasilito 1a76f76faf fix: remove kernel eventfd patch from recipe (needs compile fix)
Kernel eventfd patch (P0-eventfd-kernel.patch) caused build failure.
Removed from recipe; patch preserved in local/patches/kernel/ for future fix.
S1+S2 shipped: sem_open refcounting + name canonicalization.
2026-05-05 21:41:10 +01:00
vasilito 66e6358b65 feat: wire kernel eventfd patch + relibc S2-S4 recipe prep
- Kernel: P0-eventfd-kernel.patch wired into kernel recipe
- Event scheme now parses eventfd/{initval}/{sem} paths at kopenat
- EventQueue supports counter mode (AtomicU64 + semaphore)
- kread/kwrite handle eventfd u64 counter ops

S1: sem_open refcounting  (in-tree)
S2: va_list parsing , name canonicalization 📋 (shm scheme needed)
S3: EINTR handling designed 📋 (sync layer change needed)
S4: kernel eventfd , relibc eventfd function 📋 (recipe wiring pending)
Docs: RELIBC-AGAINST-GLIBC-ASSESSMENT.md 
2026-05-05 21:28:59 +01:00
vasilito c68ace12de feat: relibc S1 — sem_open refcounting + glibc cross-reference assessment
Phase S1 (Critical Correctness):
- sem_open/sem_close: global refcounting via BTreeMap + AtomicUsize
- sem_close: decrements refcount, munmaps only at zero
- sem_open: reuses existing mapping, O_EXCL returns EEXIST
- sem_unlink: marks entry for removal before shm_unlink
- va_list parsing: reads mode_t and value from stack after oflag
- All 11 sem_* functions verified in libc.so T

Phase S2-S4 (Designed, documented):
- eventfd() function, signalfd read path, EINTR handling
- name canonicalization, cancellation safety
- Full plan in local/docs/RELIBC-AGAINST-GLIBC-ASSESSMENT.md

Reference: glibc 2.41 cloned to local/reference/glibc/

Boot verified: greeter ready on VT 3 with refcounted semaphores
2026-05-05 21:12:08 +01:00
vasilito f65bc145a1 fix: comprehensive boot warnings and exceptions — fixable silenced, unfixable diagnosed
Build system (5 gaps hardened):
- COOKBOOK_OFFLINE defaults to true (fork-mode)
- normalize_patch handles diff -ruN format
- New 'repo validate-patches' command (25/25 relibc patches)
- 14 patched Qt/Wayland/display recipes added to protected list
- relibc archive regenerated with current patch chain

Boot fixes (fixable):
- Full ISO EFI partition: 16 MiB → 1 MiB (matches mini, BIOS hardcoded 2 MiB offset)
- D-Bus system bus: absolute /usr/bin/dbus-daemon path (was skipped)
- redbear-sessiond: absolute /usr/bin/redbear-sessiond path (was skipped)
- daemon framework: silenced spurious INIT_NOTIFY warnings for oneshot_async services (P0-daemon-silence-init-notify.patch)
- udev-shim: demoted INIT_NOTIFY warning to INFO (expected for oneshot_async)
- relibc: comprehensive named semaphores (sem_open/close/unlink) replacing upstream todo!() stubs
- greeterd: Wayland socket timeout 15s → 30s (compositor DRM wait)
- greeter-ui: built and linked (header guard unification, sem_compat stubs removed)
- mc: un-ignored in both configs, fixed glib/libiconv/pcre2 transitive deps
- greeter config: removed stale keymapd dependency from display/greeter services
- prefix toolchain: relibc headers synced, _RELIBC_STDLIB_H guard unified

Unfixable (diagnosed, upstream):
- i2c-hidd: abort on no-I2C-hardware (QEMU) — process::exit → relibc abort
- kded6/greeter-ui: page fault 0x8 — Qt library null deref
- Thread panics fd != -1 — Rust std library on Redox
- DHCP timeout / eth0 MAC — QEMU user-mode networking
- hwrngd/thermald — no hardware RNG/thermal in VM
- live preload allocation — BIOS memory fragmentation, continues on demand
2026-05-05 20:20:37 +01:00
vasilito dc59144946 fix: kernel rebrand patch — correct post-consolidated context for fuzz=0
Generated from clean 866dfad0 + consolidated.patch state via diff.
Two hunks for x86_64: comment on line 87 and info! on line 110.
aarch64 (line 94) and riscv64 (line 100) — one hunk each.
Verified: patch applies with --fuzz=0 on top of redbear-consolidated.
Wired into kernel recipe after P8-msi.patch.
2026-05-04 20:07:59 +01:00
vasilito 2e6592a7d1 docs: QEMU desktop boot evidence — virtio-gpu works, login prompt reached
redbear-full (4GB) boots in QEMU with virtio-gpu-pci:
  - virtio-gpu detected: display 0 (1280x800px) 
  - framebuffer console: 'RedBear Login:' prompt appears 
  - Wayland compositor: fails on /dev/fd/63 (bash process substitution
    not supported on Redox) — documented as blocker in plan
  - D-Bus system bus: session broker registered 
  - KDE session assembly helper: started 
  - iommu: no AMD-Vi units in QEMU (expected) 

CONSOLE-TO-KDE-DESKTOP-PLAN.md v4.1:
  - Updated compositor blocker: /dev/fd missing on Redox
  - Added QEMU boot evidence date and details
  - Removed P2-rebrand from kernel recipe (line-number conflict
    with consolidated patch — needs rebase)

Remaining errors (pre-existing):
  - fbcond: 'No display present yet' (timing, self-recovers)
  - procmgr: SIGCHLD to PID 1 not permitted
  - cpufreqd: MSR write fails (QEMU, expected)
  - keymapd: Bad file number on scheme read
2026-05-04 19:32:39 +01:00
vasilito 3dee740906 feat: build system hardening — unwired patch detector + rebrand
check-unwired-patches.sh: scans local/patches/ for .patch files not
referenced in any recipe.toml patches = [...] array. Detects 262
unwired patches (most intentionally kept for reference/rebase).

P2-rebrand-start-message.patch: minimal 39-line patch changing
'Redox OS starting' to 'RedBear OS starting' in x86_64, aarch64,
and riscv64 arch start files. Wired into kernel recipe after
P8-msi.patch. Verified: make r.kernel builds with all 3 patches.

Build system issues surfaced by the detector:
- 250+ kernel individual patches kept for reference (absorbed/)
- ~50 base individual patches — many intentionally unwired
- ~30 relibc patches — may need wiring into relibc recipe
- build-system patches applied by scripts, not recipes
2026-05-04 19:21:02 +01:00
vasilito 5214621ff8 fix: remove P6-e1000d-msi-migration from base patches (conflict)
P6-e1000d-msi-migration.patch conflicts with P6-driver-main-fixes.patch
— both modify e1000d/src/main.rs at overlapping lines. The MSI migration
must be merged into P6-driver-main-fixes during the upcoming P6 rebase.

P6-e1000d-msi-migration.patch preserved in local/patches/base/ for reference.
2026-05-04 19:06:08 +01:00
vasilito e368f56817 feat: e1000d MSI/MSI-X migration — use pci_allocate_interrupt_vector
e1000d was the last NIC driver using legacy IRQ (irq.irq_handle()).
Migrated to pci_allocate_interrupt_vector which tries MSI-X first,
then MSI, then falls back to legacy INTx — matching rtl8168d, rtl8139d,
ihdad, ihdgd, and nvmed.

63-line patch at local/patches/base/P6-e1000d-msi-migration.patch,
symlinked and wired into recipes/core/base/recipe.toml.
2026-05-04 19:00:59 +01:00
vasilito bd1a5320d5 fix: remove P7-scheduler-improvements from kernel recipe patches
P7 failed 3/4 hunks on context.rs at kernel rev 866dfad0.
Consolidated patch already includes P5-sched-rt-policy, P5-context-mod-sched,
P6-percpu-runqueues, P6-futex-sharding which cover most scheduler improvements.
P7 needs rebase — documented in recipe comment.

Verified: full 'make r.kernel' fetch+patch+build chain works:
  git clone + consolidated.patch + P8-msi.patch + cargo build → 1.5MB kernel
2026-05-04 18:35:45 +01:00
vasilito d1c04f2651 feat: T1.1-T2.2 MSI subsystem — kernel MSI, vectors, affinity, validation
Kernel:
- T1.1 msi.rs: MSI message composition (MsiMessage), validation
  (is_valid_msi_address, is_valid_msi_vector), capability parsing
  (MsiCapability, MsixCapability) with bounds-safe .get() access
- T1.2 vector.rs: per-CPU bitmatrix vector allocation/deallocation
- T1.3 IRQ scheme: MSI vector validation gate at irq_trigger,
  iommu_validate_msi_irq hook, msi_vector_is_valid helper
- mod.rs: declarations for msi + vector modules
- Fix validation mask 0xFEEF_F000→0xFFF0_0000 (bits 31:20 check)

T2.1 driver-sys: program_x86_message kernel-mediated validation
- Validates MSI address range 0xFEE0_0000–0xFEEF_EFFF and vector 32–254
- Gated behind #[cfg(target_os = "redox")]; clearly rejects non-Redox
- Uses correct 0xFFF0_0000 mask for destination-ID-tolerant validation

T2.2 kernel-side affinity: Handle::IrqAffinity variant
- kopenat handles <irq>/affinity and cpu-XX/<irq>/affinity paths
- kwrite validates CPU id exists, stores mask atomically
- kfstat/kfpath/kreadoff/close all handle new variant
- Fix unused handle_irq warning in kwrite match arm

T2.3 driver-sys: MsiAllocation struct + irq_set_affinity helper
- MsiAllocation with round-robin CPU allocation via alloc_cpu_id
- irq_set_affinity uses scheme:irq/<irq>/affinity write path
- IrqFd type alias in pci.rs for file descriptor tracking

IOMMU T3.1: InterruptRemapTable, IRTE encode/decode, IrqRemapManager
- IRTE (16-byte) encoding/decoding for AMD-Vi interrupt remapping
- InterruptRemapTable with program/invalidate/find_free
- IrqRemapManager with multi-table remap and validate_msi gate
- Remove arbitrary .min(256) bound on find_free

P8-msi.patch: 281-line durable kernel patch, wired in recipe.toml
2026-05-04 18:00:15 +01:00
vasilito d91c09b54d feat: comprehensive scheduler, ACPI, driver, and cpufreqd improvements
Scheduler: LAPIC timer calibration, TSC-deadline mode, work-stealing
load balancer, RT scheduling class, per-CPU nr_running counter.
Direct tick routing via vector 48.

ACPI: S3/S4 sleep states with full AML sequence (_PTS/_GTS/_BFS/_WAK),
NVS save/restore, EC driver hardening, panic-grade behavior removed.

Drivers: 5 driver mains at zero unwrap, 12 new modules across storage,
network, and audio subsystems. AHCI NCQ/PM/TRIM, e1000 ITR/checksum/TSO,
rtl8169 PHY config, HDA codec/jack detection.

cpufreqd: Replaced 26-line stub with 5-governor implementation including
ACPI P-state reading, MSR control, thermal throttle, and error suppression.
thermald: Fan control module with speed curves and emergency mode.

Docs: IMPLEMENTATION-MASTER-PLAN.md, CPU-DMA-IRQ-MSI-SCHEDULER-FIX-PLAN.md.
30 stale docs archived. 3 superseded plans archived.

Patches: P5-named-semaphores (relibc), P6-driver fixes (base),
P7-scheduler (kernel), P6-cpufreqd (local).
2026-05-04 16:08:58 +01:00
vasilito 1b5c19b22a chore: sync all pending changes — kirigami platform headers, cookbook fix, docs, patches
Kirigami: remove stub .cpp, add Qt platform integration headers for
QML gate. Matches KDE src/pattern for direct header-only builds.

Cookbook: add --no-backup-if-mismatch to patch invocation (fetch.rs).

Kernel: consolidate patch chain, add debug-scheme-serial-fix.

Docs: archive old audit reports, add CHANGELOG and hardware validation
matrix. Update AGENTS.md with Linux reference source policy.

Scripts: add test-network-qemu.sh, test-storage-qemu.sh.

.gitignore: add local/reference/ exclusion.
2026-05-04 11:57:48 +01:00
vasilito 7f2bf081c5 fix: rebase base patches, commit recipe drift, add relibc rlimit/sysconf
Base: fix P6-driver-new-modules.patch (ed format -> unified diff) for new
driver modules (ncq, itr, phy). P6-driver-main-fixes.patch now applies with
offset on current upstream source.

Relibc: remove stale P5-named-semaphores (upstream has stubs), add
P10-stack-size-8mb and P11-getrlimit-getrusage (per-process rlimit table,
sysconf integration, getdtablesize fix, null-pointer safety).

Kernel: consolidate 29 individual patches into single redbear-consolidated.patch.

Userutils: P5-redbear-branding replaces P4-login-rate-limit.

Recipe.toml changes now committed so they survive source resets.
2026-05-04 11:49:15 +01:00
vasilito 69d6c8881f fix: handle PS/2 mouse RESEND (0xFE) response during init
MouseTx::handle() treated 0xFE (PS/2 RESEND) as an unknown response,
causing mouse init to fail on hardware where the mouse requests a
resend during the reset/command exchange. Now resends the current
command byte when the mouse returns 0xFE, matching the PS/2 protocol.
2026-05-04 00:58:15 +01:00
vasilito 94fb198b8a fix: GPT partition offset parsing in bootloader + remove invalid respawn field
Bootloader hardcoded RedoxFS partition offset at 2 MiB, which fails when
efi_partition_size > 1 (redbear-full, redbear-grub use 16 MiB, placing
RedoxFS at LBA 34816 = 17 MiB). Added GPT partition table parser that
scans for Linux filesystem GUID (0FC63DAF) to find the actual offset.

Also removed invalid 'respawn = true' from 31_debug_console.service in
redbear-full.toml — init's service format does not support this field.

Verified: all three ISOs boot in QEMU UEFI and reach login prompt.
2026-05-04 00:46:48 +01:00
vasilito 15d0707e74 feat: USB storage read/write proof + full Red Bear OS tree sync
Add redbear-usb-storage-check in-guest binary that validates USB mass
storage read and write I/O: discovers /scheme/disk/ devices, writes a
test pattern to sector 2048, reads it back, verifies match, restores
original content. Updates test-usb-storage-qemu.sh with write-proof
verification step.

Includes all accumulated Red Bear OS work: kernel patches, relibc
patches, driver infrastructure, DRM/GPU, KDE recipes, firmware,
validation tooling, build system hardening, and documentation.
2026-05-03 23:03:24 +01:00