🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.internals
3 messages
3 total messages Started by Chris Hare Sat, 23 Jan 1993 16:10
reading a processes u-area
#2603
Author: Chris Hare
Date: Sat, 23 Jan 1993 16:10
14 lines
1012 bytes
In an attempt to understand more about how the kernel operates, I am trying
to write a version of crash.  As a result, I will in several different
instances need access to a processes u-block.  I would prefer to try and do
this without having to make use of system-specific system calls, although
if this is going to be the only method, then I guess I will have to resort
to it.

Anyone who could provide some insights would be appreciated immensly.

Chris
-- 
????                --- It Always works for me! ---                           
Chris Hare, UNIX Scientist                  Preferred : chare@unilabs.org
Just a mild-mannered consultant by day ....
Re: reading a processes u-area
#2606
Author: Michael Davidson
Date: Sat, 23 Jan 1993 18:20
32 lines
2045 bytes
chare@unilabs.uucp (Chris Hare) writes:

>In an attempt to understand more about how the kernel operates, I am trying
>to write a version of crash.  As a result, I will in several different
>instances need access to a processes u-block.  I would prefer to try and do
>this without having to make use of system-specific system calls, although
>if this is going to be the only method, then I guess I will have to resort
>to it.

The precise mechanism by which you get access to the u-block for a
process is inevitably going to be *very* system specific regardless
of whether you use a system call if one happens to be available
(eg the RDUBLK subfunction of sysi86() on Intel SVr3 and SVr4 systems)
or if you just go poking around in /dev/kmem and /dev/swap.

To be honest a lot of the stuff that "crash" does is inherently
very system specific since it has knowledge of internal kernel
data structures that may be implemented differently (if, indeed, they
exist at all) on different systems.

One of the secrets of writing portable code is to recognise which
parts of the code are inherently non-portable and implement those
functions in a separate module with a clean interface do that they
can be re-implemented easily when you have to port to another system.
Just put the function for accessing the u-block in a separate module,
implement it with whatever support is available on your system and
quit worrying about it ....

(Unfortunately, even if you *do* port this code to another system
I hope you realise that there is a good chance that the u-block you
get back won't look much like the one on the first system ....)
Re: reading a processes u-area
#2607
Author: Guy Harris
Date: Sun, 24 Jan 1993 20:21
7 lines
854 bytes
>(Unfortunately, even if you *do* port this code to another system
>I hope you realise that there is a good chance that the u-block you
>get back won't look much like the one on the first system ....)

And not all UNIX implementations (or "UNIX-compatible implementations")
necessarily even *have* U areas (SunOS 5.x might not, and some future
BSD might not, either).
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads