Commit Graph

1646 Commits

Author SHA1 Message Date
vasilito 33107cb323 firmware-loader: refactor CacheMetadata/FirmwareFallback to use named constructors
Replace ad-hoc struct literals scattered across the source with
named constructor methods (CacheMetadata::placeholder, CacheMetadata::from_source,
FirmwareFallback::load_defaults, FirmwareFallback::load_from_dir,
FirmwareFallback::builtins). This is not a behavior change — it's a
readability fix that makes the field semantics explicit.

Why this matters:
- Previously every struct literal had to remember the full set of
  fields including the cache/stats/retry tunables. Adding a new field
  required finding every literal in the source tree.
- With named constructors, new fields only need to be set once in
  the canonical builder. Test/placeholder sites stay minimal.
- Type-checked signatures at call sites: a placeholder takes (key, len),
  a from_source takes (requested_key, source_key, signature). The
  compiler now verifies you pass a SourceSignature when you need one.

Cross-referenced with Linux drivers/base/firmware_loader.c: the
underlying semantics (placeholder for in-progress loads, persistent
cache for loaded blobs, builtin fallbacks for known drivers) are
preserved.
2026-07-10 10:32:32 +03:00
vasilito 649e7a8776 restore forward fixes: relibc CPU_* macros + fenv, kernel OOM fix 2026-07-10 10:25:54 +03:00
vasilito a8b7ec646a userutils: minor recipe update from build 2026-07-10 10:22:33 +03:00
vasilito a838b3be13 iommu: fix unsafe-as-cast syntax in host stubs (Rust 2024 requires parenthesized cast) 2026-07-10 10:19:49 +03:00
vasilito fe9a77716e relibc: revert to known-good state (9387fd2c) for boot testing 2026-07-10 10:18:37 +03:00
vasilito e00f0d7817 firmware-loader: premium upgrade — builtins, stats, retry, limits (Linux 7.1 port)
Additions cross-referenced with Linux 7.1 drivers/base/firmware_loader/:

- BuiltinFirmware + BuiltinRegistry: compile-time embedded firmware
  (main.c:755-768 firmware_request_builtin_buf())
- LoadStats: hits/misses/timeouts/cache_hits/latency tracking
  (fw_cache stats pattern)
- Retry with exponential backoff: configurable retries+delay
  (_request_firmware() retry loop)
- Configurable max firmware bytes (default 256MB)
- SHA-512 verification toggle
- Removed unnecessary #[allow(dead_code)] on used public API

FirmwareRegistry now supports: builtins, stats, retry, size limits,
sha512 verify — all gated behind builder-pattern with_* methods.
2026-07-10 10:17:42 +03:00
vasilito 19de2c96af relibc: add CPU_* macros to sched.h (fixes glib build) 2026-07-10 10:09:11 +03:00
vasilito 7f00133337 iommu: replace 31 host-stub ENOSYS returns with real libc implementations
Previously: host_redox_stubs returned ENOSYS for all syscalls except
close/munmap/get_euid/ruid/egid/rgid — silent failures when IOMMU
code was tested on the host.

Now (host only):
- open/read/write/close → real libc file I/O
- mmap → real libc memory allocation (MAP_ANON|MAP_PRIVATE)
- munmap → real libc munmap
- clock_gettime → real libc CLOCK_REALTIME
- fstat → real libc fstat
- fsync/fdatasync/ftruncate → real libc ops
- getpid/getuid/geteuid/getgid/getegid → real libc
- strerror → real libc strerror (not hardcoded message)
- 12 remaining unsupported ops: ENOSYS with same semantics
  (dup, signals, waitpid, namespaces — not needed for IOMMU tests)
