Commit Graph

1326 Commits

Author SHA1 Message Date
vasilito fcfdea1998 syscall migration: sync forks to 0.9.0 upstream + update submodule pointers
Phase 4 (syscall): merged upstream 0.9.0 — reservation API (openat_into/dup_into) + removed legacy syscalls. Both old and new APIs coexist for backward compatibility.

Phase 2 (kernel): added openat_into() and dup_into() handlers to fs.rs, registered SYS_OPENAT_INTO and SYS_DUP_INTO in syscall dispatch mod.rs.

Phase 1 (bootstrap): migrated initnsmgr.rs from openat_with_filter→openat_into + unlinkat_with_filter→unlinkat.
2026-07-08 00:50:10 +03:00
vasilito 3787844b07 base: bump submodule to 0f533161 (BROKEN_STREAMS behavioral quirk) 2026-07-08 00:44:33 +03:00
vasilito 5d891c06ac base: bump submodule to 2c6c4302 (P1 BOS + event ring growth) 2026-07-08 00:39:22 +03:00
vasilito 7e34c4c251 docs: create comprehensive syscall migration plan
SYSCALL-MIGRATION-PLAN.md:
  - Detailed analysis of upstream 0.9.0 BREAKING changes (FD reservation refactor,
    removed syscalls, new *_into variants)
  - Complete consumer impact catalog: 2 bootstrap call sites, 7 kernel/relibc
    constant references, 26 recipes (no impact)
  - 5-phase migration plan: bootstrap→kernel→relibc→syscall sync→full build
  - Risk assessment with rollback procedure
  - Clear migration table: old API → new API for each deprecated function/constant
  - Execution order with time estimates (~1-2 days total)
2026-07-08 00:33:17 +03:00
vasilito c71dd84188 base: bump submodule to 11ef8173 (P0 usbscsid runtime panics + Xhci Send/Sync docs) 2026-07-08 00:31:36 +03:00
vasilito cab28bd2ab docs: upstream sync status — cross-reference Redox forks with master plan
NETWORKING-IMPROVEMENT-PLAN.md:
  - Phase 0 updated from 'workstreams' to COMPLETE with verified upstream commits
  - Added fork state table (8 components, HEADs, upstream HEADs, gaps)
  - All 7 required upstream commits verified present in local forks
  - syscall flagged as BREAKING (removed syscalls, FD reservation refactor)

IMPLEMENTATION-MASTER-PLAN.md:
  - Added section 11: Upstream Sync Status (2026-07-07)
  - Fork state table with gap analysis per component
  - Key upstream changes to track: syscall breaking refactor, kernel NUMA, libredox fcntl
  - Renumbered sections 11-15

Findings:
  - All 8 forks at +rb0.3.0 with Red Bear changes intact
  - Gaps are minor (2-3 commits each) except syscall (BREAKING)
  - UPSTREAM-SYNC-PROCEDURE.md (770 lines) is comprehensive and current
  - No stale plan parts to remove — all docs are active and referenced
2026-07-08 00:26:31 +03:00
vasilito c39523a574 docs: update IMPLEMENTATION-MASTER-PLAN with IMPROVEMENT-PLAN reference and quality audit integration
Update the master implementation plan to reference the new
IMPROVEMENT-PLAN.md which contains the comprehensive quality
gaps found during the 2026-07-07 USB/Wi-Fi/Bluetooth audits.

Key changes:
- Added IMPROVEMENT-PLAN.md to the authoritative plans table
- Added §10 Quality Gaps section with USB/Wi-Fi/Bluetooth audit findings
- Updated §11 Execution Priority with P0/P1/P2/P3 tiers
- Cross-references Linux 7.1 source files for each improvement task
- The IMPROVEMENT-PLAN.md has detailed file:line references for every gap

This establishes the two-plan architecture:
- IMPLEMENTATION-MASTER-PLAN.md: feature work, P0 from build
- IMPROVEMENT-PLAN.md: quality work, P0 from safety

