How do you find the user structure?

R.HUTCHISON hutch at lzaz.ATT.COM
Tue Dec 13 05:12:15 AEST 1988


>From article <13232 at ncoast.UUCP>, by allbery at ncoast.UUCP (Brandon S. Allbery):
~ As quoted from <214 at fesk.UUCP> by sverre at fesk.UUCP (Sverre Froyen):
~ +---------------
~ | I have tried to get Brandon's sysV version of w to work on my
~ | National Semiconductor ICM3216 running SysV.2.2.  This is a
~ | demand paged system and, as Brandon points out in the documentation,
~ | w is unable to locate the user structure.  I have looked through
~ | the system documentation and various include files but I am unable
~ | to find the solution (I have no source).  I suspect I must start
~ +---------------
~ 
~ I've been trying to find it myself, via trial-and-error; I want to use it on
~ a few demand-paged System V-based machines myself.  Anyone know what V.2.2
~ and V.3.1 do with the ublock?
~ 
~ Thanks in advance, all.
~ 
~ ++Brandon
~ -- 
~ Brandon S. Allbery, comp.sources.misc moderator and one admin of ncoast PA UN*X

In the systems I have looked at, the user area is either indirectly 
pointed to by an entry in the process table (something like p_ubptbl)
or is stuck somewhere in a process-page table.  If you have a pointer
to the page table, you will have to look at a system reference manual
to see how the ptbl maps vitrual to physical pages and then use this
information to trot off and find them. 

If the user area is stuck in a process page table, I believe that you would
need more detailed information on your implementation of the OS to
find its virtual address and, hence, its relative location in the page table.

If the process has been swapped (5.3.1 and after), you may have to go
to the correct swap device to find it (real pain for applications).

In any case, you will always run the risk of not finding it where you
througt it was supposed to be, especially if there is a lot of paging
going on on your system (applications are always pre-emptable at any
time (well amost any):)

I wonder if anyone has thought about making the handling of the user
area portable in SVR4?  It seems to be quite different in every
version I've looked at.  I assume that the reduction of
machine-specific code is an objective for new releases, especially in
the memory management area.

Bob Hutchison
att!lzaz!hutch



More information about the Comp.unix.questions mailing list