Zuse default-attach: xHCI initial-port-scan fix, ZUSEDISK wiring, mismatched-marker resync
xhci_bringup() now scans for already-connected ports at bring-up (xhci_scan_ports_for_already_connected()), not just later hotplug events, so a USB device present on the QEMU command line at launch is detected. Makefile.starkernel attaches disk/zuse.img on the xhci0 bus by default in all three arch qemu targets (ZUSEDISK=, empties for a bare boot). capsule_mint_identity() gained a drive_known_blank param to skip a fully redundant second homeblocks_sig_check() when the caller already confirmed HOMEBLOCKS_SIG_BLANK itself. Root-caused what looked like a hang after the drive attached: Artemis's fence still carried a genesis marker from before a mid-session reformat, while the reformatted disk/zuse.img read back BLANK -- a mismatched pair capsule_zuse_boot_try_attach() correctly declined to act on, leaving the boot idling at a plain ok> with nothing left to log (indistinguishable from a hang under slow TCG). Fixed by zeroing both disk/artemis.img and disk/zuse.img at their original sizes, giving a matched blank pair. Verified full three-architecture acceptance: amd64 fresh genesis-mint, aarch64/riscv64 clean reload against the same now-minted images. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KBjfeLPo71sUQ8zC7V7P5m
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
3f74ff0f78
commit
849b83b727
@@ -59,7 +59,8 @@ static int write_devblock(struct blkio_dev *dev, uint32_t devblock,
|
||||
MintResult capsule_mint_identity(struct blkio_dev *dev, VM *issuer_vm,
|
||||
const char *full_name, const char *username,
|
||||
const char *email, const char *phone,
|
||||
uint8_t out_pubkey[32], uint8_t out_seed[32]) {
|
||||
uint8_t out_pubkey[32], uint8_t out_seed[32],
|
||||
int drive_known_blank) {
|
||||
if (!dev || !full_name || !username) return MINT_ERR_WRITE_FAIL;
|
||||
|
||||
/* full_name/username required and must fit; email/phone may be NULL
|
||||
@@ -75,8 +76,11 @@ MintResult capsule_mint_identity(struct blkio_dev *dev, VM *issuer_vm,
|
||||
|
||||
/* Refuse to overwrite an already-recognized home-blocks drive --
|
||||
* mirrors WRITE(10)'s own refuse-on-non-blank-media posture (§F.8,
|
||||
* decided 2026-08-28: "reasonable by analogy" there, now decided). */
|
||||
{
|
||||
* decided 2026-08-28: "reasonable by analogy" there, now decided).
|
||||
* Skipped when the caller already just confirmed HOMEBLOCKS_SIG_BLANK
|
||||
* itself (drive_known_blank) -- otherwise this repeats the exact same
|
||||
* full BOT read sequence a second time immediately after the first. */
|
||||
if (!drive_known_blank) {
|
||||
homeblocks_sig_t existing;
|
||||
if (homeblocks_sig_check(dev, HOMEBLOCKS_SIG_START_FBLOCK, &existing)
|
||||
== HOMEBLOCKS_SIG_OK) {
|
||||
|
||||
@@ -73,7 +73,8 @@ void capsule_zuse_boot_try_attach(struct blkio_dev *dev,
|
||||
uint8_t seed[32], pubkey[32];
|
||||
MintResult r = capsule_mint_identity(dev, (VM *)0, "Zuse", "zuse",
|
||||
(const char *)0, (const char *)0,
|
||||
pubkey, seed);
|
||||
pubkey, seed,
|
||||
1 /* sig_rc already confirmed BLANK above */);
|
||||
if (r != MINT_OK) {
|
||||
console_println("Zuse: genesis mint failed");
|
||||
return;
|
||||
|
||||
@@ -868,7 +868,8 @@ static void mama_word_mint(VM *vm)
|
||||
}
|
||||
|
||||
MintResult r = capsule_mint_identity(dev, vm, full_name, username, email, phone,
|
||||
(uint8_t *)0, (uint8_t *)0);
|
||||
(uint8_t *)0, (uint8_t *)0,
|
||||
0 /* not pre-checked -- keep the safety check */);
|
||||
switch (r) {
|
||||
case MINT_OK:
|
||||
console_println("MINT: identity minted");
|
||||
|
||||
Reference in New Issue
Block a user