Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Oct 1995 20:31:44 -0700 (PDT)
From:      Julian Elischer <julian@ref.tfs.com>
To:        hasty@rah.star-gate.com (Amancio Hasty Jr.)
Cc:        moonhunt@easy.re.kr, hackers@freebsd.org
Subject:   Re: device number for watchdog board driver
Message-ID:  <199510190331.UAA21719@ref.tfs.com>
In-Reply-To: <199510190245.TAA10415@rah.star-gate.com> from "Amancio Hasty Jr." at Oct 18, 95 07:45:02 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 
> 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
> ....
this is what devfs is for
with the added advantage that you can access the devices from there as well
for an axample:
freeway: {1} ls -lR /devs
total 0
dr-xr-xr-x  4 root  wheel  29 Oct 17 00:36 disks
dr-xr-xr-x  2 root  wheel  96 Oct 17 00:36 misc

/devs/disks:
total 0
dr-xr-xr-x  2 root  wheel  16 Oct 17 00:36 floppy
dr-xr-xr-x  2 root  wheel  16 Oct 17 00:36 rfloppy

/devs/disks/floppy:
total 0
brw-r--r--  2 root  wheel    2,   0 Oct 17 00:36 fd0.1440

/devs/disks/rfloppy:
total 0
crw-r--r--  2 root  wheel    9,   0 Oct 17 00:36 fd0.1440

/devs/misc:
total 0
crw-r-----  2 root  wheel    0,   0 Oct 17 00:36 console
crw-r-----  2 root  kmem     2,  14 Oct 17 00:36 io
crw-r-----  2 root  kmem     2,   1 Oct 17 00:36 kmem
crw-r-----  2 root  kmem     2,   0 Oct 17 00:36 mem
crw-rw-rw-  2 root  wheel    2,   2 Oct 17 00:36 null
crw-r-----  2 root  kmem    34,   0 Oct 17 00:36 pmem
crw-r-----  2 root  kmem    33,   0 Oct 17 00:36 tiga
crw-rw-rw-  2 root  wheel    2,  12 Oct 17 00:36 zero

as an example.. pmem and tiga 
have no entries in conf.c
they added their own entries dynamically
and told devfs about it..
devfs reports where they ended up (apparently they slotted themselves
in at 33 and 34)


I need to add about 10 lines of code to each device driver to make this 
complete, but the one that is holding me back is the diskslice/disklabel
code, which needs a rather more complicated interaction with devfs,
and I haven't worked out what the best way of doing it yet is..

> 
> 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.
EXACTLY Why devfs is needed.. handles LKMS and other such things..
for example a device might go into debug mode when given 
a particular ioctl, and could create a debug device
on the fly.. (for debug info to come out of or something)
turning debug mode off again.. that debug device would dissappear again.
(If you had it open you would end up holding a vnode to the deadfs)



> 
> 	Enjoy,
> 	Amancio
> 
> 
> 




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