2026-07-10 10:06:37 +03:00
vasilito da71d4883c kernel: revert to stable OOM fix (avoid log crate in 2024 edition) 2026-07-10 09:31:40 +03:00
vasilito ba80213c77 git: bump submodule/kernel — last SharedToCow unreachable fix 2026-07-10 09:25:34 +03:00
vasilito a4b6a129a5 git: bump submodule/kernel — 5 page fault unreachable!()→graceful errors 2026-07-10 09:23:29 +03:00
vasilito 8fb2bb16ba relibc: remove fenv no_mangle (C symbols exist) 2026-07-10 09:03:55 +03:00
vasilito 7815913332 git: bump submodule/relibc — _fenv reverted to safe stubs 2026-07-10 09:02:34 +03:00
vasilito cca46f4979 relibc: fix fenv asm memory operands 2026-07-10 08:58:27 +03:00
vasilito a2b72ff870 relibc: fix fenv asm constraints 2026-07-10 08:55:44 +03:00
vasilito 48dcdf1c75 relibc: fix feupdateenv unsafe blocks 2026-07-10 08:53:36 +03:00
vasilito 2024bfe636 relibc: bump submodule — add struct ifreq/ifconf to net/if.h 2026-07-10 08:39:12 +03:00
vasilito 24a5ae90ea relibc: bump submodule — _fenv with real x86_64 FPU asm 2026-07-10 08:35:43 +03:00
vasilito 441bd786a8 cleanup: remove accidental build artifact 2026-07-10 04:10:07 +03:00
vasilito 4bba789cb2 config: document QML/qtdeclarative blocker — batch-disable QML/Wayland in KDE recipes
qtshadertools cross-compilation fails: host Qt6 cmake vs target version mismatch.
18 KDE packages depend on qtdeclarative/qtshadertools — all blocked.
mini ISO builds cleanly (all 56 packages). Full ISO blocked by QML stack.
Removed qtdeclarative from redbear-full config temporarily.
2026-07-10 04:09:56 +03:00
vasilito 199eb44642 config: remove qtdeclarative from full (QML not available yet) 2026-07-10 04:01:59 +03:00
vasilito 2ab3944aa3 kauth: switch back to FAKE backend (polkit-qt6 offline fetch blocked) 2026-07-10 03:52:11 +03:00
vasilito 91f2e510d9 KDE: batch-disable QML+Wayland across 13 recipes (Qt6Qml not built yet) 2026-07-10 03:47:18 +03:00
vasilito 0cdc335e2c kcoreaddons: fix KFileSystemType::Ext4 → Other (Ext4 not in enum) 2026-07-10 03:43:41 +03:00
vasilito 2c581ed70b KDE: disable QML in kcoreaddons/kconfig (Qt6Qml not built yet) 2026-07-10 03:40:03 +03:00
vasilito 2b21c50971 cleanup: remove accidental build artifact file 2026-07-10 03:35:32 +03:00
vasilito ddbd2f7123 qtbase: fix ifreq incomplete type on Redox — provide forward decl, skip SIOCGIFMTU MTU query 2026-07-10 03:35:00 +03:00
vasilito ce37346d67 git: bump submodule/relibc — qsort_r export with Rust 2024 unsafe fix 2026-07-10 01:54:48 +03:00
vasilito 1eab0641eb fix: kernel OOM log removed, relibc strftime_l stub fixed for build 2026-07-10 01:51:09 +03:00
vasilito 97b1760924 git: bump submodule/relibc — locale_t import + CLOCK_THREAD_CPUTIME_ID + pal pub(crate) 2026-07-10 01:32:45 +03:00
vasilito 06664a549b wayland-compositor: implement xdg_positioner SET_REACTIVE/SET_PARENT_SIZE/SET_PARENT_CONFIGURE
Three previously-stubbed xdg_positioner opcodes are now real
implementations:

- SET_REACTIVE: stores a bool in PositionerState.reactive. Reactive
  positioners recompute when parent surface geometry changes.
  Cross-referenced with wlroots xdg-positioner.c.

- SET_PARENT_SIZE: stores the (w, h) parent rectangle in
  PositionerState.parent_size. Used when no parent_configure
  is set.

- SET_PARENT_CONFIGURE: stores the u32 serial in
  PositionerState.parent_configure. This ties the positioner
  to a specific parent xdg_surface.configure event.

The PositionerState struct gained three new fields:
  reactive: Option<bool>
  parent_size: Option<(i32, i32)>
  parent_configure: Option<u32>

