Commit Graph

2493 Commits

Author SHA1 Message Date
vasilito 7f5ef461ec docs(native-toolchain): record findings 5-7 and correct the leak direction
rust-native now builds. Records the three defects found getting there
(host/target header leak, the -fno-hardened cross-flag leak, relibc's
duplicate _POSIX_THREADS) and closes the previously-open "unreachable
'pub' item" item, which deny-warnings = false already resolved.

Corrects the gcc-native diagnosis. It read "the host's libstdc++ headers
are being pulled into a target compile"; the direction is the reverse --
relibc's TARGET headers reach a HOST compile through the redoxer
toolchain's mixed include/ directory, so __GLIBC_PREREQ is undefined
where the host headers expect it. That matters for how gcc-native gets
unblocked: the host: package pattern used for rust-native should apply,
rather than reworking GCC's cross-build header model.

Status flipped DEFERRED -> ACTIVE per the 2026-08-05 operator decision.
2026-08-05 15:41:27 +03:00
vasilito 75a33e0430 fix(rust-native): build host bootstrap stages against a pure host LLVM
rust-native failed with ~200 errors inside the HOST's own glibc and
libstdc++ headers while compiling rustc_llvm's llvm-wrapper/*.cpp for
x86_64-unknown-linux-gnu.

rustc_llvm's build script passes `llvm-config --includedir` straight to
the host c++. The redoxer toolchain's include/ is a MIXED directory,
holding relibc's TARGET headers (stdlib.h, features.h, fenv.h, ...)
beside the llvm/ and clang/ ones, so relibc's features.h shadowed
glibc's, __GLIBC_PREREQ was never defined, and every host header testing
it failed:

    /usr/include/c++/16/x86_64-pc-linux-gnu/bits/os_defines.h:44:19:
    error: missing binary operator before token '('

Reproducible in three lines with no rustc involved:

    printf '#include <cstdlib>\nint main(){}' > t.cpp
    c++ -std=c++17 -I${HOME}/.redoxer/x86_64-unknown-redox/toolchain/include -c t.cpp

This is the same leak recorded as gcc-native's stopping point in
local/docs/NATIVE-TOOLCHAIN-WORKSTREAM.md -- one root cause, both
recipes -- though in the opposite direction to what that note assumed:
target headers reaching a host compile, not the reverse.

Fixed with host:llvm-native (+ .dev/.runtime). Host deps stage into
COOKBOOK_TOOLCHAIN, a tree SEPARATE from the target sysroot, so the
GNU/Linux libLLVM.so.21.1 cannot collide with the Redox one llvm21
stages -- the collision this recipe's llvm21 comment already records.
Its include tree holds only llvm/, llvm-c/, clang/, clang-c/, lld/. An
unset COOKBOOK_TOOLCHAIN is now a hard error rather than a silent
fallback to the polluted path.

Second defect, exposed by the first fix: DYNAMIC_INIT exports
CXXFLAGS=-fno-hardened for the GCC 16 cross compiler, and the unset list
dropped CC/CXX/LDFLAGS but not CFLAGS/CXXFLAGS/CPPFLAGS. cc-rs falls
back to the generic CXXFLAGS when the target-specific one is empty and
handed it to the host c++, which now resolves through
COOKBOOK_TOOLCHAIN/bin to llvm-native's clang++:

    rustc_llvm@0.0.0: c++: error: unknown argument: '-fno-hardened'

A pre-existing leak: the cross recipes/dev/rust carries the same unset
list and never hit it only because nothing puts a clang on its PATH.
llvm-native's own recipe already unsets these three for this reason.

Target-side compilation is unaffected: config.toml pins cc/cxx/ar/linker
for the Redox triple, and the target RUSTFLAGS are captured into
CARGO_TARGET_<ARCH>_UNKNOWN_REDOX_RUSTFLAGS before the unset.

