Files
cubelinux-2/RESUME-20260821-kernel-irt-fix.md

4.9 KiB
Raw Permalink Blame History

Resume Marker — 2026-08-21 (kernel Rust build: IRQ lifetime fixes + ready for compile)

Context

The session after RESUME-20260820. Fixed the kernel Rust build errors and verified make rust/core.o compiles cleanly. Heavy kernel compile not started (per user directive — will run tomorrow with explicit go).


What was done this session

1. Kernel Rust build: IRQ lifetime errors fixed

File changed: rust/kernel/irq/request.rs

Root cause: rust/core.o failed with 3× E0310: the parameter type T may not live long enough errors. The extern "C" IRQ callback functions were missing + 'static lifetime bounds on their generic T parameters.

Fixes applied (4 total):

Function Line Change
handle_irq_callback 264 T: HandlerT: Handler + 'static
handle_threaded_irq_callback 483 T: ThreadedHandlerT: ThreadedHandler + 'static
thread_fn_callback 499 T: ThreadedHandlerT: ThreadedHandler + 'static

The impl blocks already had T: Handler + 'static and T: ThreadedHandler + 'static on lines 185, 198, 403, 416 — the three extern C callback functions and their callers were the missing ones.

Verification: python3 /tmp/hermes-verify-kernel-rust-build.py — 16/16 checks passed:

  • Source file checks: all 3 fixed signatures present, no old patterns remain
  • Build: make rust/core.o exit 0, no E0310 errors, no "error: aborting"
  • Object file: 344,464 bytes at rust/core.o
  • Only 2 pre-existing warnings (unused import flags::*, unused feature used_with_arg)

2. ./check gate — ALL CHECKS PASSED

./check → ALL CHECKS PASSED  (run: ./check mount | bench | stress | daemon for those stages)

fmt clean, 223 tests, clippy -D clean. No regressions from the IRQ fix.

3. Build config (carried over from prior session, still valid)

  • Nightly rustc 1.100.0 (rustup default nightly)
  • scripts/target.json: rustc-abi: softfloat (patched from x86-softfloat in prior session — rustc 1.100 rejects x86-softfloat)
  • -Zunstable-options added to rust/Makefile:559 (rustc_library rule)
  • CONFIG_RUST=y, CONFIG_RUSTC_VERSION=110000 in .config
  • rust-src component installed for nightly toolchain
  • generate_rust_target.rs patched to emit softfloat (not x86-softfloat)

What remains for tomorrow

Kernel compile (heavy — ask before launching)

  • Command: cd /home/CUBELinux/CUBELinux-2/src/CUBELinux-build && make -j4 bzImage modules
    • Use -j4 not -j8 — 7.4 GB RAM, only 3.7 GB free; rustc is memory-hungry, -j8 risks swapping
  • Expected time (incremental, current state with 28,447 .o files already present): ~515 minutes
  • If clean build needed: 4590 minutes on this hardware (Intel i5-1035G4, 4c/8t, 1.1 GHz base, NVMe)
  • After build: install modules, update GRUB, reboot into new kernel

GRUB

  • New kernel entry: LOCALVERSION=-cube (already in .config)
  • Verify LOCALVERSION=-ipu4p entry still works (camera kernel, currently active)

Post-boot verification

  • Cube filesystem mount
  • Daemon startup
  • Camera (ipu4) if desired

Xfce (separate track — not touched this session)

  • dpkg state clean: lightdm, light-locker, task-xfce-desktop all removed/purged
  • Xfce 4.20.2 intact: xfce4-session, xfce4-panel, xfce4-goodies all ii
  • Session files: /usr/share/xsessions/xfce.desktop, /usr/share/wayland-sessions/xfce-wayland.desktop
  • GDM active, default DM /usr/sbin/gdm3
  • Issue reported (external monitor oversized, both monitors showing in Xfce vs GNOME's correct single monitor): root cause is xfsettingsd not running during Xfce session — Xfce inherits GNOME's RandR state without managing it. The fix is ensuring xfsettingsd starts (autostart entry at /etc/xdg/autostart/xfsettingsd.desktop exists, not disabled). No action taken — user will test after reboot.

Files

  • Workspace: /home/CUBELinux/CUBELinux-2/
  • Changed file: src/CUBELinux-build/rust/kernel/irq/request.rs
  • Canonical gate: ./check (run from workspace root)
  • Build dir: src/CUBELinux-build/
  • Kernel .config: src/CUBELinux-build/.config (CONFIG_RUST=y, CONFIG_LOCALVERSION="-cube")
  • Rust target.json: src/CUBELinux-build/scripts/target.json (rustc-abi: softfloat)
  • System daemon socket: /run/cube/cube.sock
  • luulu session daemon socket: /run/user/1000/cube/cube.sock
  • Verification script used: /tmp/hermes-verify-kernel-rust-build.py (cleaned up after run)

Git state

  • Branch feat/os-kernel-in-cube, working tree clean (verify with git status before committing)
  • Prior commits on HEAD: c090233 (bench fix), ae1a62a (docs), 3f007a1 (bench saturating_sub) + 3 older commits

Reminder

  • User explicitly does NOT want auto-launching heavy kernel compiles while they're using the machine
  • make -j8 saturates all 8 cores + memory on this Surface Pro 7 (i5-1035G4, 7.4 GB RAM)
  • Must get user go before launching the kernel compile tomorrow