D130 - The thread pointer installs, and it is checked rather than assumed

decided ยท 2026-08-20

The last outstanding piece of phase 4. Guest code reads thread-local variables through the fs segment base; until that points at a real block, every fs:-relative access returns whatever the host left there - not zero, not the guest's, and undetectable from inside the guest.

Verified working on this machine: wrfsbase accepted, and the base reads back exactly.

Three things about how, each of which could have been done worse:

Where it cannot be done, install returns Unsupported and says which reason. Running a guest anyway with a wrong thread pointer is precisely the plausible-wrong-answer that principle 3 exists to prevent.

Not yet wired into the loader: no executable examined declares a single thread-local relocation, so nothing needs it until threading - which is the next thing that will.