[comp.os.minix] Revision of PC 1.5.10 ps.c

cwr@pnet01.cts.com (Will Rose) (09/02/90)

This is a revision to ps.c for the IBM PC 1.5.10.  The present version
works, but is a bear to change when recompiling the system; partly because
it uses a non-ASCII database, and partly because it either expects permanent
symbol tables in kernel, mm and fs, or the images on a specific path.
 
I changed it to use an ASCII database, produced by the Makefile in tools;
I also added an option to use an alternate database, handy if you are just
switching kernels briefly.  There was a logic bug in the selection of
options which has gone, and processes which ps can't get to grips with now
have [ ] around them.
 
More doubtfully, I renamed the options to V7 standards - I think.
 
/*
 *  Change summary:
 *  1.  Made database update easier, by using ASCII database and not
 *      requiring object files in fixed postions or symbol files in kernel.
 *  2   Removed the -U option, now unused.
 *  3.  Fixed error in selection of options.
 *  4   Renamed options to V7 standards. (?)
 *  5.  Added -n option, to use alternate database file.
 *  6.  Added brackets [ ] around process names with missing options.
 */
 
This compressed, uuencoded shar file has the full ps.c, together with
a tools/Makefile entry, a ps.sym file, and new man1 and man4 pages.
 
Good luck - Will
 
==8<==================================================================
 
table
 !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
