ºìÁªLinuxÃÅ»§
Linux°ïÖú

ÔÚFreeBSDÏÂʹÓÃUSBÉ豸

·¢²¼Ê±¼ä:2006-12-13 00:57:15À´Ô´:ºìÁª×÷Õß:intelligent
<1>
Õ⼸ÌìΪÁËdemoAP¶øʹ¾¢Î¢µ÷ÎÒµÄFreeBSDÄںˣ¬É豸Çý¶¯¿³µôÒ»¿éÓÖÒ»¿é£¬µ½ÁËUSBÕâÀïż¿ªÊ¼ÓÐÒ»µã
ÓÌÔ¥ÁË¡£Õý×½ÃþÕߣ¬ºöÈ»·¢ÏÖÕâÑùÒ»¸öÉ豸ѡÏ
#device umass
àÅ...ÓеãºÃÍæ¶ù£¬Å¼ÄÃLinux×ö×ÀÃæºÃ¾ÃÁË£¬USBÓ²ÅÌ£¬ÓÅÅÌ£¬Å¼µÄDCºÍËüÒ²ÅäºÏµÃºÜºÃ£¬µ¹ÊÇһֱûÏë
¹ýÔÚFreeBSDÏÂʹÓÃÕâЩ¡£ºÃ°É£¬Å¼¾Í×öÒ»´ÎС°×Êó£¬ÊÔÊÔ¿´ÔÚFreeBSDÏÂʹÓÃżµÄDC°É¡£
(FreeBSD°æ±¾: 5.1 release)
ÔÚFreeBSDÏÂʹÓÃÕâЩ¹Ö¶«¶«£¬×îºÃµÄÑ¡Ôñµ±È»ÊÇ×Ô¼ºÖØбàÒëÒ»ÏÂÄںˡ£Å¼Ã»ÓÐÊÔĬÈÏÄÚºËÊÇ·ñÖ§³Ö£¬µ«
FreeBSDĬÈÏÄÚºË×ÜÊÇ×î´ó»¯±àÒëµÄ£¬ËùÒÔÓ¦¸Ã±¾Éí¾ÍÄܹ»ºÜºÃÖ§³ÖÕâЩÉ豸¡£Èç¹û²»ÐеĻ°¾Í¸úżһÆðmake
world°É¡£¾­¹ý¼¸´Îmake kernel£¬×ÜËãÃþÇå³þÁËËüµÄdepend¹Øϵ£¬ÔÚBSD/LinuxÖУ¬USBÉ豸¶¼ÊÇÄ£ÄâΪ
SCSIÉ豸µÄ£¬ËùÒÔµ±È»ÄãµÄÄں˵üÓÉÏSCSI / USB ºÍ USBMassÇý¶¯²Å¿ÉÒÔ¡£
<2>
ÕâÑù£¬ÖÁÉÙÄãµÄÄÚºËÎļþÖÐÖÁÉپ͸ÃÓÐÈçÏÂÑ¡Ïî:
===
# SCSI peripherals # SCSI Ïà¹ØÑ¡Ïî
device scbus # SCSI ×ÜÏßÖ§³Ö (±ØÐë)
device ch # SCSI media changers
device da # SCSI ´ÅÅÌÖ§³Ö (±ØÐë)
# USB support # USB Ïà¹ØÑ¡Ïî
device uhci # UHCI PCI->USB USB½Ó¿Ú (±ØÐë)
device ohci # OHCI PCI->USB USB½Ó¿Ú
device usb # USB ×ÜÏßÖ§³Ö (±ØÐë)
device ugen # Generic
#device ehci # USB 2.0×ÜÏßÖ§³Ö£¬¸ù¾ÝÄãµÄÐèÒª
device umass # USB¿é´æ´¢É豸Çý¶¯
===
Èç¹ûÄãÐèÒªÕæÕýÄܹ»Ê¹ÓÃÕâЩÉ豸µÄ»°£¬¿ÉÄÜ»¹ÐèÒª¼ÓÉÏÕâЩÒÔÖ§³ÖNTFSºÍFATÎļþϵͳ:
===
options NTFS
options MSDOSFS
===
<3>
ʹÓÃÏÂÁÐÃüÁî±à¼­ÄÚºËÅäÖÃÎļþ£¬²¢±àÒëÐÂÄںˣº
# vi /sys/i386/conf/GENERIC # Ìí¼Ó»òÐÞ¸ÄÉ϶ÎËùдµÄÑ¡Ïî
# cd /sys/i386/conf
# config GENERIC # Éú³ÉÄÚºËÅäÖÃÑ¡Ïî
# cd ../compile/GENERIC
# make depend && make install # ±àÒëºÍ°²×°ÄÚºË
# reboot # ÖØÐÂÒýµ¼
<4>
Èç¹ûÒÔÉϼ¸¸ö²½Ö趼û³ö´íµÄ»°£¬ÄÇôÄã×ßÔËÁË£¬ÏÖÔÚÄãÓ¦¸Ã¿ÉÒÔʹÓÃÓÅÅÌÖ®ÀàµÄÉ豸ÁË£¬²»¹ý»¹ÊÇÏÈÈ·ÈÏÒ»ÏÂ:
# dmesg |grep umass
# dmesg |more
ÔÚÉÏÃæÁ½ÌõÖ¸Áîºó£¬ÄãÖÁÉÙ¿ÉÒÔ¿´µ½ÕâÑùµÄÒ»¶ÎÐÅÏ¢:
===
uhci0: port 0xa400-0xa41f irq 9
at device 31.2 on pci0
usb0: on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
umass0: Genesys Logic USB TO IDE, rev 2.00/0.02, addr 2
===
Èç¹ûÄã¿´µ½ÁËumass0ÕâÒ»ÐУ¬ÄÇôÏÖÔھͲåÈëÄãµÄUSBÒƶ¯Ó²ÅÌ£¬ÓÅÅÌ£¬»òÊÇDC ~_*
²åÈëÖ®ºó£¬Ó¦¸Ã»áÁ¢¿ÌÔÚ¿ØÖÆ̨ÉÏÏÔʾһ¶ÎºÜÏÔÑÛµÄÌáʾ:
===
da0 at umass-sim0 bus 0 target 0 lun 0
da0: Fixed Direct Access SCSI-0 device
da0: 1.000MB/s transfers
da0: 19077MB (39070080 512 byte sectors: 255H 63S/T 2432C)
(da0:umass-sim0:0:0:0): READ(6)/WRITE(6) not supported, increasing minimum_cmd_
size to 10.
===
ÉÏÃæÊÇżµÄIBMÒƶ¯Ó²ÅÌ¡£
===
umass0: detached
umass0: Sony Sony DSC, rev 1.10/4.10, addr 2
da0 at umass-sim0 bus 0 target 0 lun 0
da0: Removable Direct Access SCSI-0 device
da0: 1.000MB/s transfers
da0: 123MB (253696 512 byte sectors: 64H 32S/T 123C)
===
ÉÏÃæÊÇżµÄSony DSC-P7 ÊýÂëÏà»ú¡£
<5>
È»ºó£¬¾Í¿ÉÒÔÖ±½ÓmountÕâЩÉ豸£º
# mount -tmsdos /dev/da0s1 /mnt
# ls -alF /mnt
total 50
drwxr-xr-x 1 root wheel 16384 Jan 1 1980 ./
drwxr-xr-x 17 root wheel 512 Jul 15 21:58 ../
drwxr-xr-x 1 root wheel 16384 Jan 5 2002 dcim/
-r-xr-xr-x 1 root wheel 0 Oct 26 2002 memstick.ind*
drwxr-xr-x 1 root wheel 16384 Jan 5 2002 mssony/
É豸ÃûÒ»°ãÊÇ/dev/da0s1 <2/3/4...>£¬°´ÕÕÄãµÄUSBÉ豸·ÖÇøÒÀ´Î¡£
ʹÓÃÍêÖ®ºó±ðÍüÁËÏÈumountµôÉ豸֮ºóÔڰεôŶ£¬²»È»ºÍÔÚWindowsÏÂÒ»Ñù»áµÃµ½Ò»¸ö¾¯¸æÌáʾµÄ£¬Ò»²»
СÐÄÒ²»á¶ªÊý¾Ý¡£
<6>
FreeBSDÄ¿Ç°Ö§³ÖÒÔÏÂUSB´æ´¢É豸£¬Èç¹ûÄã¶ÔUSBϵͳÊìϤµÄ»°£¬Ò²¿ÉÒÔ×Ô¼ºÌí¼Ó»òÒÆÖ²Çý¶¯¡£
(°üº¬¼¸ºõÈ«²¿ÉÁÅÌ£¬Òƶ¯Ó²ÅÌ£¬¼ÇÒä°ô£¬´ó¶àÊýµÄUSB CDROM/MO£¬ºÍһЩDC£¬MMCºÍSDδ²âÊÔ)
===
ADTEC Stick Drive AD-UST32M, 64M, 128M, 256M
Denno FireWire/USB2 Removable 2.5-inch HDD Case MIFU-25CB20
FujiFilm Zip USB Drive ZDR100 USB A
GREEN HOUSE USB Flash Memory ``PicoDrive'' GH-UFD32M, 64M, 128M
IBM 32MB USB Memory Key (P/N 22P5296)
IBM ThinkPad USB Portable CD-ROM Drive (P/N 33L5151)
I-O DATA USB x6 CD-RW Drive CDRW-i64/USB (CDROM only)
I-O DATA USB CD/CD-R/CD-RW/DVD-R/DVD-RW/DVD-RAM/DVD-ROM Drive DVR-iUH2 (CDROM,
DVD-RAM only)
Iomega USB Zip 100Mb (primitive support still)
Iomega Zip750 USB2.0 Drive
Keian USB1.1/2.0 3.5-inch HDD Case KU350A
Kurouto Shikou USB 2.5-inch HDD Case GAWAP2.5PS-USB2.0
Logitec USB1.1/2.0 HDD Unit SHD-E60U2
Logitec Mobile USB Memory LMC-256UD
Logitec USB Double-Speed Floppy Drive LFD-31U2
Logitec USB/IEEE1394 DVD-RAM/R/RW Unit LDR-N21FU2 (CDROM only)
Matshita CF-VFDU03 floppy drive
MELCO USB2.0 MO Drive MO-CH640U2
I-O DATA USB/IEEE1394 Portable HD Drive HDP-i30P/CI, HDP-i40P/CI
MELCO USB Flash Disk ``PetitDrive'', RUF-32M, -64M, -128M, -256M
MELCO USB2.0 Flash Disk ``PetitDrive2'', RUF-256M/U2, -512M/U2
MELCO USB Flash Disk ``ClipDrive'', RUF-C32M, -C64M, -C128M, -C256M, -C512M
Microtech USB-SCSI-HD 50 USB to SCSI cable
NOVAC USB2.0 2.5/3.5-inch HDD Case NV-HD351U
Panasonic floppy drive
Panasonic USB2.0 Portable CD-RW Drive KXL-RW40AN (CDROM only)
RATOC Systems USB2.0 Removable HDD Case U2-MDK1, U2-MDK1B
Sony Portable CD-R/RW Drive CRX10U (CDROM only)
TEAC Portable USB CD-ROM Unit CD-110PU/210PU
Y-E Data floppy drive (720/1.44/2.88Mb)
FreeBSD 5.1Ö§³ÖµÄUSB¿ØÖÆÆ÷
===
ALi Aladdin-V
AMD-756
CMD Tech 670 & 673
Intel 82371SB (PIIX3)
Intel 82371AB and EB (PIIX4)
Intel 82801AA (ICH)
Intel 82801AB (ICH0)
Intel 82801BA/BAM (ICH2)
Intel 82443MX
NEC uPD 9210
OPTi 82C861 (FireLink)
SiS 5571
VIA 83C572 USB
ÆäËü UHCI »ò OHCI ¼æÈÝÖ÷°å
Ö§³ÖµÄUSB HUBÉ豸
===
ADS Electronics PCI plug-in card (2 ports)
Entrega PCI plug-in card (4 ports)
Andromeda hub
MacAlly self powered hub (4 ports)
NEC hub
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