Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Oct 1995 19:45:02 -0700
From:      "Amancio Hasty Jr." <hasty@rah.star-gate.com>
To:        HyunSeog Ryu <moonhunt@easy.re.kr>
Cc:        hackers@freebsd.org
Subject:   Re: device number for watchdog board driver 
Message-ID:  <199510190245.TAA10415@rah.star-gate.com>
In-Reply-To: Your message of "Thu, 19 Oct 1995 11:06:32 %2B1553." <199510190206.LAA01292@ns.easy.re.kr> 

next in thread | previous in thread | raw e-mail | index | archive | help
>>> HyunSeog Ryu said:
 > > 
 > > 
 > > Dumb question: is there a  command which I can use to display all the majo
     r
 > > and minor devices and hopefully the name of the device
 > > driver that the system knows about?
 > You can refer /sys/i386/conf/devices.i386 for major number... 

Yes, I know about that lets assume that I visit a FreeBSD box and
that /sys is not there.


 > But minor number ??? ;>
 > And you can refer lsdev command also... 

Nice listing but there is no association between the nice output of 
lsdev and /dev:

lsdev -cv
# This listing automatically generated by lsdev(1)
1: # CPU cpu0
2: controller scbus0
3: controller isa0
4: sc0  at isa? tty (id 8) port 0x60 irq 1
5: ed0  at isa? net (id 14) port 0x240 irq 9 iomem 0xd4000 iosiz 16384
6: ed1  at isa? net (id 15) port 0x280 irq 5 iomem 0xd8000 iosiz 8192
7: sio0 at isa? tty (id 9) port 0x3f8 irq 4
8: sio1 at isa? tty (id 10) port 0x2f8 irq 3
9: sio2 at isa? tty (id 11) port 0x3e8 irq 5
10: lpt0        at isa? tty (id 12) port 0x378 irq 7
11: lpt1        at isa? tty (id 13) port ?
12: fdc0        at isa? bio (id 2) port 0x3f0 irq 6 drq 2
13: fd0 at fdc0 drive 0
14: wdc0        at isa? (id 3) port 0x1f0 irq 14
15: wd0 at wdc0 drive 0
16: aha0        at isa? bio (id 6) port 0x330 drq 5
17: aic0        at isa? bio (id 7) port 0x340 irq 11
18: npx0        at isa? (id 16) port 0xf0
19: chip0       at pci0:0
20: chip1       at pci0:7
21: vga0        at pci0:11 # int a irq 10
22: ahc0        at pci0:12 # int a irq 11
23: sd0 at SCSI bus 0:0:0 (ready) (open)
24: cd0 at SCSI bus 0:2:0
25: sd1 at SCSI bus 0:6:0 (ready) (open)

I guess that is too hard for a program to figure out the association of
a device driver with the major and minor number in /dev :>

Also not to mention that loadable modules are not listed...

I was thinking more along the lines of :

25: sd1 at SCSI bus 0:6:0 (ready) (open)
4, 65546  /dev/sd1
4,   8  /dev/sd1a
4,   9  /dev/sd1b
....

You see as more drivers and/or loadable modules get added to FreeBSD
it becomes rather nice to issue a single command to figure out what
is on the system.

	Enjoy,
	Amancio





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510190245.TAA10415>