📄 readme
字号:
/dev/cdroms hierarchy: /dev/cdroms/cdrom0 first CD-ROM /dev/cdroms/cdrom1 second CD-ROMEach of these entries is a symbolic link to the real device entry forthat device.Tape DevicesAll tapes, whether SCSI, IDE or whatever, are placed under the/dev/tapes hierarchy: /dev/tapes/tape0 first tape /dev/tapes/tape1 second tapeEach of these entries is a symbolic link to the directory for thatdevice. The device directory contains: mt for mode 0 mtl for mode 1 mtm for mode 2 mta for mode 3 mtn for mode 0, no rewind mtln for mode 1, no rewind mtmn for mode 2, no rewind mtan for mode 3, no rewindSCSI DevicesTo uniquely identify any SCSI device requires the followinginformation: controller (host adapter) bus (SCSI channel) target (SCSI ID) unit (Logical Unit Number)All SCSI devices are placed under /dev/scsi (assuming devfsis mounted on /dev). Hence, a SCSI device with the followingparameters: c=1,b=2,t=3,u=4 would appear as: /dev/scsi/host1/bus2/target3/lun4 device directoryInside this directory, a number of device entries may be created,depending on which SCSI device-type drivers were installed.See the section on the disc naming scheme to see what entries the SCSIdisc driver creates.See the section on the tape naming scheme to see what entries the SCSItape driver creates.The SCSI CD-ROM driver creates: cdThe SCSI generic driver creates: genericIDE DevicesTo uniquely identify any IDE device requires the followinginformation: controller bus (aka. primary/secondary) target (aka. master/slave) unitAll IDE devices are placed under /dev/ide, and uses a similarnaming scheme to the SCSI subsystem.XT Hard DiscsAll XT discs are placed under /dev/xd. The first XT disc hasthe directory /dev/xd/disc0.TTY devicesThe tty devices now appear as: New name Old-name Device Type -------- -------- ----------- /dev/tts/{0,1,...} /dev/ttyS{0,1,...} Serial ports /dev/cua/{0,1,...} /dev/cua{0,1,...} Call out devices /dev/vc/0 /dev/tty Current virtual console /dev/vc/{1,2,...} /dev/tty{1...63} Virtual consoles /dev/vcc/{0,1,...} /dev/vcs{1...63} Virtual consoles /dev/pty/m{0,1,...} /dev/ptyp?? PTY masters /dev/pty/s{0,1,...} /dev/ttyp?? PTY slavesRAMDISCSThe RAMDISCS are placed in their own directory, and are named thus: /dev/rd/{0,1,2,...}Meta DevicesThe meta devices are placed in their own directory, and are namedthus: /dev/md/{0,1,2,...}Floppy discsFloppy discs are placed in the /dev/floppy directory.Loop devicesLoop devices are placed in the /dev/loop directory.Sound devicesSound devices are placed in the /dev/sound directory(audio, sequencer, ...).Devfsd Naming SchemeDevfsd provides a naming scheme which is a convenient abbreviation ofthe kernel-supplied namespace. In somecases, the kernel-supplied naming scheme is quite convenient, sodevfsd does not provide another naming scheme. The convenience namesthat devfsd creates are in fact the same names as the original devfskernel patch created (before Linus mandated the Big NameChange). These are referred to as "new compatibility entries".In order to configure devfsd to create these convenience names, thefollowing lines should be placed in your /etc/devfsd.conf:REGISTER .* MKNEWCOMPATUNREGISTER .* RMNEWCOMPATThis will cause devfsd to create (and destroy) symbolic links whichpoint to the kernel-supplied names.SCSI Hard DiscsAll SCSI discs are placed under /dev/sd (assuming devfs ismounted on /dev). Hence, a SCSI disc with the followingparameters: c=1,b=2,t=3,u=4 would appear as: /dev/sd/c1b2t3u4 for the whole disc /dev/sd/c1b2t3u4p5 for the 5th partition /dev/sd/c1b2t3u4p5s6 for the 6th slice in the 5th partitionSCSI TapesAll SCSI tapes are placed under /dev/st. A similar namingscheme is used as for SCSI discs. A SCSI tape with theparameters:c=1,b=2,t=3,u=4 would appear as: /dev/st/c1b2t3u4m0 for mode 0 /dev/st/c1b2t3u4m1 for mode 1 /dev/st/c1b2t3u4m2 for mode 2 /dev/st/c1b2t3u4m3 for mode 3 /dev/st/c1b2t3u4m0n for mode 0, no rewind /dev/st/c1b2t3u4m1n for mode 1, no rewind /dev/st/c1b2t3u4m2n for mode 2, no rewind /dev/st/c1b2t3u4m3n for mode 3, no rewindSCSI CD-ROMsAll SCSI CD-ROMs are placed under /dev/sr. A similar namingscheme is used as for SCSI discs. A SCSI CD-ROM with theparameters:c=1,b=2,t=3,u=4 would appear as: /dev/sr/c1b2t3u4SCSI Generic DevicesThe generic (aka. raw) interface for all SCSI devices are placed under/dev/sg. A similar naming scheme is used as for SCSI discs. ASCSI generic device with the parameters:c=1,b=2,t=3,u=4 would appearas: /dev/sg/c1b2t3u4IDE Hard DiscsAll IDE discs are placed under /dev/ide/hd, using a similarconvention to SCSI discs. The following mappings exist between the newand the old names: /dev/hda /dev/ide/hd/c0b0t0u0 /dev/hdb /dev/ide/hd/c0b0t1u0 /dev/hdc /dev/ide/hd/c0b1t0u0 /dev/hdd /dev/ide/hd/c0b1t1u0IDE TapesA similar naming scheme is used as for IDE discs. The entries willappear in the /dev/ide/mt directory.IDE CD-ROMA similar naming scheme is used as for IDE discs. The entries willappear in the /dev/ide/cd directory.IDE FloppiesA similar naming scheme is used as for IDE discs. The entries willappear in the /dev/ide/fd directory.XT Hard DiscsAll XT discs are placed under /dev/xd. The first XT discwould appear as /dev/xd/c0t0.Old Compatibility NamesThe old compatibility names are the legacy device names, such as/dev/hda, /dev/sda, /dev/rtc and so on.Devfsd can be configured to create compatibility symlinks so that youmay continue to use the old names in your configuration files and sothat old applications will continue to function correctly.In order to configure devfsd to create these legacy names, thefollowing lines should be placed in your /etc/devfsd.conf:REGISTER .* MKOLDCOMPATUNREGISTER .* RMOLDCOMPATThis will cause devfsd to create (and destroy) symbolic links whichpoint to the kernel-supplied names.-----------------------------------------------------------------------------Device drivers currently ported- All miscellaneous character devices support devfs (this is done transparently through misc_register())- SCSI discs and generic hard discs- Character memory devices (null, zero, full and so on) Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>- Loop devices (/dev/loop?) - TTY devices (console, serial ports, terminals and pseudo-terminals) Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>- SCSI tapes (/dev/scsi and /dev/tapes)- SCSI CD-ROMs (/dev/scsi and /dev/cdroms)- SCSI generic devices (/dev/scsi)- RAMDISCS (/dev/ram?)- Meta Devices (/dev/md*)- Floppy discs (/dev/floppy)- Parallel port printers (/dev/printers)- Sound devices (/dev/sound) Thanks to Eric Dumas <dumas@linux.eu.org> and C. Scott Ananian <cananian@alumni.princeton.edu>- Joysticks (/dev/joysticks)- Sparc keyboard (/dev/kbd)- DSP56001 digital signal processor (/dev/dsp56k)- Apple Desktop Bus (/dev/adb)- Coda network file system (/dev/cfs*)- Virtual console capture devices (/dev/vcc) Thanks to Dennis Hou <smilax@mindmeld.yi.org>- Frame buffer devices (/dev/fb)- Video capture devices (/dev/v4l)-----------------------------------------------------------------------------Allocation of Device NumbersDevfs allows you to write a driver which doesn't need to allocate adevice number (major&minor numbers) for the internal operation of thekernel. However, there are a number of userspace programmes that usethe device number as a unique handle for a device. An example is thefind programme, which uses device numbers to determine whetheran inode is on a different filesystem than another inode. The devicenumber used is the one for the block device which a filesystem isusing. To preserve compatibility with userspace programmes, blockdevices using devfs need to have unique device numbers allocated tothem. Furthermore, POSIX specifies device numbers, so some kind ofdevice number needs to be presented to userspace.The simplest option (especially when porting drivers to devfs) is tokeep using the old major and minor numbers. Devfs will take whatevervalues are given for major&minor and pass them onto userspace.This device number is a 16 bit number, so this leaves plenty of spacefor large numbers of discs and partitions. This scheme can also beused for character devices, in particular the tty devices, which arecurrently limited to 256 pseudo-ttys (this limits the total number ofsimultaneous xterms and remote logins). Note that the device numberis limited to the range 36864-61439 (majors 144-239), in order toavoid any possible conflicts with existing official allocations.Please note that using dynamically allocated block device numbers maybreak the NFS daemons (both user and kernel mode), which expect dev_tfor a given device to be constant over the lifetime of remote mounts.A final note on this scheme: since it doesn't increase the size ofdevice numbers, there are no compatibility issues with userspace.-----------------------------------------------------------------------------Questions and AnswersMaking things workAlternatives to devfsWhat I don't like about devfsHow to report bugsStrange kernel messagesCompilation problems with devfsdMaking things workHere are some common questions and answers.Devfsd doesn't startMake sure you have compiled and installed devfsdMake sure devfsd is being started from your bootscriptsMake sure you have configured your kernel to enable devfs (seebelow)Make sure devfs is mounted (see below)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -