home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!ames!purdue!mentor.cc.purdue.edu!mace.cc.purdue.edu!abe
- From: abe@mace.cc.purdue.edu (Vic Abell)
- Newsgroups: comp.sys.sgi
- Subject: need /dev/kmem advice
- Message-ID: <Bu22JC.Hz5@mentor.cc.purdue.edu>
- Date: 4 Sep 92 13:23:35 GMT
- Sender: news@mentor.cc.purdue.edu (USENET News)
- Organization: Purdue University
- Lines: 29
-
- I am trying to port an existing application to an SGI work station,
- running IRIX 4.0.5. The application uses nlist() to obtain kernel
- addresses and reads kernel values via lseek() and read() calls on
- a /dev/kmem descriptor. It's an open-file lister, ala ofiles or
- fstat, that I call lsof.
-
- The nlist() works properly, but I have to strip the high order bit
- (0x80000000) from the addresses it returns in order to avoid an EINVAL
- from lseek(). If I do that, the values I get from read() seem correct.
-
- I've even deduced (I think) how to read the user area structure from
- some hints in <sys/proc.h> and <sys/immu.h>. However, I can't find a
- way to read the array of open file pointers, using the u_ofile pointer
- in the user area. If I strip its high order bit, I get an ENXIO error
- from read(). The address appears to be in the kernel stack -- e.g.,
- 0xffffc808.
-
- So, two questions for the gurus of this news group.
-
- 1. Is stripping the high order bit from kernel addresses the right way
- to use them via /dev/kmem?
-
- 2. How does one read from addresses of form 0xffffc808?
-
- E-mail replies would be appreciated.
-
- Thanks in advance.
-
- Vic Abell <abe@cc.purdue.edu>
-