Also carries earlier uncommitted working-tree changes to this recipe
that the build depends on: the explicit relibc dependency, the
llvm-native -> llvm21 switch for the Redox-hosted rustc, and the
COOKBOOK_HOST_SYSROOT assignment, plus deny-warnings = false in
config.toml.

Verified: rustc, cargo, rustdoc, rustfmt, clippy-driver and
librustc_driver-*.so stage as Redox binaries -- ELF interpreter
/lib/ld64.so.1, OS/ABI System V, NEEDED libc.so.6 from relibc.
2026-08-05 15:41:10 +03:00
vasilito 5f7a2f2979 fix(rust): scrape licence notices for path dependencies
generate-copyright builds COPYRIGHT.html by reading each dependency's
licence files out of the bootstrap vendor directory. In-tree crates are
filtered out earlier (reuse covers them), so everything reaching
load_important_files is assumed to have been vendored.

cargo vendor only vendors REGISTRY sources. The libc fork arrives as a
[patch.crates-io] PATH dependency (02-libc-redox-fork.patch) living at
local/sources/libc, outside the rust tree -- neither in-tree nor
vendored. Joining the vendor root produced a directory that does not
exist, and read_dir failed the whole install step with a bare

    Error: I/O Error: Os { code: 2, kind: NotFound }

naming no crate and no path, after the compiler had already built.

A path dependency's licence files live beside its own Cargo.toml, and
for such a crate that directory is the source of truth -- our fork ships
LICENSE-APACHE and LICENSE-MIT there. Falling back to the manifest
directory keeps those notices IN COPYRIGHT.html rather than dropping
them, which matters under the free/libre software policy in
local/AGENTS.md. Suppressing the step would have lost them.

The manifest directory is threaded from get_metadata (which holds the
full cargo_metadata::Package) to load_important_files and dropped again,
so get_metadata_and_notices keeps its existing public return type.

Patch ordering: 03 must follow 02, which introduces the path dependency
that makes it necessary.

Upstream-reportable: any downstream using [patch.crates-io] with a path
source hits this.
2026-08-05 15:40:48 +03:00
vasilito 5c9696e5bd gitlink bumps: kernel (irq gate removal) + base (pcid MSI remap helpers)
kernel: f502fb09 - remove iommu_validate_msi_irq gate
base:   61d19643 - pcid/msi BDF-aware remapped message helpers
2026-08-05 15:34:43 +03:00
vasilito 1de0326398 iommu: AMD-Vi interrupt-remapping structural correction
IVRS parser (acpi.rs):
- Parse IVHD type 0x40 (40-byte header, same layout as 0x11)
- Parse IVMD types 0x20/0x21/0x22 into IvmdInfo struct
- IVMD scope determined by type, exclusion by flags (bit 4 = EXCL_RANGE)
- UNITY read/write flags applied independently
- Fix IVHD header size: 24 bytes for 0x10, 40 for 0x11/0x40

Interrupt remap table (interrupt.rs):
- Remove global 16-byte IRTE assumption
- IRT format selected per-unit from IVHD EFR field (GASup bit)
- Legacy32 (4-byte) vs GA128 (16-byte) IRTE formats
- EFR-driven encode/decode for both formats
- Remapped MSI address and direct-APIC message encoding helpers
- Restructure: lib crate (lib_core.rs) for host-testable pure logic

Build restructure:
- Split into lib (acpi, interrupt) and bin (redox-specific) targets
- Feature-gate redox-driver-sys behind 'redox' feature
- Host-runnable tests: cargo test --lib --no-default-features

Kernel: remove unconditional-true iommu_validate_msi_irq gate
pcid/msi: add remapped_message_address/data helpers for BDF-aware MSI
Self-test: IRTE programming verification on first device use