No new repositories or submodules created.
2026-07-08 00:05:27 +03:00
vasilito 304548b741 base: bump submodule to f646e42e (P0 usbscsid .unwrap → .expect) 2026-07-07 23:59:10 +03:00
vasilito aa2185152a docs: comprehensive driver infrastructure assessment and cleanup
IMPLEMENTATION-MASTER-PLAN.md:
  - Updated Phase 2 Network Drivers to COMPLETE status
  - Added NETWORKING-IMPROVEMENT-PLAN.md to authority table
  - Comprehensive driver inventory (5 Ethernet, 7 storage, 4 USB, 4 GPU, etc.)
  - Linux 7.1 cross-references for every driver
  - Network stack completion summary (9,212 LoC, all protocols)
  - Updated e1000d/rtl8168d file statuses (was 'Truncated', now 'Complete')
  - Remaining smoltcp-dependent gaps documented

Archived stale docs:
  - C7-STATUS.md → archived/ (KF6/Plasma migration, completed)
  - BUILD-TOOLS-PORTING-PLAN.md → archived/ (superseded)
  - 0.2.5-GRAPHICS-FREEZE-PLAN.md → archived/ (version-specific)
2026-07-07 23:46:41 +03:00
vasilito 6e808741ea redbear-power: per-core governor display and Ctrl+g control 2026-07-07 22:16:27 +03:00
vasilito 596407a52d redbear-power: upower client + render/sensor/battery/dmi updates 2026-07-07 22:00:54 +03:00
vasilito 33c002d563 USB: cast O_* flags to u8 for NewFdFlags::from_bits_truncate
Cross-compile error: from_bits_truncate requires u8 but
O_STAT/O_RDWR are usize.  Cast with 'as u8'.

Applied to all 4 scheme wrappers: acmd, ftdi, ecmd, usbaudiod.
2026-07-07 21:54:39 +03:00
vasilito 1b3b29ba91 networking: update base submodule pointer (comprehensive TCP/IP stack) 2026-07-07 21:49:35 +03:00
vasilito 46cd3704b9 USB: fix scheme API — match actual redox-scheme SchemeSync trait
Cross-referenced with wifictl's working scheme registration pattern.

scheme.rs fixes (acmd + ftdi):
- openat: 5→6 params (add &mut self, fcntl_flags: u32)
- read: 4→6 params (add offset: u64, fcntl_flags: u32)
- write: 4→6 params (add offset: u64, fcntl_flags: u32)
- Removed close() method (not in SchemeSync trait)
- OpenResult.flags: usize→NewFdFlags (via from_bits_truncate)
- Removed unused imports

main.rs fixes (acmd):
- Replaced register_async_scheme + handle_scheme_mut with
  wifictl pattern: setrens(0,0) + request.handle_sync() +
  socket.write_response() + RequestKind::Call match
- Socket::next_request returns Option<Request>, handle
  Ok(None)/Err gracefully instead of expect()

Verified: cargo check --offline passes on host.
2026-07-07 21:12:45 +03:00
vasilito fc34718ae8 redbear-power: update stale docstrings for Redox process control and MSR temperature fallback 2026-07-07 21:10:33 +03:00
vasilito dac00073ba USB: canonical scheme pattern — all 4 drivers aligned
ftdi/usbaudiod scheme.rs updated to match acmd/ecmd pattern:
  Explicit match arms in read/write (not map/map_err chains)
  Consistent openat with root dir + device file routing
  Saturating close count
  AudioScheme retains capture/playback path routing

All 4 scheme modules now identical in structure:
  acmd  → /scheme/ttys/usbACM_<N>      (Mutex<bulk_in>, Mutex<bulk_out>)
  ftdi  → /scheme/ttys/usbFTDI_<N>     (same)
  ecmd  → /scheme/net/usbECM_<N>       (same)
  audio → /scheme/audio/usbAudio_<N>   (Mutex<isoch_in>, Mutex<Option<isoch_out>>)
2026-07-07 20:01:37 +03:00
vasilito ac9c12d6d4 USB: align ecmd scheme with acmd pattern — explicit match arms, clean imports
ecmd scheme.rs: map/map_err chains → explicit match arms (same as acmd)
acmd scheme.rs: removed unused imports (io::{Read,Write}, Duration, Stat)

All 4 scheme modules now follow identical pattern:
  Mutex<XhciEndpHandle>, SchemeSync, explicit match in read/write
2026-07-07 19:59:43 +03:00
vasilito 5b4f2ac984 USB: P3 — wire scheme into main loop for ecmd + usbaudiod
redbear-ecmd: scheme loop replaces stdout on Redox
  (/scheme/net/usbECM_<N>), notification reader kept for
  CDC link state / speed change events on both paths.