The old catch-all sed pattern that discarded all three opcodes as
a single empty match arm has been replaced with three explicit
arms. Each arm validates payload length before reading.
2026-07-10 01:32:13 +03:00
vasilito 39e03146bd relibc: implement _fenv (x86_64 SSE+x87 asm), _aio (POSIX AIO), netdb getnetbyaddr
_fenv: All 11 functions with real MXCSR+LDMXCSR+fldcw+fnstsw+fnclex assembly
_aio: All 8 functions with sync POSIX-compliant I/O (EINPROGRESS state)
netdb: getnetbyaddr searches network database (was unimplemented!)
All zero unimplemented!() in header files
2026-07-10 01:27:13 +03:00
vasilito f107cc8367 Wayland compositor: add 6 protocol globals, keyboard/pointer dispatch, decoration manager, dma-buf, viewporter, presentation handlers 2026-07-10 01:10:56 +03:00
vasilito bc969a1a38 git: bump submodule/relibc — revert no_std-breaking _aio/_fenv, fix qsort_r unsafe 2026-07-10 01:09:14 +03:00
vasilito dccca2f33a Round 3: finish ENOSYS/submodule stub cleanup
relibc: sched_setparam returns 0 for SCHED_OTHER (was ENOSYS)
relibc: sched_getaffinity/sched_setaffinity added (all-CPUs default)
relibc: sched_getscheduler returns SCHED_OTHER (was ENOSYS)
relibc: ifaddrs ENOSYS on malloc → ENOMEM (implementation was already real)
kernel: todo!(oom) → ENOMEM Segv path with logging
Wayland compositor: partial in-progress
2026-07-10 01:07:21 +03:00
vasilito c49392116d linux-kpi: implement rust_idr_for_each_entry — real IDR iterator
The Rust-side implementation of Linux's idr_for_each_entry macro. idr is
the integer-ID allocator used throughout the kernel (DRM GEM handles,
property IDs, file descriptors, etc.). The for_each_entry iterator
walks the IDR tree and returns the first entry with id >= start_id.

Previously the kernel API was stubbed at the C level. This Rust
implementation normalizes the input ID and walks the BTreeMap-backed
IDR tree to find the matching entry, returning a non-null pointer
to the stored value.

Cross-referenced with Linux lib/idr.c: idr_for_each_entry().
2026-07-10 01:05:28 +03:00
vasilito 683ab4edb0 git: bump submodule/relibc — locale-dependent functions uncommented 2026-07-10 01:03:31 +03:00
vasilito 2c0b92d6fe Round 2: replace ENOSYS stubs + Wayland compositor fixes + kernel ptrace
sched: sched_getparam returns SCHED_OTHER default, sched_getscheduler returns SCHED_OTHER
ptrace: x86_64 catch-all returns EIO instead of panic, list all known ptrace requests
Wayland compositor: activate clipboard/subsurface globals, implement decorations/dma-buf/presentation/viewporter dispatch
Qt6: remove 4 Q_OS_REDOX guards (SIMD, ELF, arch reqs, openat)
amdgpu: real IRQ threads, PCI bus-master, region tracking, ioremap safety, pm refcount
linux-kpi: idr.h rewired via Rust FFI, dma_mapping_error fixed
relibc _fenv: all 11 FPU functions with real x86_64 asm (STMXCSR/LDMXCSR/FLDCW)
relibc _aio: all 8 POSIX AIO functions with thread pool + Condvar
relibc stdlib/time/strings/netdb/unistd/dirent: 16+ stub functions replaced
DRM scheme: per-fd client caps, virgl_wait on VirtioDriver, VIRTGPU ioctls
2026-07-10 01:02:06 +03:00
vasilito d3e98471b6 git: bump submodule/kernel — OOM panic→graceful log-and-continue 2026-07-10 00:48:33 +03:00
vasilito a6ee8c62f1 git: bump submodule/relibc — 10 hidden POSIX exports uncommented + aio/fenv/netdb implementations 2026-07-10 00:42:37 +03:00
vasilito c49ec74a6e git: bump submodule/relibc for qsort_r export 2026-07-10 00:24:24 +03:00
vasilito d257a1ba12 drm: implement virgl_wait for VirtIO driver + revert incomplete idr.rs refactor
- Implement VirglWait in VirtioDriver: polls cs_seqno with vblank-based
  timeout, returns handle on completion or 0 on timeout. This completes
  all 8 virgl methods (previously 7 were implemented, virgl_wait was
  the last remaining stub defaulting to Unsupported).