Tests: 23/23 pass (10 acpi + 13 interrupt)
2026-08-05 15:34:14 +03:00
vasilito a0537c17ab docs(ryzen-x670e): todo 17 MCFG segment handling + base gitlink 2026-08-05 15:26:21 +03:00
vasilito 86ebade09b chore(base): bump submodule/base to feat(acpi): two-pass _OSC negotiation + _REG opregion-connect wiring 2026-08-05 15:20:44 +03:00
vasilito b7cf00a5e2 relibc: bump gitlink for duplicate _POSIX_THREADS fix 2026-08-05 14:55:03 +03:00
vasilito 62e91e7d96 docs(plan): add Ryzen 7000 / X670E host compatibility plan 2026-08-05 14:52:51 +03:00
vasilito dc2fda2a89 feat(quirks): add MS-7D70 (X670E CARBON WIFI) DMI profile 2026-08-05 14:45:39 +03:00
vasilito ec09b7d990 base: bump gitlink for ps2d bounded-read fix + acpid power-resource engine (tasks 8,11); evidence: task-11 new, task-3 capture re-run (AMDIF031 confirmed, Raphael iGPU BIOS-disabled) 2026-08-05 14:45:26 +03:00
vasilito 98bb16cc99 feat(scripts): Rust X670E host evidence capture kit + initial artifacts
- capture-host-evidence: Rust tool (26 tests) collects lspci, iomem, cpuinfo,
  lsusb, firmware, bridge/BAR topology, baselines verification, iGPU instructions,
  MADT analysis. Collectors have root-file fallback for capture-root.sh integration.
- capture-root.sh: sudo helper for acpidump, dmidecode, dmesg, nvme id-ctrl,
  USB debug, full lspci. Raw ACPI binaries → ~/redbear-evidence-raw/ (outside repo).
- madt.rs: full MADT parser (14 tests) with real-parse integration when raw-apic.dat
  is available. Synthetic report when root not yet available.
- redact.rs: auto-redacts serial numbers, MACs, UUIDs. Secret scan zero hits on
  all 8 committed evidence files.
- baselines.toml: F2 immutable diff baselines with operator-specified SHAs.
- Evidence: AMDIF031 CONFIRMED in iomem (address zeroed non-root), Raphael iGPU
  (1002:164e) NOT ENUMERATED (BIOS-disabled, NVIDIA RTX 4080 dGPU present),
  `/sys/class/graphics/fb0` reports nvidia-drmdrmfb.

Plan: .omo/plans/ryzen-7000-x670e-compat.md todo 3
2026-08-05 14:33:58 +03:00
vasilito c603b72e83 docs(matrix): annotate MS-7D70 availability (compile-only baseline) 2026-08-05 14:30:36 +03:00
vasilito 89878addce base: bump gitlink for RSDP contract, GPE dispatch, NVMe HMB, UAS, ps2d (tasks 9,10,18,19,8)
redbear-ci / check (push) Has been cancelled
2026-08-05 12:34:46 +03:00
vasilito 384e221216 kernel: bump gitlink for i8042 verdict + TSC fixes (task 8) 2026-08-05 12:34:45 +03:00
vasilito b51aa9503f policy: upstream scheme compatibility is ABSOLUTE; kernel: bump gitlink
redbear-ci / check (push) Has been cancelled
New SCHEME COMPATIBILITY POLICY: upstream Redox schemes are frozen
contracts (paths, listing formats, semantics, error codes); Red Bear-only
schemes may be introduced but must never collide with upstream namespaces;
the 2026-08-05 cpu-NN regression is recorded as the canonical violation.
Kernel gitlink bump carries the {:02x} listing revert.
2026-08-05 11:32:02 +03:00
vasilito 501a06434f kernel: bump gitlink for irq scheme path-parse fix 2026-08-05 11:14:50 +03:00
vasilito a287fe20b9 toolchain: remove the GCC 13 path; document the GCC 16 transition
redbear-ci / check (push) Has been cancelled
Operator decision 2026-08-05: "we will not have gcc 13." The cross
toolchain has been GCC 16.1.0 since the port landed, but the build system
still defaulted to GCC 13 in three places and nothing recorded the move.

