I can’t say how the Z8000 wants to implement it. On the PDP11, the _u variable is set to
the absolute 140000. This isn’t really an “allocation.” It’s just the base of one of
the kernel address segments. The kernel maps the per process data area (essentially the
user structure and the kernel stack) there. It’s just allocated as a hunk of usize
memory (usize is in 64 byte chunks on the PDP). The code one is “not expected to
understand” handles this context switch. In fact, the user structure is only ever
“initialized” for the first process (init). After that fork just copies it from the
parent to the child and then all the other system calls, etc… change it as required.
Gosh it’s been a long time since I was this deep into a UNIX kernel (especially on a
primitive machine).
Hope this helps.
Attachments:
- smime.p7s
(application/pkcs7-signature — 2.2 KB)