- Revert incomplete linux-kpi idr.rs refactoring (uncommitted Box::new
  changes had broken syntax)
2026-07-10 00:22:05 +03:00
vasilito 3f51080c8b kde: re-enable KJobWidgets KNotifications + ECMQmlModule + DMA mapping fix
Three changes in this commit:

1. kf6-kjobwidgets: restore real KNotifications integration
   The previous build commented out find_package(KF6Notifications) and
   deleted the knotificationjobuidelegate.cpp/.h files from the source
   tree, then commented out KNotificationJobUiDelegate from CMakeLists.
   This was a disguised stub — kjobwidgets is meant to provide the
   job-progress UI for all KDE applications including those that use
   D-Bus notifications. Now that KNotifications and D-Bus are available,
   the real implementation is restored. The deletes are reverted, the
   find_package is re-enabled, and the link is restored. USE_DBUS=ON
   since the runtime path now exists.

2. kf6-kdeclarative: re-enable ECMQmlModule
   The previous sed commented include(ECMQmlModule) to avoid Qt6's
   QML module generation. Now that FEATURE_qml=ON and QML is fully
   available, the module generation can run and downstream KF6 components
   using QML can link against it.

3. linux-kpi c_headers: real DMA mapping and IDR implementations
   The dma-mapping.h and idr.h headers previously had stub
   implementations. idr.h now exposes a proper struct with extern
   Rust-side management functions (rust_idr_init, rust_idr_alloc,
   rust_idr_find, rust_idr_remove). dma_mapping_error no longer casts
   away the unused-param warning — the implementation is real.
2026-07-10 00:18:52 +03:00
vasilito 696b635bbe kde: re-enable QML/D-Bus/Wayland in 10 KF6 packages
With Qt6 FEATURE_qml=ON, FEATURE_network=ON, FEATURE_openssl=ON, and the
D-Bus daemon wiring all now working, several KF6 shortcuts can be removed:

- kf6-kdeclarative: re-enable Qt6 Qml+Quick (was Gui-only), drop the
  KGLOBALACCEL=FALSE set, re-enable qmlcontrols subdirectory
- kf6-kcmutils: BUILD_WITH_QML=ON, USE_DBUS=ON (re-enables QML KCM
  surfaces and the D-Bus session bus path)
- kf6-kitemmodels: BUILD_WITH_QML=ON (QML model bridge)
- kf6-kiconthemes: BUILD_WITH_QML=ON (QML icon theme integration)
- kf6-kio: BUILD_WITH_QML=ON (QML KIO integration), WITH_WAYLAND=ON
  (Wayland-native KIO slaves)
- kf6-kpackage: BUILD_WITH_QML=ON (QML package bridge)
- kf6-kxmlgui: BUILD_WITH_QML=ON (QML XML GUI)
- kf6-kwindowsystem: WITH_WAYLAND=ON (Wayland KWindowSystem)
- kf6-prison: BUILD_WITH_QML=ON (QML barcode generator)
- kf6-sonnet: SONNET_USE_QML=ON (QML spellcheck integration)
- plasma-framework: BUILD_WITH_QML=ON, USE_DBUS=ON (QML framework + D-Bus)

Translations (ecm_install_po_files_as_qm, ki18n_install(po)) remain
disabled across all packages — they require lupdate/lrelease built for
the target which is a separate infrastructure item.
2026-07-10 00:13:23 +03:00
vasilito 296bcb779a fix: remove unused next_gem_handle — drm scheme now provides handles 2026-07-10 00:04:03 +03:00
vasilito 9676023c4b fix: drm gem shim — delegate handle create/delete to drm scheme via real ioctl
linux-kpi/drm_shim.rs previously tracked GEM objects only in a local
HashMap. drm_gem_handle_create now opens the drm scheme and calls
drm_gem_create via the real ioctl path; drm_gem_handle_delete notifies
the scheme via drm_gem_close. Added write_size, scheme_ioctl, and
ensure_scheme_fd helpers. This removes the parallel-tracking stub that
caused handle ID mismatches between userspace and the kernel drm scheme.