Build system:
- mk/prefix.mk: GCC_RECIPE?=gcc13 -> gcc16.
- mk/prefix.mk: the HOSTED_REDOX package rule derives its names from
  $(GCC_RECIPE) instead of hardcoding gcc13.pkgar / gcc13.cxx.pkgar.
  static.redox-os.org publishes no gcc16 package, so that path now fails
  at download. Deliberate: a loud failure beats a wrong compiler.
- build-redbear.sh: refuse to build on a non-GCC-16 toolchain. This is
  the one that mattered on a Linux host. `make prefix` unpacks upstream's
  gcc-install.tar.gz, which IS GCC 13.2.0, and no make rule replaces it --
  GCC 16 arrives only via install-gcc16-toolchain.sh. A fresh prefix
  therefore put you silently back on GCC 13, surfacing ~40 minutes later
  as a kwin C++23 failure. The guard checks all three locations
  (gcc-install, sysroot, ~/.redoxer/<target>/toolchain -- the last has
  highest priority) and names the two scripts to run.

Docs:
- New local/docs/TOOLCHAIN-GCC16.md: why the move (kwin/plasma-workspace
  need std::ranges::to), build/install/rollback procedure, the three
  locations that must agree, the tree-wide -std=gnu17 and -fno-hardened
  consequences, and the open libstdc++ float16-formatter gap that
  currently blocks the kwin link.
- CHANGELOG, docs/README.md index and state summary, and the stale claim
  in NATIVE-TOOLCHAIN-WORKSTREAM.md that gcc13 "still builds the GCC 13
  cross toolchain".

Also corrects stale references found while auditing:
- AGENTS.md described prefix/ as "Clang/LLVM"; it is GCC 16.1.0 + LLVM + Rust.
- AGENTS.md cited local/reference/linux-7.0/ (tree is linux-7.1).
- AGENTS.md's durable-patching example cited a mesa patch that does not
  exist; replaced with one wired in recipe.toml. (The first replacement
  used patch 03, which the changelog records as orphaned -- it targets a
  file removed from Mesa 26.1.4 upstream.)

native_bootstrap.sh still installs gcc13/gcc13.cxx packages inside a
Redox VM. Left alone: that is the deferred gcc-native workstream and no
gcc16 package is published for Redox to point it at.

