⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x498.html

📁 usb develop guide
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//Norman Walsh//DTD DocBook HTML 1.0//EN"><HTML><HEAD><TITLE>Mass Storage Devices</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet"><LINKREL="HOME"TITLE="The Linux USB sub-system"HREF="book1.html"><LINKREL="UP"TITLE="How to get USB devices working under Linux"HREF="c122.html"><LINKREL="PREVIOUS"TITLE="USB and Digital Still Cameras"HREF="x405.html"><LINKREL="NEXT"TITLE="USS720 driver"HREF="x532.html"></HEAD><BODY><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">The Linux USB sub-system</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="x405.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 2. How to get USB devices working under Linux</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="x532.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="AEN498">Mass Storage Devices</A></H1><P>The mass storage device driver can potentially be used with a wide awide range of USB devices, not all of which would normally beconsidered to be mass storage. This is because the driver is really aninterface between the USB stack and the SCSI layer. Despite this, theinstructions in this section are oriented around devices like USBfloppy drives, Zip drives, LS120 drives and USB CDROMs.</P><P>Since the mass storage driver presents the USB device as a SCSIdevice, you need to turn on <TTCLASS="USERINPUT"><B>SCSI support</B></TT>, whichis under <TTCLASS="USERINPUT"><B>SCSI support</B></TT> in the configurationscript. You should also turn on subordinate options as appropriate toyour mass storage device - usually one or more of <TTCLASS="USERINPUT"><B>SCSI disksupport</B></TT>, <TTCLASS="USERINPUT"><B>SCSI tape support</B></TT>,<TTCLASS="USERINPUT"><B>SCSI CD-ROM support</B></TT> and <TTCLASS="USERINPUT"><B>SCSI genericsupport</B></TT>.</P><P>After you have compiled the kernel and rebooted (or added the relevantmodules, which is <TTCLASS="FILENAME">usb-storage.o</TT>),you should check <TTCLASS="FILENAME">/proc/scsi/scsi</TT>. Informationabout your device should be listed. </P><P>You can now mount your device. The exact syntax depends on the devicetype. The best way is to make suitable entries in<TTCLASS="FILENAME">/etc/fstab</TT>. A suitable entry for a floppy diskwould be: <TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="SCREEN">/dev/sda    /mnt/usbfd       auto            noauto,user 0   0</PRE></TD></TR></TABLE></P><P>A suitable entry for a Zip disk would be:<TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="SCREEN">/dev/sda4    /mnt/usbzip      vfat            noauto,user 0   0</PRE></TD></TR></TABLE></P><P>A suitable entry for a CDROM disk would be:<TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="SCREEN">/dev/scd0    /mnt/usbcdrom    iso9660         ro,noauto,user 0   0</PRE></TD></TR></TABLE></P><P>A suitable entry for a hard disk with a single partition would be:<TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="SCREEN">/dev/sda1    /mnt/usbhd       ext2            defaults   1   2</PRE></TD></TR></TABLE></P><P>Note that the above entries assume you have no other SCSI devices. Ifyou do have other devices, then the USB disk may not be<TTCLASS="FILENAME">/dev/sda</TT>, but could instead be<TTCLASS="FILENAME">/dev/sdb</TT>, <TTCLASS="FILENAME">/dev/sdc</TT> or someother device. You would then need to substitute the right device entryfor <TTCLASS="FILENAME">/dev/sda</TT> or <TTCLASS="FILENAME">/dev/scd0</TT>in the entries above.</P><P>Having created the entr[y/ies] in <TTCLASS="FILENAME">/etc/fstab</TT>, youneed to create matching mount point[s] in the actual filesystem. So ifyou made an entry as shown above for the USB floppy disk, then themount point would be made (as root) by:<TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="SCREEN">mkdir /mnt/usbfd</PRE></TD></TR></TABLE></P><P>You should now be able to mount your floppy disk with a command like:<TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="SCREEN">mount /mnt/usbfd</PRE></TD></TR></TABLE>or like:<TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="SCREEN">mount /dev/sda</PRE></TD></TR></TABLE></P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="x405.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="book1.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="x532.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">USB and Digital Still Cameras</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="c122.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">USS720 driver</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -