From owner-freebsd-hackers Wed Oct 18 19:46:48 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id TAA08227 for hackers-outgoing; Wed, 18 Oct 1995 19:46:48 -0700 Received: from rah.star-gate.com (rah.star-gate.com [204.188.121.18]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id TAA08219 for ; Wed, 18 Oct 1995 19:46:44 -0700 Received: from rah.star-gate.com (localhost.v-site.net [127.0.0.1]) by rah.star-gate.com (8.6.12/8.6.9) with ESMTP id TAA10415; Wed, 18 Oct 1995 19:45:03 -0700 Message-Id: <199510190245.TAA10415@rah.star-gate.com> X-Mailer: exmh version 1.6.2 7/18/95 To: HyunSeog Ryu cc: hackers@freebsd.org Subject: Re: device number for watchdog board driver In-reply-to: Your message of "Thu, 19 Oct 1995 11:06:32 +1553." <199510190206.LAA01292@ns.easy.re.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 Oct 1995 19:45:02 -0700 From: "Amancio Hasty Jr." Sender: owner-hackers@freebsd.org Precedence: bulk >>> 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