Verified: bash -n clean; make -n prefix parses; guard accepts the current
16.1.0 toolchain in all three locations and rejects a stubbed 13.2.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 10:11:06 +03:00
vasilito 656fa6b88b r8125d: rewrite event loop against the real EventQueue/NetworkScheme API 2026-08-05 09:41:46 +03:00
vasilito f522dc497f r8125d: implement NetworkAdapter trait for the Redox target 2026-08-05 09:33:12 +03:00
vasilito d94fed87c2 r8125d: add redox_event dep; replace panic paths with typed log-and-exit handling 2026-08-05 09:26:05 +03:00
vasilito 4ecf8ab0c0 base: bump gitlink for netstack manifest fix
redbear-ci / check (push) Has been cancelled
2026-08-05 09:11:11 +03:00
vasilito 0182ab84f7 base: bump gitlink for recovered netstack/rtl8168d work; r8125d: fix recipe source path
redbear-ci / check (push) Has been cancelled
2026-08-05 09:03:42 +03:00
vasilito d1e1181baa feat(wifi): MT7922 firmware staging + wifictl backend + driver wiring
redbear-ci / check (push) Has been cancelled
2026-08-05 08:43:50 +03:00
vasilito 1870a2687c redox-driver-sys: error-path and formatting cleanup; driver-manager: pub(crate) registry for config tests
redbear-ci / check (push) Has been cancelled
2026-08-05 08:38:23 +03:00
vasilito 5c4f7d2580 docs(gpu): DCN315 closure record + AGENTS.md surface list (closure-first)
redbear-ci / check (push) Has been cancelled
2026-08-05 08:29:51 +03:00
vasilito 1625af95d3 test(gpu): Raphael read-only probe + BAR/IP/ATOM inventory 2026-08-05 08:29:49 +03:00
vasilito 3ffa5f5755 feat(drivers): redbear-mt7922 Rust SoftMAC + station/supplicant core 2026-08-05 08:29:48 +03:00
vasilito 56a414422c docs(plan): deferred-with-docs table for X670E
redbear-ci / check (push) Has been cancelled
2026-08-05 07:50:38 +03:00
vasilito 4f5588aeec feat(drivers): r8125d PHY/firmware/integration + redbear-info fix 2026-08-05 07:50:38 +03:00
vasilito 5b00f3a0f5 feat(drivers): mt76 C transport (WFDMA/Connac/MCU/reset) 2026-08-05 07:50:37 +03:00
vasilito 5dcec76502 feat(gpu): Raphael firmware staging + per-ASIC manifest resolution 2026-08-05 07:50:36 +03:00
vasilito 80f78e673b feat(power): redbear-k10tempd (Family 19h thermal) 2026-08-05 07:50:35 +03:00
vasilito 35819c560f feat(power): AMD CPPC cpufreq path (Zen4 MSR, correct set) 2026-08-05 07:50:34 +03:00
vasilito 64222aa8e2 feat(audio): widen ihdad match to AMD HDA 1022:15e3 2026-08-05 07:50:32 +03:00
vasilito f9ec1120ac feat(quirks): xHCI parity for X670E ASMedia/AMD controllers 2026-08-05 07:50:31 +03:00
vasilito 6121125c38 redbear-threadtest: import AtomicU32 and Ordering in l1_futex
l1_futex.rs uses AtomicU32::new and Ordering::SeqCst but imported neither, so
the crate did not compile:
  error[E0433]: cannot find type `Ordering` in this scope   (x4)
  error[E0433]: cannot find type `AtomicU32` in this scope

Same class as the kernel errors fixed a moment ago: committed first-party code
that does not build, invisible while the package was served from cache. The
relibc bump invalidated the cache and both surfaced in the same run.

Verified: cook redbear-threadtest - successful.
2026-08-05 03:41:50 +03:00
vasilito 384ce70355 fix(drivers): drop stray self-referential symlink in redbear-r8125d recipe dir 2026-08-05 03:39:13 +03:00
vasilito d6a4c23914 feat(drivers): redbear-r8125d core (RTL8125 MAC/rings/descriptors) 2026-08-05 03:38:27 +03:00
vasilito c582410827 kernel: advance submodule for two build-breaking type errors
The kernel had been served from cache for the whole session; a relibc bump
forced a real rebuild and exposed two committed type errors (madt/mod.rs
pattern against into_iter's owned tuples, and a usize/u64 comparison in
scheme/irq.rs). Neither was introduced here.
2026-08-05 03:34:25 +03:00
vasilito 68a4a45e5b plasma-desktop: force HAVE_X11=0; KWindowSystem X11 needs Qt's xcb platform
plasma-desktop compiled deep into its tree (105 packages cooked) and failed on
  applets/taskmanager/backend.h:16: fatal error: netwm.h
because adding the X11 libraries made find_package(X11) succeed, so
CMakeLists.txt:211 set HAVE_X11=1 -- and the code then legitimately includes
KWindowSystem's X11-only headers, which our KWindowSystem does not install.

I tried the coherent fix first: KWINDOWSYSTEM_X11=ON. It fails because Qt here
is built without the xcb platform:
  src/platforms/xcb/kxerrorhandler_p.h:15: fatal error: private/qtx11extras_p.h
That header ships only with Qt's X11 support, so enabling KWindowSystem X11
cascades into rebuilding qtbase with the entire xcb plugin stack. Too large to
start mid-build; reverted with the reason recorded at the flag.

So HAVE_X11=1 asserts "Qt/KDE X11 integration is available", which is false
here. Forced to 0 -- the honest value -- and the gating script compiles those
paths out. The X11 libraries remain, because they ARE required: X11 is TYPE
REQUIRED in plasma-desktop and libxcb is needed unconditionally.

