Repository navigation
A partition is a claimable device, named by its unique GUID: the ABI names one and moves its blocks - #487
Merged
Conversation
…ocks The owner's ruling: a GPT partition is claimed exactly as a PCI function is, named by its GPT identity in a `devices` entry, minted by init from its `SysCap` and endowed. This is the half the shared sysroot carries; the kernel here refuses every new call by name, and the implementation, init's live grant and the tests are the second branch. The spelling. `part:<GUID>` names a partition by its unique partition GUID and `part-type:<GUID>` as the one partition of a type on the machine; a type more than one entry carries names no partition, refused like two identical NICs. Two device classes (8 and 9) rather than a flag, because the class is what says how the selector words are read. The GUID is the uppercase registry form and nothing else, one spelling per partition as `PciId` has one per card; `PartGuid` holds the sixteen bytes a GPT entry stores (UEFI 2.10 §5.3.3) and the ESP type's text and bytes from the specification are its test. `DeviceRequest::MAX_NAME` goes 16 -> 48 for the longest entry, 46 bytes. The claim. `SYS_DEVICE_CLAIM` already had a fourth argument word it passed as zero; the GUID rides the selector and that word, so no claim syscall is added. The transfers. `SYS_PARTITION_READ` (119) and `SYS_PARTITION_WRITE` (120) take the claim, the partition's own first block, a buffer and a block count. The block numbers are the partition's own from 0, so no argument can spell a device block and a neighbour's blocks have no name; the end is the kernel's refusal. The buffers are typed `[[u8; 4096]]`, so a partial block has no spelling and the count is the slice's length. One call carries at most 32 blocks, the run the kernel's own page cache writes back in. Durability is `SYS_FSYNC` on the claim, the same number and the same promise a file has. A claim describes itself once as `PartitionInfo`: its length in blocks and both GUIDs, so a claim named by type can say which partition it got. `toyos-abi` 0.6.0 -> 0.7.0, `toyos` 0.7.0 -> 0.8.0, and `toyos-window` with them for its pins. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
The class enum gained two rows and four exhaustive matches in the object layer did not know them; the kernel did not compile. A partition claim has no readiness source, answers every read with its description (its bytes move through the transfer calls, never through a read of the claim), stats as Unknown and is always readable. None of these is reachable yet: the claim itself is still refused by name. `PartitionInfo` gains `unique()` and `of_type()`, the two GUIDs as the `PartGuid`s a `part:` and a `part-type:` entry spell — what a holder compares its description against. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
Japabu
marked this pull request as ready for review
September 24, 2026 08:59
Collaborator
Author
|
Review of #487 at CI at BLOCKER
NOTE
REMOVE
SEND BACK |
…elector word its class does not read Round-1 review of #487. - `part-type:` / `PartitionOfType` is deleted. The A/B slots share TOYOS-ROOT's type, so a type names neither slot, and whether a type grant resolved depended on which other disks were plugged in. Whoever writes a GPT and the `system.toml` that names its slots fixes each slot's unique GUID and spells `part:`. `PartitionName` goes with it: a request carries a `PartGuid`, `SysCap::claim_partition` and `endow::partition` take one, and `PartitionInfo` loses the type GUID only a type-named claim needed (24 bytes, asserted). - `SYS_DEVICE_CLAIM` refuses a nonzero selector word its class does not read (`InvalidArgument`): both words for a class that names one device, the second for `pci`. It used to drop them. - `MAX_BLOCKS_PER_CALL` loses its rationale: nothing ties it to the page cache's own write-back run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
Japabu
added a commit
that referenced
this pull request
Sep 24, 2026
…only The kernel side of the merge: `try_claim` reads the selector as one partition's unique GUID, `gpt::claimable` looks for that GUID alone (the type scan and its second lookup go with `part-type:`), and the partition matches name one class. `PartitionInfo` no longer carries a type GUID. The guest and its host test still spell `part-type:`; the commits after this rewrite them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
Collaborator
Author
|
Review of #487 at CI at Round-1 BLOCKER
BLOCKER(none) NOTE
REMOVE(none) NOT READY FOR REVIEW |
Japabu
added a commit
that referenced
this pull request
Sep 24, 2026
Main carries partition claims (#487), path isolation (#488) and host-only PR CI. The one conflict was tests/toyos-rust-tests/Cargo.lock: main bumped toyos to 0.8.0 and toyos-abi to 0.7.0; the branch added toyos-i219. Both kept. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ABI half of the owner's ruling that a GPT partition is a claimable device, exactly as a PCI function is. The kernel here refuses every new call by name; the implementation, init's live grant and the tests are the stacked second PR (#489).
What changed, per decision
part:<GUID>names a partition by its unique partition GUID, and that is the only name a partition has: one device class,Partition = 8. The GUID is the uppercase registry form and nothing else — one spelling per partition, asPciIdhas one per card.DeviceRequest::MAX_NAME16 -> 48 (part:and a GUID is 41 bytes, rounded up to a multiple of eight). A static row names a slot by its unique GUID because whoever writes the GPT also writes thesystem.tomlthat names it and fixes the GUID; a type GUID would not name an A/B slot (both carry TOYOS-ROOT's), and whether one resolved would depend on which other disks are plugged in.PartGuid(toyos-abi/src/part.rs) holds the sixteen bytes a GPT entry stores (UEFI 2.10 §5.3.3); text <-> bytes is the mixed-endian registry mapping.SYS_DEVICE_CLAIMalready carried a fourth argument word as zero; the GUID's sixteen bytes ride the selector and that word. A selector word a class does not read is refused (InvalidArgument) rather than dropped: both words for a class that names at most one device, the second forpci.SYS_PARTITION_READ = 119,SYS_PARTITION_WRITE = 120:(claim, first, buf, count). Block numbers are the partition's own, from 0 — no argument can spell a device block, so a neighbour's blocks are unrepresentable; the end of the partition is the kernel's refusal (InvalidArgument). Buffers are typed[[u8; 4096]], so a partial block is unrepresentable and the count is the slice length. At most 32 blocks per call (MAX_BLOCKS_PER_CALL); a later, larger bound does not break a caller compiled against 32.SYS_FSYNCon the claim: the same number and the same promise a file has. No new flush syscall.PartitionInfo { blocks, unique_guid }(24 bytes, no padding, asserted).SysCap::claim_partition(PartGuid),endow::partition(PartGuid),PartitionDev { describe, read, write, sync }.endow::partition's caller is A partition is claimed by its unique GUID, held by one holder, its blocks move through the claim, and its fsync answers for its own writes #489's guest, which takes the claim init minted from apart:row.object/ops.rsanswer the new class (no readiness source; a read is the description;Unknownon stat; always readable) — unreachable until the claim is served.claim_partition), and its refusal lines stop saying "function" and "pcidev:" only.try_claimtakes both selector words; the partition class answersNotSupportedwith apartclaim:line, and 119/120 answerNotSupportednaming themselves.toyos-abi0.6.0 -> 0.7.0,toyos0.7.0 -> 0.8.0,toyos-window0.7.0 -> 0.8.0 for its pins; lockfiles follow.Gates (head
6d030c13, each run once)cargo run -- --build-only --claim-sysroot: EXIT=0cargo test -p toyos-build --lib: EXIT=0cargo test --workspace --exclude toyos-build: EXIT=0 (toyos-abi's partition tests among them)cargo run -- --sdk-version-check: EXIT=0cargo run -- --abi-split-check: EXIT=0cargo run -- --clippy: EXIT=0cargo test(fast tier): EXIT=0 —356 passed, 8 quarantined and green, 356 total (233.4s).sshd_fail_closed, red once atcb4d26ecbeside another worktree's suite, is green in this run.Oracle
UEFI 2.10 §5.3.3 / Appendix A: the ESP type's registry text
C12A7328-F81F-11D2-BA4B-00A0C93EC93Band its on-disk bytes are the test ofPartGuidin both directions. The negative controls for the mechanism, and the guest arm that sends the selector words no typed wrapper can spell, are in #489, where the checks they remove live.Unsure
part:claim is then refused as ambiguous: that plan has to give the clone's partitions GUIDs of their own.🤖 Generated with Claude Code
https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK