[net.unix-wizards] 4.1 kernel questions

smk (03/14/83)

	I have a few questions dealing with the kernel of 4.1.
In the VAX, there is a Process Control Block.  What structure(s) in
UNIX correspond to this?  Is it the u structure?  From my understanding,
the PCB cannot be altered in size, so whichever structure uses it
must have a particular size.  What is that size?  Are there unused entries
in UNIX in the UNIX-defined structure?
	If UNIX does use all the entries in the PCB, and it needs to
also keep other process/user information around, is there another
structure (that can be extended) that could be used for such a purpose?
	Also, can anyone tell me what structures are used for
process switching and where in the code it is done?  Where are the
elements about a user and those about a process related?  Where do
they differ?  What structures correspond to each?  How are they
initialized?

	Thank you GREATLY for any response.
	--steve

obrien@Rand-Unix (04/02/83)

Sounds like you have to add some info about processes.

	The notion of a PCB is built into the VAX hardware so UNIX has to
use it.  The first entry in the "u" structure is a plain vanilla PCB.
The context switch stuff is actually buried in "locore.s" (at least the
nitty-gritty part) where load-process-context and store-process-context
instructions can be executed.  Of course there's other stuff in "main.c"
and probably "machdep.c" as well as "clock.c" and other places having
to do with the UNIX mechanics of process switching as well as scheduling.

	Where you would go about adding something depends on whether or
not you need the information while the process is swapped out.  If you
do, it has to go into the "proc" structure (defined in "proc.h").  If
you only need it when the process is in-core (viz. the PCB) then the "u"
structure is preferable.