Interfaces for accessing kernel memory

Scott Lurndal scott at convergent.com
Fri Dec 14 08:55:27 AEST 1990


In article <axhux8.50q at wang.com>, mike at wang.com (Mike Sullivan) writes:
|> tchrist at convex.com (Tom Christiansen) writes:
|> 
|> >We've all written (or at least seen) programs that make kernel dives
|> >into /dev/mem using an nlist from /vmunix in order to figure out what
|> >some particular kernel variable looks like, or perhaps even to change
|> >it.
|> ...
|> 
|> >arrays of structures?  Wouldn't it be nice to be able to get the first,
|> >then the next element until null, of the array?
|> 
|> >--tom
|> 
|> When I worked at Alliant our arrangement was very simple, we mapped the
|> kernel memory into the process (typically read only ;-) which needed
|> access.  Since my only interest was in the proc table, and a few other
|> structures which didn't have much call to change, it was immune to 
|> OS changes.  The direct mapping of kernel memory made linked lists very
|> easy to follow.
|> 

Wait a minute, there is nothing that states an implementation of unix 
is required to have a proc table (and I know of at least one which doesn't).
Nor is a proc table immune to os changes.   Exporting knowledge of 
operating system data structures is a sure way of restricting the
ability of operating system designers to change the internals of
an operating system - which no self-respecting application should know.

Your alliant applications would most likely only run on alliant 
systems - even then I suspect that the alliant o.s. engineers would
not restrain themselves from changing the format of the proc structure
just so that programs that know it will still run and/or compile.

The solution is to export interface-defined structures, independent of
the internal format (like the PIOCPRSTATUS and PIOCPSINFO requests in 
system V 4.0 /proc file system).   This allows for portable applications
which are not dependent on a particular version of a particular o.s.
In fact, such an interface could be defined so that new
information could be provided (with new releases of o.s.) in such a 
way as to not break existing programs (e.g. $GETJPI in VMS)

|> -- 
|>   ________________________
|>  /                    __  \  | Michael J. Sullivan    | "Used to be different,
|> | \  \  /  /\  |\ |  /  `  | | Wang Laboratories Inc. | Now you're the same,
|> |  \/ \/  /--\ | \|  \__T  | | mike at WANG.COM	      | Yawn as your plane"
|>  \________________________/  | 			      |	goes down in flames"

Scott Lurndal
scottl at convergent.com  {uunet|sun}!pyramid!ctnews!pase70!scottl



More information about the Comp.unix.internals mailing list