home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / sgi / 13282 < prev    next >
Encoding:
Internet Message Format  |  1992-09-04  |  1.5 KB

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