home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / ultrix / 6647 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  2.2 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!sdd.hp.com!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nabeth!alan
  2. From: alan@nabeth.enet.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
  3. Newsgroups: comp.unix.ultrix
  4. Subject: Re: What happened to p_swaddr?
  5. Message-ID: <1992Sep2.173818.20277@nntpd2.cxo.dec.com>
  6. Date: 2 Sep 92 17:38:18 GMT
  7. References: <BtxI6v.3CG@cs.psu.edu>
  8. Sender: alan@nabeth (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
  9. Reply-To: alan@nabeth.enet.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
  10. Organization: Digital Equipment Corporation
  11. Lines: 49
  12.  
  13.  
  14. In article <BtxI6v.3CG@cs.psu.edu>, kenh@leps5.phys.psu.edu (Ken Hornstein) writes:
  15. >
  16. >Lately I've been trying to compile sps, top, ofiles, lsof .... with very little
  17. >success on our Ultrix 4.0 system.
  18.  
  19. You want to look around on gatekeeper.dec.com to see there are V4 versions
  20. of any of these programs.  Monitor (pub/DEC/monitor.tar.Z) has V4 algorithms
  21. for reading the user structure when it's swapped.
  22.  
  23. > [ Description of how p_swaddr was removed and a bunch of dmap structures
  24. >   added. ]
  25.  
  26. If you look closely at the proc structure you'll see that the field
  27. added are all addresses of dmap structures.  The dmap structure will
  28. probably be defined in /usr/include/sys/dmap.h.  I don't much about
  29. the details of it though.  The different dmap structures are:
  30.  
  31.     p_dmap - Disk map for data segment
  32.     p_smap - Disk map for stack segment
  33.     p_cdmap - Shadows for data/stack swap
  34.     p_csmap - used during fork/exec
  35.  
  36. Since the user structure lives at one end of the stack, the disk
  37. map for the stack will describe where the stack is and therefore
  38. where the user structure is.  So as not to leave the details as
  39. an exercise to the reader, I borrow the following segment from
  40. Monitor.
  41.  
  42.     struct dmap l_dmap ;
  43.  
  44.     if( Process is swapped... ) {
  45.         readk(proc.p_smap, (char *)&l_dmap, sizeof(struct dmap)) ;
  46.  
  47.         readk(l_dmap.dm_ptdaddr, (char *)&ublkno, sizeof(int)) ;
  48.  
  49.         addr = dtob(ublkno) ;
  50.  
  51.         reads(addr, (char *)&user, sizeof(struct user)) ;
  52.     }
  53.  
  54. The Monitor function readk read from /dev/kmem.  The first argument is
  55. the kernel address, the 2nd the data address and the 3rd the data length.
  56. The reads function reads from /dev/drum.
  57.  
  58. >--Ken
  59. >
  60. --
  61. Alan Rollow                alan@nabeth.cxo.dec.com
  62.