Charles.Forsyth20060303-partialeea662d19 years agoHistory
194 lines · 4.4 KB · Text
RawDownload
.TH SD 3 .SH NAMEsd \- storage device interface.SH SYNOPSIS.nf.B bind #S /dev .BI /dev/sd Cu /ctl.BI /dev/sd Cu /raw.BI /dev/sd Cu /data\&....fi.SH DESCRIPTIONThe storage device interface serves a two-level directorygiving access to multiple storage units,typically ATA(PI) or SCSI discs.Each unitis accessed via files in the directory named by the controllerto which it is attached,.IR C  ,and by its unit number.IR u .The controller naming convention for ATA(PI) units startswith the first controller being named.LR C ,the second.LR D ,etc. up to a maximum of 4 controllers.RB ([ C-F ]);legacy controllers are always 'C' and 'D'.There can be a maximum of 2 units per ATA(PI) controller.RB ([ 01 ]).The controller naming convention for SCSI units starts withthe first controller being named.LR 0 ,the second.LR 1 ,etc. up to a maximum of 16 controllers.RB ([ 0-9a-f ]).There can be a maximum of 16 units per SCSI controller.RB ([ 0-9a-f ])..PPUnits are not accessed before the first attach.Units may be individually attached using the attach specifier,for example.IP.EXbind -a '#SsdD0' /dev.EE.PPAn attach without a specifier will cause the driver to scan for all possibleunits before processing the rest of the name..PPThe subdirectory for each unit contains two files,.I ctland.IR raw .In addition,if the unit is a direct-access disc of some typeit may be split into partitions andthe subdirectory may contain a file per partition.By default,the partition.I datawill exist for such media..PPPartitions are added and deleted by writing to the.I ctlfile.IP.EXpart \f2name start-sector end-sector\fPdelpart \f2name\fP.EE.PPThe default.I datapartition may be deleted.A partition cannot be deleted if a process has it open.If a change of removable media is detected,the new media cannot be opened until all open partitionson the old media are closed..PPReading the.I ctlfile returns at least one line of textual information aboutthe unit.The first line will always be prefixed by.B inquiryand will give a manufacturer and model number if possible.A line prefixed by.B configwill be returned for appropriate media,e.g. for ATA(PI) units the remainder of the line containsconfiguration information from the device's.I identifycommand (config and capabilities)and also the available I/O transfer options;this is a diagnostic aid.A line prefixed by.B geometrywill be returned for appropriate media;at least two numbers will follow,the first being the number of sectors contained in the unitand the second the sector size in bytes.Any remaining information on the.B geometryline is unit-dependent,for instance, head,cylinder and sector counts for ATA discs.If any partitions are defined for the media,their name, start-sector and end-sector will be returned,prefixed by.BR part ..IP.EX% cat /dev/sdD0/ctlinquiry KENWOOD CD-ROM UCR-421  208E10/20/99  7.39  2 M0config 85C0 capabilities 0F00 dma 00550004 dmactl 00000000geometry 242725 2352part data 0 242725% .EE.PPThe use of DMA and multi-sector read/write commands may beenabled and disabled on ATA(PI) units by writing to the.B ctlfile.B dmaand.B rwmrespectively followed by.B onor.BR off .For example, to enable DMA on a unit that supports it:.IP.EX% echo 'dma on'>/dev/sd00/ctl.EE.PPIf supported by the unit,the standby timer may be enabled:.IP.EX% echo 'standby \f2T\fP'>/dev/sdC0/ctl.EE.PPwhere.I Tis the standby timer period in seconds..I Tmust be between 30 and 1200,or can be 0 to disable the timer..PPThe.B rawfile is used to execute an arbitrary command on the unit ata low level.This is used by programsto manipulate devices that do not fit the simple storage modelor using special commands for maintenance purposes.The following steps may be used to execute a command.IP\- Write the command to the.I rawfile;.IP\- Read or write data associated with the command, according to the direction of the transfer..IP\- Read the.I rawfile to retrieve the status of the command,returned as a text integer..SH SOURCE.B /os/port/devsd.c.br.B /os/*/sd*.[hc].SH SEE ALSO.IR ds (3),.IR floppy (3).SH BUGS.PPStill in development..PPNo LUNs..PPThe 4 controller limit for ATA(PI) is not enforced..PPNo account is taken of some buggy ATA PCI controllerssuch as the CMD640..PPATA(PI) units come up with DMA and multi-sector read/writecapability disabled.