begin 644 ps.shar.Z
M'YV-9<:@>0,"#X@6(-J$65/&!9PY"N:4(0/BQ LO6%[,><'Q! @?"1<V? B"z
M!X^*+TXHP#)BY0@05-"DF0-"3ADX;,*,*4.3#IHR(.;0">.&3!@Y%.?D::,#y
M1!DW=.3D 9'&#0@Z;]ZPV=A$I)DT;,JXA/D3Q$,72MN ^!J6*LTZ$BF*F>H3x
M*)LW8\*P,4MSS)LV"HNR $&48ANX=$"( =KFC9V)5]^,K0N"3!J;8[!*I6KUw
MCDR!?)WB@1.03D^"7XM2I3/X!5PY+\K0&:-X*IDR9L+484/'A<N5:74D$%,'v
MK-RL=,3<7<,Y#9V5"8 $'%B1RTLB88:*"2-Q[1LY?#WZ</'B;%KH0,[8A%,1u
MQ!<X<O"2(.'1!7F&<MR48:-QJ1BM+KQ11V(^C%?>'&@MA9Y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0() $K<&LL*JY_L&06!01Xd
MUU5%GL['FA6S#'/W>I!F!"F]]IKV)=[5Y62@H%5=EZU/>X]L%542$&4#!/JHc
MS_:Z;MN_IED/[E^&N*=Q(*#<3WN9W>>7?+#M1 G+NZ^X,2<%7-R\]_;;[M-?b
MA6H/\'7=M3_WE%[==_L[+SI/4[A' N,^WIM[_HWNOX#"K_67WN&[>X@/[^7]a
MJ*?W;7ZF1EH\4 )9X2/JT@K M% '-D%4SH.<<"UU8J'(EHP"C2/*6, .("6Kz
MD+4[TE6^2EBQ/WAA)725LY)6' 2$6 EO):[,E;IB(AK(2M K?,6O0#8Q(/3/y
35V$Y+*!\M6"!KL)8;(!CT6AH @2$x
 w
end
 
-----------------------------------------------------------------------
"If heaven too had passions  | Will Rose
     even heaven would       | UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!cw
     grow old."  -  Li Ho.   | ARPA: crash!pnet01!cwr@nosc.mil
                             | INET: cwr@pnet01.cts.com


UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!cwr
ARPA: crash!pnet01!cwr@nosc.mil
INET: cwr@pnet01.cts.com

jpc@fctunl.rccn.pt (Jose Pina Coelho) (09/03/90)

>In article <4217@crash.cts.com> cwr@pnet01.cts.com (Will Rose) writes:
>  [...] The present version
>  works, but is a bear to change when recompiling the system; partly because
>  it uses a non-ASCII database, and partly because it either expects permanent
>  symbol tables in kernel, mm and fs, or the images on a specific path.
>  [...]

Wouldn't it be possible to have a system call to give that info to ps ?

I know that in unix, ps normaly reads /vmunix to get symbols, but if
you boot with shoelace, then (generaly) you want to delete the system
files from ramdisk.

Besides, minix is a development (read kernel hacking) system, so mm fs
& kernel are suposed to be very dynamic.

Andy?


--
Jose Pedro T. Pina Coelho   | BITNET/Internet: jpc@fctunl.rccn.pt
Rua Jau N 1, 2 Dto          | UUCP: jpc@unl.uucp
1300 Lisboa, PORTUGAL       | ARPA: jpc%hara.fctunl.rccn.pt@mitvma.mit.edu
Home phone: (+351) (1) 640767

- If all men were brothers, would you let one marry your sister ?

valke@wundt.psy.vu.nl (Peter Valkenburg) (09/04/90)

In article <4217@crash.cts.com> cwr@pnet01.cts.com (Will Rose) writes:
>This is a revision to ps.c for the IBM PC 1.5.10.  The present version
>works, but is a bear to change when recompiling the system; partly because
>it uses a non-ASCII database, and partly because it either expects permanent
>symbol tables in kernel, mm and fs, or the images on a specific path.
> 
>I changed it to use an ASCII database, produced by the Makefile in tools;
>I also added an option to use an alternate database, handy if you are just
>switching kernels briefly.  There was a logic bug in the selection of
>options which has gone, and processes which ps can't get to grips with now
>have [ ] around them.
> 
>More doubtfully, I renamed the options to V7 standards - I think.
> 

Yes, well of course it's okay for anyone to patch up programs that come with
Minix, indeed it is one of the reasons Minix is improving in quality rather
fast.

What bothers me (being the author of ps ;-) in this case, however, is that a
petite letter to either me or perhaps some of the testers would coordinate
efforts to improve programs like this one in a far more efficient way than is
possible when everybody just hacks away at the sources and posts the results.
I still think that such tactics can work when concerned with fixes for
evident bugs, but in this case there are a few problems:
	1) Will Rose has provided a fix for a problem which isn't there -
	   Ps neither requires kernel/mm/fs to be in standard places, nor
	   that they always contain symbol tables.  You can pass the paths
	   for kernel/mm/fs along with a ps -U, and they don't need to
	   contain symbol tables afterwards.
	2) I have included in ps a mechanism that uses /dev to get terminal
	   names from, and fixed some other minor problems as well.  This was
	   posted a while ago, but the changes are not incorporated in Will's
	   version.
	3) I have received a change to make ps run on 386-Minix, and planned
	   to include that one, with an improved database mechanism, in a
	   new posting.

Again, I'm not saying that nobody should lay his/her hands on "my baby" or
anything silly like that, but I just don't see the sense in having multiple
incompatible versions and out-of-phase updates around.  It's just wasted
effort if nobody knows what the other person is doing (and this is of course
a problem the Minix community is somewhat susceptible to).

Bye,
	Peter Valkenburg (valke@psy.vu.nl).

[P.S.: of course I will go through your source and check out the fixes, Will.
       This article was *not* meant to critisize your work in itself].

cs00chs@unccvax.uncc.edu (charles spell) (09/05/90)

In article <1454@wundt.psy.vu.nl>, valke@wundt.psy.vu.nl (Peter Valkenburg) writes:
> 
> ........................, but I just don't see the sense in having multiple
> incompatible versions and out-of-phase updates around.  It's just wasted
> effort if nobody knows what the other person is doing (and this is of course
> a problem the Minix community is somewhat susceptible to).
> 
> Bye,
> 	Peter Valkenburg (valke@psy.vu.nl).
> 

I agree totally...This isnt the only utility that has had multiple versions
since 1.5.10. I think that if a command is written that it should be sent to
a set of beta testers that will OFFICIALLY release it as 1.6.x...

I thought that this was going to be done anyway...


Flames: /dev/null

