[comp.os.minix] need help reading data from /dev/kmem

khearn@polyslo.CalPoly.EDU (Keith Hearn) (01/18/89)

I am interested in possibly adding system activity reporting to the MINIX
  kernel ( What's system activity? See the system V sar man page, or the
  BSD vmstat and mpstat man pages). 
  
Unfortunately, to do so, I need to be able to read data from /dev/kmem.
  In UNIX i would use nlist() to get the addresses of the variables 
  I want, then do an open(), an lseek(), and a read(). Simple. 

However, MINIX (at least 1.2) has no nlist() system call. I'm not 
  even sure that there is a namelist in /dev/kmem. 
  
Has anyone out there managed to read data from /dev/kmem? 

How would you suggest I go about trying it?

Thanks,
Keith Hearn
khearn@polyslo.calpoly.edu

ast@cs.vu.nl (Andy Tanenbaum) (01/21/89)

In article <7107@polyslo.CalPoly.EDU> khearn@polyslo.CalPoly.EDU (Keith Hearn) writes:
>I am interested in possibly adding system activity reporting to the MINIX
>  kernel 
>  In UNIX i would use nlist() to get the addresses of the variables 
>  I want, then do an open(), an lseek(), and a read(). Simple. 

MINIX does not have nlist.  The compiler can be requested to produce a
symbol table on a file, however, and programs can use this symbol table
to locate things inside /dev/kmem.

Andy Tanenbaum (ast@cs.vu.nl)