Skip to content

issues: the kernel's drivers and threads, and the host binaries the build rests on, each with its owner - #607

Merged
Japabu merged 3 commits into
mainfrom
wt/toyos-debts
Sep 29, 2026
Merged

Japabu merged 3 commits into
mainfrom
wt/toyos-debts

Conversation

@Japabu

@Japabu Japabu commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

The owner asked which standing debts remain besides the crate sprawl (#604) and the C corpus. This PR moves no code: it updates the issues that own each debt, files one issue for a debt nothing owned, and corrects one tree fact in CLAUDE.md. Issues only; no inventory or strategy document is recorded.

Changes

  • issues/kernel/the-kernel-still-creates-threads.md: K2 is deleted because Kernel: a kill never waits on its victim — the last thread out tears its process down #549 did it. K6 waits on K4 and K5. K4 carries the constraint that one console wire's driver stays in the kernel (log::console::drain_inline, serial::panic_flush), and no longer cites a driver-model design.
  • issues/kernel/every-driver-is-still-in-the-kernel.md: item 1 is re-scoped to the HDA and virtio-sound stubs and virtio-gpu, the ABI that retires with them, and why GOP stays.
  • issues/kernel/the-kernel-is-small-interrupts-post-and-threads-wait.md: step 10 notes the MSI-X-in-BAR-0 refusal and that where the T14's xHCI and NVMe keep their tables is unmeasured.
  • issues/build/python-and-cc-are-declared.md: what removing Python, cc, and CMake with Ninja takes, without point-in-time counts or versions.
  • New: issues/build/the-owners-flash-script-runs-diskutil.md; its exit is rg -l "diskutil|plutil" over the tree outside rust/ finding nothing.
  • CLAUDE.md (owner-approved tree fact): "four macOS FAT tools" becomes "two macOS FAT tools"; the tree has newfs_msdos and hdiutil only. src/sourcegate.rs loses the clause "Two, where CLAUDE.md says four", which that edit makes false. Nothing else in CLAUDE.md changes.

Gates

  • cargo run -- --ci host: EXIT=0 on the head.
  • No guest test applies.

Unsure

  • Where the T14's NVMe and xHCI keep their MSI-X tables is unmeasured. The step for the orchestrator, read-only: lspci -nn for the two BDFs, then sudo lspci -vvv -s <bdf> as root for each. Without root the MSI-X capability's Table: BAR=N offset=... line is hidden as <access denied>. The metal loop's sudoers rule does not list lspci, so this needs an interactive root shell.
  • every-driver-is-still-in-the-kernel.md still says USB HID cannot move without moving "the boot block device". That predates ROOT in memory; only the owner can rule on it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U6SVYFkdvV2t38KzNrESxs

The owner asked which known debts remain besides the crate sprawl and the
C corpus. Research only; no code moves.

- the-kernel-still-creates-threads: K2 is done (#549 deleted the reaper;
  `kthread::spawn` has two callers, klogd and iod), so K6 waits on K4 and
  K5 alone. K4 carries the constraint that the boot before logd and the
  panic path write the console wire, so one wire's driver stays.
- every-driver-is-still-in-the-kernel: item 1 said it needed re-scoping
  because its file was deleted. It now names the HDA and virtio-sound
  stubs and virtio-gpu, which leave as `pci` claims the way netd did, and
  the ABI that retires with them. GOP stays for the panic console.
- the-kernel-is-small: step 10 (usbd) meets the MSI-X-table-in-BAR-0
  refusal that blocks blockd, and where either xHCI keeps its table is
  unmeasured.
- python-and-cc-are-declared: what removing each takes, measured at the
  fork's pinned 9c3eea44. The Rust bootstrap builds with stable cargo and
  no Python, but LLVM's CMake requires Python 3. `cc` also compiles LLVM's
  C++, and rust-lld can take only the link, which on macOS still needs the
  SDK and fails on 27.0's TAPI stubs. CMake is 726 CMakeLists.txt and has
  no Rust replacement.
- new: diag/flash.sh runs diskutil and plutil, and no ledger declares
  them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Japabu
Japabu marked this pull request as ready for review September 29, 2026 08:07
@Japabu

Japabu commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator Author

Head 4223c5f. CI host on the head: SUCCESS (a second, earlier host run SKIPPED). Diff: 70 insertions, 10 deletions, issue files only; nothing to guess-build. No guest claim, so no metal reading owed.

Spot-checks against the tree, all true: MAX_KERNEL_TASKS = 2 (kernel/src/sched/kthread.rs:22); the only kthread::spawn sites are log/console.rs:66 and iod.rs:15; the pass calls xhci::poll_if_pending, keyboard_controller::service, pcidev::drain_pending, AUDIO_WATCH.post and watchdog::feed (sched/driver.rs:512,665,666,679,684); drain_inline (log/console.rs:91) and serial::panic_flush (serial.rs:139) exist; newfs_msdos and hdiutil are the only two FAT tools (toyos-fat32/tests/common/mod.rs:527,604, sourcegate.rs:601,608); flash.sh runs diskutil, plutil, shasum, dd and sudo, and the README runs diskutil; download_beta_toolchain exists in rust/src/bootstrap; nvme.rs is 908 lines and hpet.rs 97; the referenced issue files exist. The Command::new("./x") spawn is at toolchain.rs:631,633.

BLOCKER

  • none.

NOTE

  • PR body, section A step 1 — the T14 step is not concrete or safe to run as written. lspci -vv as a non-root user prints Capabilities: <access denied>, so the MSI-X Table: BAR=… offset=… line is absent. The metal loop's sudo is limited to the rendered /etc/sudoers.d/toyos-metal rule (src/metal.rs:7-9), which does not list lspci. State the command (sudo lspci -vvv -s <bdf> for the NVMe and the xHCI, with the BDFs from lspci -nn), that it needs an interactive root shell, and the field to read (MSI-X: … Table: BAR=N). It is read-only, so safe once root exists.
  • PR body, "Unsure" — the CLAUDE.md rewording is only "the handoff proposes one sentence"; it is not in the PR or in the body. Nothing to judge as written. My recommendation is below.
  • PR body — 8.1 s EXIT=0 (bootstrap build) and the two rust-lld results give no command and no log. The brief requires command, exit code and log for a measured claim. The claims are used as evidence in the issue text, so add the commands or drop the numbers.
  • PR body — the 21-row inventory, the 7-step order and the stage list are inventory and strategy that will be the merge commit's record and live in no issue. The order is a proposal that the owner did not ask to be recorded. Consider cutting it to the measured table and the issue edits.
  • issues/kernel/the-kernel-still-creates-threads.md K4 — the PR body says the "driver-model design" is not written anywhere in the tree, yet K4 still says "the owner-approved driver-model design moves the console to logd". The branch had the evidence and left a claim it just called unsupported.
  • issues/build/the-owners-flash-script-runs-diskutil.md — Exit says "or by nothing", which cannot be checked. Name a check (for example, rg diskutil over the tree outside rust/ finds nothing).

REMOVE

  • issues/build/python-and-cc-are-declared.md — llvm/CMakeLists.txt:1016, the 726/78/740 counts, LLVM 22.1.0, MacOSX14.4.sdk, MacOSX27.0.sdk, 1.98.1 and 9c3eea44: point-in-time numbers and cites that rot with every fork bump or SDK update. Keep the fact, delete the numbers.
  • issues/build/python-and-cc-are-declared.md — "Nobody has run it end to end, and whether to try is the owner's call": narration; the ruling is already cited in the same file.

CLAUDE.md rewording recommendation. Yes, change it, and only the number: "four macOS FAT tools" to "two macOS FAT tools". The tree has two (newfs_msdos, hdiutil), and sourcegate.rs:611 already records the mismatch in prose that will say something false after the fix, so that sentence goes in the same edit. It is shorter by nothing and true. A longer rewrite is not needed: the ledger in src/sourcegate.rs already lists the tools. Not needed is the flash-script addition; that belongs in its issue, which the PR files.

LAND AFTER NAMED CHANGES

🤖 Generated with Claude Code

https://claude.ai/code/session_01U6SVYFkdvV2t38KzNrESxs

Japabu and others added 2 commits September 29, 2026 15:43
…exits

python-and-cc-are-declared.md loses its counts, versions, hash, the
CMakeLists line cite, the unrun-bootstrap narration and the rust-lld
measurement that named no command. The flash-script issue's exit is now
`rg -l "diskutil|plutil"` outside rust/ finding nothing. K4 no longer cites
a driver-model design the tree does not hold. CLAUDE.md says two macOS FAT
tools, which is what the tree has, and the sourcegate clause that recorded
the mismatch goes with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U6SVYFkdvV2t38KzNrESxs
@Japabu
Japabu added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit ca7b955 Sep 29, 2026
1 check passed
@Japabu
Japabu deleted the wt/toyos-debts branch September 29, 2026 14:08
Japabu added a commit that referenced this pull request Sep 29, 2026
One conflict, issues/kernel/the-kernel-still-creates-threads.md's
stages. main (#607) dropped K2 and rewrote K4 with the console wire the
boot and the panic path keep; this branch dropped K5, since iod goes
with the kernel's write-back queue here and no kthread::spawn is added.
The stages are #607's K4 and K6, K6 blocked on K4 alone.

#607's hunks in every-driver-is-still-in-the-kernel.md (audio and
virtio-gpu re-scoped) and the-kernel-is-small-interrupts-post-and-
threads-wait.md (xHCI's MSI-X table) touch lines this branch does not
change and merge as main wrote them; #602's toyos-cpuvuln and its
sourcegate row likewise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U6SVYFkdvV2t38KzNrESxs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant