From: julian@tfs.com (Julian Elischer)
Subject: Re: [386BSD] fixing ps: major/minor numbers for /dev/console wrong?
Organization: TRW Financial Systems
Date: Sun, 27 Sep 1992 23:27:49 GMT

In article <1992Sep27.155125.2160@drycas.club.cc.cmu.edu> ghod@drycas.club.cc.cmu.edu writes:
>Greetings...
>
>I finally got really ticked off at ps not working correctly and I finally
>decided to poke around with it this weekend. I never encountered the
>floating point execption bug that some people complained of, although I
>have noticed other problems, to wit:
>
>1) it seems unable to find certain symbols in the kernel via nlist

This is ok in a rebuilt kernel

>
>
>4) it never prints the arguments used to invoke processes (i.e. it'll
>   show you (ps), which is the command name, but not 'ps -aux' which
>   is the command line invokation).

    0  3331  3053  35  36  0   260    0 -      R+   p0    0:00.52 ps -alx

>
>
>Problem #2 is what I really want to discuss. After obtaining the source code
>to ps and twiddling with devname.c so that it would print out device numbers,
>I discovered that it thinks the console device is at major number 12, minor
>number 0. However, the console entry in the /dev directory says it's at
>major number 0, minor number 0 (and a character special device). This is
>WRONG WRONG WRONG!!! /dev/wd0a is *ALSO* at major 0, minor 0 (a block special
>device). Now I don't care that one is a character special file and the
>other is a block special file, YOU CAN'T HAVE TWO DIFFERENT DEVICES WITH THE
>SAME MAJOR/MINOR NUMBERS!!!

Of COURSE you CAN have a character and block device on the same numbers
It's like comparing apples and oranges. They are indeces to DIFFERENT TABLES.

The BUG is that it is looking for 12 not 0.
The problem comes in because there is a 'pseudo device' called console
and an actual device, pccons. The pseudo device is mapped to use the
actual device, but theoretically you can remap the console to
be any other terminal type device (tty01?)

You are in fact logging in on pccons which is answering as console
for 'who' but obviously internally still has the vnode of
pccons internally.
Your new device should be pc0 or pccons, not console.

I agree with younthat there is something funny going on, but it's not
a clash with wd0, because wd0 is a BLOCK device.


>If it happens that someone has already posted
>an article about this, I apologize for wasting bandwitdh, but there's nothing
>about this in the FAQ file (that I could see). I have since created a new
>/dev/console at major 12, minor 0: everything still works and ps can now
>identify the console device correctly. If someone knows of some
>other driver that might also wind up using this major/minor combination,
>please let me know by posting or e-mail.

is the kernel you booted off called 386bsd? did the symbol database get built
during boot? etc.

>
>--Bill Paul
>Assistant System Administrator
>New Windsor Associates L.P.
>
>	ghod@drycas.club.cc.cmu.edu  -or-  ghod@drycas.bitnet
>
>	"A black hole is what happens when god divides by zero."


+----------------------------------+       ______ _  __
|   __--_|\  Julian Elischer       |       \     U \/ / On assignment
|  /       \ julian@tfs.com        +------>x   USA    \ in a very strange
| (   OZ    ) 2118 Milvia st. Berkeley CA. \___   ___ | country !
+- X_.---._/  USA+(510) 704-3137(wk)           \_/   \\            
          v