|
发表于 2004-9-24 23:15:53
|
显示全部楼层
在2.6.x内核下使用U盘或读卡器这些移动存储设备需要以下几个模块
usbcore--usb设备支持(CONFIG_USB=m)
usb-storage--usb移动存储设备支持(CONFIG_USB_STORAGE=m)
uhci-hcd---主板usb芯片组驱动(intel和via主板上的usb芯片组都使用这个驱动,如果你的主板比较特殊,可以试试ohci-hcd,如果你的主板支持USB2.0,请用ohci-hcd试试)(CONFIG_USB_UHCI_HCD=m)
sd-mod--scsi硬盘支持(移动存储设备最终还是被虚拟成scsi磁盘来mount,这个就是scsi-disk支持)(CONFIG_BLK_DEV_SD=m)
加载这些模块后,接好U盘或读卡器,甚至数码相机(相机设置成读卡器模式),使用dmesg命令就可以见到类似下面的输出读卡器不在手,只好将数码相机接上,数码相机设置成读卡器模式,用的是xD卡)
usbcore: registered new driver usbfs
usbcore: registered new driver hub
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
USB Universal Host Controller Interface driver v2.2
ACPI: PCI interrupt 0000:00:1f.2[D] -> GSI 11 (level, low) -> IRQ 11
uhci_hcd 0000:00:1f.2: Intel Corp. 82801BA/BAM USB (Hub #1)
PCI: Setting latency timer of device 0000:00:1f.2 to 64
uhci_hcd 0000:00:1f.2: irq 11, io base 0000d000
uhci_hcd 0000:00:1f.2: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ACPI: PCI interrupt 0000:00:1f.4[C] -> GSI 5 (level, low) -> IRQ 5
uhci_hcd 0000:00:1f.4: Intel Corp. 82801BA/BAM USB (Hub #2)
PCI: Setting latency timer of device 0000:00:1f.4 to 64
uhci_hcd 0000:00:1f.4: irq 5, io base 0000d400
uhci_hcd 0000:00:1f.4: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
usb 1-2: new full speed USB device using address 2
usb 1-2: USB disconnect, address 2
usb 1-2: new full speed USB device using address 3
scsi1 : SCSI emulation for USB Mass Storage devices
Vendor: FUJIFILM Model: USB-DRIVEUNIT Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
sda: sda1
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
USB Mass Storage device found at 3
从最后几行信息输出可以获知移动存储设备已经被正确识别出来,包括制造厂商,读写模式,版本号,容量大小,写保护状态,已经成功的虚拟成scsi磁盘了,设备为sda:sda1
如果你的是读卡器,往往虚拟成多个sda设备,在win下能看到读卡器有多少个盘符,在linux下就同样会虚拟成相同数目的sda设备,依次是sda1、sda2、sda3这样类推
此后你就按你自己需要可以对/dev/sda1这样的设备进行你自己想要的操作了,譬如:mount /dev/sda1 /mnt/temp,或者mkfs.vfat /dev/sda1、fdisk /dev/sda1等等,随你喜欢
当你要卸掉移动设备时,在确认没有进程访问设备后,可以用这个命令eject /dev/sdaX,没错误后便可拔掉设备 |
|