Skip to content

clanker: how the O2 hands its cache from the full model to the shadow one - #318

Merged
techomancer merged 1 commit into
techomancer:mainfrom
atomchild411:o2-handover-note
Oct 25, 2026
Merged

techomancer merged 1 commit into
techomancer:mainfrom
atomchild411:o2-handover-note

Conversation

@atomchild411

Copy link
Copy Markdown
Collaborator

A clanker note on how the O2 switches its CPU cache between the full model and the shadow model, written in answer to the question of how the hand-over works and why the log shows it flipping back and forth.

clanker/devices/o2-cache-handover-full-to-shadow.md (indexed in clanker/INDEX.md as a design note) covers:

  • why there are two models: POST keeps its stack in the data cache, so it needs the full model; after the PROM, the shadow model is faster and out of the data path;
  • full to shadow: the batch hook hands over at the first batch whose PC is outside the PROM and its copy in RAM, once POST is over; what hand_over carries across (dirty lines written back, the LL/SC link, the direct-path RAM bitmap);
  • shadow to full: an Index Store Tag to the primary data cache under the shadow model, not the PC, because the kernel and sash call into the PROM and IRIX reboots by jumping into it;
  • why the log alternates a few times during a reboot (the PROM's cache routine sets tags, then runs code in low memory outside both firmware ranges), and that boots, reboots and full installs go through it;
  • where the scheme is fragile, what a principled boundary would be (the ARCS hand-off to a loaded program), and that docs/o2-ip32.md still says the R5000 runs the full model throughout.

Documentation only; no code changes. Checked against main at 10d737f.

🤖 Generated with Claude Code

… one

The full model holds POST's stack in the cache; the shadow model runs
everything after. The note sets out when each switch happens (a PC
outside the PROM and its copy in RAM; an Index Store Tag to the primary
data cache under the shadow model), what the hand-over carries across,
why the log flips a few times during a reboot, and where the scheme is
fragile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@techomancer
techomancer merged commit c2ab21b into techomancer:main Oct 25, 2026
7 checks passed
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.

2 participants