redbear-usbaudiod: scheme loop replaces stdout on Redox
  (/scheme/audio/usbAudio_<N>), stdin→isoch_OUT playback
  thread kept for host stdout path only.

All 4 class drivers now fully wired:
  acmd  → scheme event loop active on Redox 
  ftdi  → scheme event loop active on Redox 
  ecmd  → scheme event loop active on Redox 
  usbaudiod → scheme event loop active on Redox 
2026-07-07 19:55:40 +03:00
vasilito 827cc0223d USB: P3 scheme service wrappers — ecmd + usbaudiod
redbear-ecmd: EcmScheme → /scheme/net/usbECM_<N> for netstack
redbear-usbaudiod: AudioScheme → /scheme/audio/usbAudio_<N> for audiod
  (supports capture/playback path routing via openat path names)

All 4 class drivers now have scheme service wrappers:
  redbear-acmd  → /scheme/ttys/usbACM_<N>
  redbear-ftdi  → /scheme/ttys/usbFTDI_<N>
  redbear-ecmd  → /scheme/net/usbECM_<N>
  redbear-usbaudiod → /scheme/audio/usbAudio_<N>
(HID+Storage already have scheme integration via ProducerHandle/DiskScheme)
2026-07-07 19:27:36 +03:00
vasilito 9e6851d43c USB: P3 scheme service wrapper — redbear-ftdi registers /scheme/ttys/usbFTDI_<N>
Same pattern as acmd: FtdiScheme with Mutex<XhciEndpHandle>,
SchemeSync impl, Socket::create() + register on Redox,
stdout fallback on host/Linux.
2026-07-07 19:24:46 +03:00
vasilito 726e628e0d USB: P3 scheme service wrapper — redbear-acmd registers /scheme/ttys/usbACM_<N>
Cross-referenced with Linux 7.1 tty_port_register_device() pattern.

New scheme.rs module:
- AcmScheme implements SchemeSync with Mutex-wrapped XhciEndpHandle
- openat(): root dir listing + device file open (O_RDWR)
- read(): USB bulk IN → scheme client (getty, terminal)
- write(): scheme client → USB bulk OUT
- close(): decrements open count
- fsync(): no-op

main.rs:
- #[cfg(target_os = redox)]: Socket::create() + register scheme
  under /scheme/ttys/usbACM_<port_id>, process requests with
  handle_scheme_mut() in event loop
- #[cfg(not(target_os = redox))]: stdout fallback for testing

This enables getty to open /scheme/ttys/usbACM_<N> as a serial
console on USB CDC ACM devices — the driver is now a proper
Redox scheme service, not just a stdout debugging tool.

Pattern replicable for redbear-ftdi (same scheme:ttys), redbear-ecmd
(scheme:net), and redbear-usbaudiod (scheme:audio).
2026-07-07 19:21:14 +03:00
vasilito 0dc1786f66 base: bump submodule to 1c7f8390 (ZERO_64B_REGS behavioral quirk) 2026-07-07 19:14:32 +03:00
vasilito ed7aba6ed1 USB: acmd scheme IPC documentation — stdout IS the Redox scheme path
The Redox init system connects daemon stdout to the appropriate
scheme service on spawn.  No explicit scheme registration needed
in the driver — stdout/stderr are the scheme IPC endpoints.

This is the standard Redox daemon architecture:
- Input daemons (HID, storage) write to stdout → scheme:input, scheme:disk
- Output daemons (ACM, ECM, Audio) read/write stdout → scheme:ttys, scheme:net
- The init system handles pipe-to-scheme binding via .service files

Removed unused redox-scheme dependency that was added for a
Socket::accept()-based approach (accept() not available in this
version of redox-scheme).  The stdout pattern is the correct,
working architecture.
2026-07-07 19:08:50 +03:00
vasilito df34186680 base: bump submodule to 4037c383 (NO_64BIT_SUPPORT behavioral quirk) 2026-07-07 18:48:09 +03:00
vasilito 8ef8d16189 base: bump submodule to 37cbed4c (complete quirk enforcement 39/50) 2026-07-07 18:26:38 +03:00
vasilito 4c4db5ce5f base: bump submodule to 1b1902e5 (batch quirk enforcement 7→19) 2026-07-07 18:22:44 +03:00
vasilito 3123446f49 base: bump submodule to 947475a2 (EP_LIMIT_QUIRK) 2026-07-07 18:18:07 +03:00
vasilito 070b838aa3 W73: Fix remaining medium-severity error handling gaps
app.rs:199-214 — menubar handle_key now uses if-let instead of
  guarded .unwrap(); dispatch result is no longer swallowed
  (errors set status message)