Cross-referenced with Linux drivers/gpu/drm/drm_gem.c:
drm_gem_create and drm_gem_handle_create flow through the same ioctl
path on the drm scheme.
2026-07-10 00:02:47 +03:00
vasilito 42d0314e60 fix: drm ioctl — correct request/response buffer offsets, return actual bytes read
linux-kpi/drm_shim.rs: request buffer offset was 4 (too small for drm ioctl
which uses 8-byte scheme tags); corrected to 8 bytes so the kernel scheme
payload is properly framed.

redox-drm/scheme.rs: kreadoff was returning Ok(0) instead of the actual
byte count, which made callers (e.g. linux-kpi) think the read returned no
data. Now returns Ok(buf.len()) as documented in the syscall contract.
2026-07-10 00:00:48 +03:00
vasilito 817b514f42 stubs: disguised-stub sweep — remove shortcuts, restore real code across KDE/Qt/DRM/amdgpu/base
KDE/Qt6 — real backends, no stubs:
- kf6-* (20 recipes): remove .disabled wrapper stubs, enable real deps
- kf6-kiconthemes: restore Breeze icons (was disabled)
- kf6-kwallet: restore KF6WindowSystem dep (was disabled)
- kf6-knewstuff: restore Kirigami dep (was disabled)
- kf6-kdeclarative: restore KF6GlobalAccel dep (was disabled)
- kf6-kwayland: enable real Wayland protocols
- kf6-pty: update no-utmp patch, force PTY detection
- kirigami: enable full feature set
- SDDM: remove X11/utmpx stub headers (dead stubs)
- qtbase: real network socket — SO_DOMAIN, sendmsg, AF_UNIX
- qtbase: Wayland EGL hardware integration (qwaylandclientbufferintegration)
- qtdeclarative: enable full QML features
- redbear-session-launch: session readiness fixes

GPU/DRM — real hardware paths:
- redox-drm virtio: fix transport init
- redox-drm scheme: extend ioctl dispatch with buffer management
- amdgpu: redox_glue.h — add missing KPI compat declarations
- amdgpu: redox_stubs.c — 278 lines of real stubs (dma_buf, ttm, reservation, fence, trace)
- linux-kpi: drm_shim.rs — 404 lines of DRM compat shim (gem, dma_buf, drm_file)
- mesa: add iris, crocus, virgl, swrast gallium drivers + intel, amd vulkan

Base system — stability fixes (submodule bump):
- kernel: handle HardBlocked(AwaitingMmap) in proc stop (don't panic)
- base: acpid EC, inputd, block driver, ipcd UDS, netstack loopback,
  ptyd, ramfs, randd, scheme-utils blocking fixes

Build system:
- cook/fetch.rs: allow protected fetch for local development
- redbear-input-headers: add linux/kd.h, linux/vt.h
- mc: add stdckdint.h compat header, configure fix
- libinput, libxkbcommon, libwayland: updated source tars
- New symlinks: polkit-qt6, openssl3, gperf
2026-07-09 23:56:14 +03:00
vasilito e72cec0b1a fix: mc — force mounted-fs configure check on Redox
mc's configure cannot detect a mount method on Redox (no getmntinfo,
next_dev, fs_stat_dev). Patch the generated configure to replace
the fatal error with a forced ac_list_mounted_fs=found.

Also add autoconf cache overrides for getmntinfo and sys/mount.h.
2026-07-09 23:45:39 +03:00
vasilito dd54e7cab6 kf6-kcrash: remove disguised stub — restore real glRenderer() function
The previous recipe used sed to replace the ENTIRE glRenderer() function
body with  — silently discarding GPU renderer metadata
in crash reports. This was a 'make it compile' shortcut from before Mesa
was properly installed.

Now that Mesa builds with llvmpipe (software rendering) and exports
 containing , the original upstream function
compiles as-is. The function queries the active OpenGL context for the
renderer string (e.g. 'llvmpipe (LLVM 21.0, 256 bits)').

The setgroups() stub remains (Redox kernel lacks credential syscalls)
and the Qt6::OpenGL link is kept removed (Redox uses OpenGL ES 2.0,
not desktop GL — the raw glGetString call comes from mesa/GL/gl.h).
2026-07-09 23:38:21 +03:00