/-------
| STOP...     G 'n R time..
| You know where you are? Youre in the jungle baby. Youre gonna DIIIIEEEE...
| This sensless dribble allows me to post my article. Do not take it as my
| personal opinion or views...
-- 
.--------------------------.  ...  |On the border of your mind lies a place
|uunet!mcnc!unccvax!cs00chs|  (")  |where dreams and reality are one...I will 
`--------------------------'-w-U-w-|take you there, for I am the subject...
\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\|the subject of your imagination. -Aldo Nova

ast@cs.vu.nl (Andy Tanenbaum) (09/07/90)

In article <JPC.90Sep3101257@zen.fctunl.rccn.pt> jpc@fctunl.rccn.pt (Jose Pina Coelho) writes:
>
>Wouldn't it be possible to have a system call to give that info to ps ?

More system calls?  Bah humbug (except for those mandated by POSIX).

Andy Tanenbaum (ast@cs.vu.nl)

ast@cs.vu.nl (Andy Tanenbaum) (09/07/90)

In article <2669@unccvax.uncc.edu> cs00chs@unccvax.uncc.edu (charles spell) writes:
>I agree totally...This isnt the only utility that has had multiple versions
>since 1.5.10. I think that if a command is written that it should be sent to
>a set of beta testers that will OFFICIALLY release it as 1.6.x...

There is a referee's mailing list, but precious little has been sent to it.
In any event, I would suggest that if person A fixes up person B's code, it
would be a good idea to send a copy to person B for comments before sending
it to anyone else.  That may lead to useful ideas.  After that, it should go
to the referees.  Then post it.  This protocol should help ensure high quality.

Andy Tanenbaum (ast@cs.vu.nl)

jpc@fctunl.rccn.pt (Jose Pina Coelho) (09/07/90)

>In article <7468@star.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes:
>   More system calls?  Bah humbug (except for those mandated by POSIX).

Then we could have the structure that is in the ps database inserted
at the beggining of the kernel, then, when you boot the system, the
kernel initialization would get the relevant information in place.
This way ps would read /dev/kmem to get position of the tables.

--
Jose Pedro T. Pina Coelho   | BITNET/Internet: jpc@fctunl.rccn.pt
Rua Jau N 1, 2 Dto          | UUCP: jpc@unl.uucp
1300 Lisboa, PORTUGAL       | ARPA: jpc%hara.fctunl.rccn.pt@mitvma.mit.edu
Home phone: (+351) (1) 640767

- If all men were brothers, would you let one marry your sister ?

sean@watcsc.waterloo.edu (Sean Goggin) (09/09/90)

In article <JPC.90Sep7093940@fogo.fctunl.rccn.pt> jpc@fctunl.rccn.pt (Jose Pina Coelho) writes:
>>In article <7468@star.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes:
>>   More system calls?  Bah humbug (except for those mandated by POSIX).
>
>Then we could have the structure that is in the ps database inserted
>at the beggining of the kernel, then, when you boot the system, the
>kernel initialization would get the relevant information in place.
>This way ps would read /dev/kmem to get position of the tables.

Better I think is /dev/usermemory
that you can mount on /proc
and use ls to see processes or ps 
shared text could be shown as a hard links


total 654
-rw-r--r--   1 sean     minix      55800 Sep  5 16:11 D#PID1
-rw-r--r--   2 sean     minix      29089 Sep  5 16:11 T#PID1
-rw-r--r--   1 sean     minix      15901 Aug 25 00:03 S#PID1
-rw-r--r--   2 sean     minix      55800 Sep  5 16:11 D#PID2
-rw-r--r--   1 sean     minix      29089 Sep  5 16:11 T#PID2
-rw-r--r--   1 sean     minix      15901 Aug 25 00:03 S#PID2
											

-- 
SADGoggin...SEC:001................+1.519.725.2289....sean@watcsc.waterloo.edu..

archer%segin4.segin.fr@relay.prime.com (Vincent Archer) (09/12/90)

Sean Goggin <sean@watcsc.waterloo.edu> writes:
>Better I think is /dev/usermemory
>that you can mount on /proc
>and use ls to see processes or ps
>shared text could be shown as a hard links
>
>total 654
>-rw-r--r--   1 sean     minix      55800 Sep  5 16:11 D#PID1
>-rw-r--r--   2 sean     minix      29089 Sep  5 16:11 T#PID1
>-rw-r--r--   1 sean     minix      15901 Aug 25 00:03 S#PID1
>-rw-r--r--   2 sean     minix      55800 Sep  5 16:11 D#PID2
>-rw-r--r--   1 sean     minix      29089 Sep  5 16:11 T#PID2
>-rw-r--r--   1 sean     minix      15901 Aug 25 00:03 S#PID2

Another plan9/Killian's process file system addict?

This looks great. But did you think about the actual implementation under
Minix? Let's take the problems in sequence:

* FS caches the blocks it reads. So, when you do the ls twice on /proc, you
  would cache the situation on the first call, then (if cache is bigger) gets
  the cache information on the second call (and not see the new ls at all).
  This leads to the implementation of "non-cacheable" or "volatile" (in
  reference to the ansi-C notion of "volatile" variables) devices; i.e. block
  devices you cannot cache at all: any read option leads to a new read of
  the block you reference.
* You wouldn't manipulate the /proc directory. Do not forget to mount it as
  a read-only device. Then you fix FS so that it takes in account the read-only
  attribute in all functions (try cmd1|cmd2 while in a directory on a ro fs!)
* Then you need a task to give you such infos. The obvious task is MM: it's the
  one who knows best how to manipulate processes memory. One problem remains:
  If you use MM for such a task, then MM can send messages to FS (when it loads
  file images, forks, or things like that), and FS can send messages to MM
  (when it needs an inode descriptor, or the directory contents). Guess what
  will happen soon? Yes, you're right: a deadlock looms ahead...
* The FS does not gets inodes & things like that from devices. It gets blocks
  which contains inodes and decode them. So your device driver need to encode
  (in FS way, so it depends from FS; no more FS-independency anymore) the
  info and guess from FS block numbers which info it should send. Verrryyy
  simple... :-)
* What would happen if the user decide to open some file (for example S#00015
  to get the argument list from the process space), and then the process dies
  and gets waited for. The process should be purged, but then the "file" is
  open, so it shouldn't until close time. And the driver is never notified
  that file are opened. Only FS know about this.
* Last (but not least): how about 68000 users. There's no separate I, D & S
  spaces on 68000s. And the address space does not start to 0, it starts at
  some specific address. So ps() would not be portable anymore (whereas it is
  now).

That's all for today :-)

Feel the complexity (and feasability) of your suggestion. For Minix 6.9, I
can't say :-), but not with the current Minix architecture.


    Vincent


Vincent Archer             | Email:archer%segin4.segin.fr@relay.prime.com
"Wrong thing to say, right thing to do; do as I say, not as I do..."

fouts@bozeman.bozeman.ingr.UUCP (Martin Fouts) (09/15/90)

>>>>> On 3 Sep 90 09:12:57 GMT, jpc@fctunl.rccn.pt (Jose Pina Coelho) said:

>In article <4217@crash.cts.com> cwr@pnet01.cts.com (Will Rose) writes:
>  [...] The present version
>  works, but is a bear to change when recompiling the system; partly because
>  it uses a non-ASCII database, and partly because it either expects permanent
>  symbol tables in kernel, mm and fs, or the images on a specific path.
>  [...]

Jose> Wouldn't it be possible to have a system call to give that info to ps ?

There are a number of current commercial implementations of Unix which
actually do this.  The simplest form copies the proc structure array
into the user's addresss space.  It is a good idea.

Marty
--
Martin Fouts

 UUCP:  ...!pyramid!garth!fouts (or) uunet!ingr!apd!fouts
 ARPA:  apd!fouts@ingr.com
PHONE:  (415) 852-2310            FAX:  (415) 856-9224
 MAIL:  2400 Geng Road, Palo Alto, CA, 94303

Moving to Montana;  Goin' to be a Dental Floss Tycoon.
  -  Frank Zappa