app.rs:391 — Ctrl-Z suspend kill command error now logged

terminal/mod.rs:118,147 — frame-draw + restore flush() now use
  .ok() pattern instead of let _ = (more explicit intent)

viewer/mod.rs:967 — menubar.take().unwrap() replaced with
  if-let Some(mut mb) pattern

Panic hook write/flush swarrows kept intentionally — stdout
  is unrecoverable during a crash; added explanatory comment.

Tests: 1427 pass, zero warnings.
2026-07-07 18:17:02 +03:00
vasilito 51d790c218 base: bump submodule to f4619085 (SPURIOUS_REBOOT quirk) 2026-07-07 18:11:29 +03:00
vasilito 5175dfb739 W72: Fix all error-handling gaps from comprehensive audit
Critical fixes (46 audit findings addressed):

app.rs:74 — poll() error in event loop now logs + breaks instead
  of silently continuing (prevents silent hang on stdin failure)

config.rs:47 — .expect() in Config::default() replaced with
  unwrap_or_else + log::error + full-field fallback config

dialog_ops.rs:831-842 — .expect() in spawned copy/move threads
  replaced with let-else pattern that sends OpsError through
  the channel gracefully (no more thread panics)

app.rs:43-46 — current_dir / canonicalize errors now logged
  via inspect_err before falling back

main.rs:115 — logging init failure now prints to stderr via
  unwrap_or_else(eprintln!) instead of silent discard

viewer/mod.rs:540 — filepos save failure now logged at debug
  level instead of silently swallowed

terminal/mod.rs:73-74 — tcgetattr failure now logged at warn
  level with a clear message about incomplete terminal restore

Tests: 1427 pass, zero warnings.
2026-07-07 18:07:41 +03:00
vasilito a37eef9d67 base: bump submodule to 90862821 (real XhciAdapter control_transfer) 2026-07-07 18:06:29 +03:00
vasilito 38b61167fa base: bump submodule to 16c113a3 (XhciAdapter device address tracking) 2026-07-07 17:58:06 +03:00
vasilito 6773b79d1f base: bump submodule to 0eaf6cee (quirks: ASMedia + VIA VL805) 2026-07-07 17:48:59 +03:00
vasilito 7e4a88e418 base: bump submodule to 7286457a (quirk enforcement: BROKEN_MSI, RESET_ON_RESUME, RESET_TO_DEFAULT) 2026-07-07 17:44:44 +03:00
vasilito b95ac973e8 W71: Fix all review-identified gaps
High-severity fixes:
- Replace 2× unreachable!('mkdir not spawned with progress') in
  dialog_ops.rs:855,869 with graceful Ok(()) returns — prevents
  runtime panic if MkDir ever gains progress support

Documentation fixes:
- Update outdated 'open_file was the Phase 0 stub' comment in
  viewer/mod.rs to reflect current state (standalone tlcview binary)
- Update usermenu.rs CK_EditUserMenu TODO — feature already
  implemented in dispatch_editor_cmd
- Update PLAN.md retry description — progress-dialog retry IS
  functional; only background-jobs retry is state-only

Tests: 1427 pass, zero warnings.
2026-07-07 17:43:39 +03:00
vasilito 5258ebe6ff base: bump submodule to fb9b158e (hub disconnect + over-current + port indicators) 2026-07-07 17:40:41 +03:00
vasilito 7607ff3ee5 base: bump submodule (usbhidd disconnect resilience) 2026-07-07 17:32:11 +03:00
vasilito 8641f22bd1 redbear-power: DRY /proc/loadavg parsing 2026-07-07 17:31:45 +03:00
vasilito b857d41065 base: bump submodule to 171d8c52 (eliminate all xhcid hot-path panics) 2026-07-07 17:30:58 +03:00
vasilito 72fc7c6f87 redbear-power: wire package thermal status into header 2026-07-07 17:29:53 +03:00
vasilito 5c92aeadd5 W70: Wire viewer menubar stubs — bookmarks, nav, close
Eliminate the last 6 known stubs in the viewer menubar dispatch.
Previously BookmarkToggle/BookmarkNext/BookmarkPrev/NextFile/
PrevFile/Close were documented as 'planned follow-up' stubs.
Now fully wired to existing keyboard handlers:

- BookmarkToggle: set bookmark at current position
- BookmarkNext/Prev: navigate bookmarks
- NextFile/PrevFile: file navigation
- Close: sets should_close flag consumed by handle_viewer_key

Tests: 1427 pass, zero warnings.
2026-07-07 17:28:49 +03:00
vasilito acd6e221c5 redbear-power: track D-Bus worker disconnect state 2026-07-07 17:27:52 +03:00
vasilito dc9155a2a8 redbear-power: fix panic hook to restore terminal on panic 2026-07-07 17:22:20 +03:00
vasilito feba6e2ad8 W69: Editor ToggleColumnMode (MC CK_Mark)
Add ToggleColumnMode EditorCmd to the F9 Edit menu. Toggles
between stream selection and column (block) selection mode.
If currently in column mode, clears to stream. If in stream
mode, starts column selection.

Tests: 1427 pass, zero warnings.
2026-07-07 17:19:05 +03:00
vasilito 0f239bfe8a base: bump submodule to 21cf3d90 (eliminate device_enumerator panics) 2026-07-07 17:02:41 +03:00
vasilito c6532f590c W68: Viewer tests — search opposite + bookmark marker wrap
Add 2 unit tests hardening viewer features:
- search_opposite_shift_n_inverts_direction: verify Shift-N
  moves backward after search_next
- bookmarks_wraps_marker: verify 10 consecutive m presses
  wrap the marker back to 0 and r jumps correctly

Tests: 1427 pass (was 1425), zero warnings.
2026-07-07 16:44:05 +03:00
vasilito 0a16f5ec35 base: bump submodule to 7efa83d6 (comprehensive xhcid drivers.toml) 2026-07-07 16:40:51 +03:00
vasilito 14bb0eb42e W67: HotListAdd Cmd variant (MC CK_HotListAdd)
Add Cmd::HotListAdd variant that opens the hotlist dialog with
a status hint to press Ins to add the current directory. This
provides the MC HotListAdd feature without changing the existing
Ctrl-X 'h' chord which already opens the hotlist dialog.

Tests: 1425 pass, zero warnings.
2026-07-07 16:07:18 +03:00
vasilito f79954e2bc USB: comprehensive hotplug with Linux 7.1 port event state machine
Cross-referenced with Linux 7.1 drivers/usb/core/hub.c:
- hub_port_debounce() (line 4698): 25ms-step debounce algorithm
  with 100ms stable threshold, 2000ms timeout per USB 2.0 §7.1.7.3
- hub_port_connect_change() (line 5055): connect/disconnect dispatch
- hub_irq() / port_event(): interrupt-driven change detection

PortState enum (replaces ad-hoc bool tracking):
  Disconnected → DebouncingConnect → Connected → Active → Disconnected

Debounce: stable_start timestamp, 4x 25ms checks for 100ms
stable window.  Connection drop during debounce → reset.
Timeout after 2000ms → warn + remove.

Phase-based main loop:
  Phase 1: scan controllers/ports → detect new connections
  Phase 2: debounce + state transitions per port
    - DebouncingConnect: check stability against stable_start
    - Connected: read descriptors → find_driver → spawn
    - Active: check driver exit (try_wait) + disconnect detection
  Phase 3: cleanup (remove disconnected, time out stale debounces)

Driver re-enumeration on crash: Active → Connected transition
on driver exit re-triggers descriptor read + spawn.

read_port_connected() uses XhciClientHandle open success as
connectivity check (lighter than full descriptor read).
2026-07-07 16:04:28 +03:00
vasilito 87b85ca083 W66: Editor Delete command in Edit menu (MC CK_Remove)
Add Delete EditorCmd variant and wire it into the F9 Edit menu
between Paste and Select All. With a selection, deletes the
selected text. Without a selection, deletes one character
forward (select_right + delete_selection).

Added 1 unit test verifying single-character forward delete.

Tests: 1425 pass (was 1424), zero warnings.
2026-07-07 16:01:01 +03:00