Also promotes xcb-util-keysyms and xcb-util-wm (built and staged:
libxcb-keysyms.a, libxcb-icccm.a, libxcb-ewmh.a), which KWindowSystem X11 would
need and which are cheap to have available.
2026-08-05 03:27:31 +03:00
vasilito ec4015ad58 test(threading): substrate validation suite 2026-08-05 03:19:20 +03:00
vasilito 5327f36716 base: bump gitlink for acpid bounded S5 + reset-reg/8042 reboot (task 7) 2026-08-05 03:19:19 +03:00
vasilito 9068b278b5 kernel: bump gitlink for MADT normalization (task 5) 2026-08-05 03:19:16 +03:00
vasilito 9bb2de2c14 docs(matrix): annotate MS-7D70 availability (compile-only baseline) 2026-08-05 02:42:24 +03:00
vasilito 5d283452ec feat(scripts): Rust X670E host evidence capture kit + initial artifacts 2026-08-05 02:42:22 +03:00
vasilito c06e51c496 docs(plan): add Ryzen 7000 / X670E host compatibility plan 2026-08-05 02:42:16 +03:00
vasilito 1cbbc66fa4 quirks: add MSI MPG X670E CARBON WIFI (MS-7D70) DMI anchor + loader test
Pre-existing uncommitted first-party work, surfaced by the first-party
integrity gate. Committing rather than reverting: this code exists nowhere but
this project, so a revert would destroy it outright, and it is coherent and
self-consistent -- a DMI entry for the board plus a test in toml_loader.rs that
parses the REAL 50-system.toml and asserts the entry matches while LG entries
do not.

The quirk carries no flags by design; its comment states it is a bare-metal
anchor so future board-specific quirks can be added precisely. Related to the
Ryzen 7000 / X670E work in .omo/plans/ryzen-7000-x670e-compat.md.

Not authored in this session -- committed here because it blocked every build
and the gate's guidance is to commit or revert, and reverting irreplaceable
work is the wrong call.
2026-08-05 02:33:36 +03:00
vasilito 15d67086c8 plasma-desktop: overlay host build-time generators
plasma-desktop cleared configure and failed in the build:
  /bin/sh: .../sysroot/lib/libexec/kf6/kconfig_compiler_kf6: cannot execute
KF6 exports these generators as imported targets whose IMPORTED_LOCATION is the
TARGET (Redox) binary in the sysroot, so cmake tries to run a Redox ELF on the
build host.

Overlays the HOST binary onto the path the imported target points at. Their
output is plain text/XML, so a host build is equivalent, and this keeps the
features ENABLED rather than switching them off. Same block plasma-workspace
already carries -- verified /usr/lib/kf6/kconfig_compiler_kf6 exists on this
host before relying on it.
2026-08-05 02:30:48 +03:00
vasilito bf05bf1123 x11: promote libxkbfile; clear build dirs stranded by the wip move
kcms/keyboard links X11::xkbfile (CMakeLists.txt:37) and cmake aborted with
"Target kded_keyboard links to X11::xkbfile but the target was not found".
libxkbfile was sitting in recipes/wip/x11; promoted, given its util-macros
dependency, and wired into plasma-desktop and the config.

Also clears 9 build directories stranded by the earlier `git mv` out of wip.
Autotools bakes the absolute srcdir into its generated Makefiles, so a moved
recipe keeps building against a path that no longer exists:
  No rule to make target
  '.../recipes/wip/x11/libxkbfile/source/src/cout.c', needed by 'cout.lo'
The cook-side auto-invalidation added earlier only inspects CMakeCache.txt, so
autotools recipes are not covered by it -- these were latent failures that
would have surfaced one package at a time (libx11, libxcb, libxdmcp, libxft,
libxrender, x11proto, x11proto-kb, xcb-proto, xtrans).

Verified: cook libxkbfile - successful, libxkbfile.a staged.
2026-08-05 02:24:19 +03:00