修改内核:
device ata
device atapicam # emulate ATAPI devices as SCSI ditto via CAM
# needs CAM to be present (scbus & pass)
device scbus # base SCSI code
device pass # CAM passthrough driver
device da # SCSI direct access devices (aka disks)
device uhci # UHCI controller
device usb # General USB code (mandatory for USB)
device umass # USB Mass Storage
编译:
cd /usr/src/usr.bin/usbhidctl/;make;make install
cd /usr/src/usr.sbin/usbd/;make;make install
cd /usr/src/usr.sbin/usbdevs/;make;make install
重启:
# dmesg |grep umass
umass0: vendor 0x0ea0 product 0x6803, rev 1.10/1.00, addr 2
da0 at umass-sim0 bus 0 target 0 lun 0
(da0:umass-sim0:0:0:0): READ(6)/WRITE(6) not supported, increasing minimum_cmd_size to 10.
....
..
检测设备:
# usbdevs -v
Controller /dev/usb0:
addr 1: self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
port 1 addr 2: power 100 mA, config 1, product 0x6803(0x6803), vendor 0x0ea0(0x0ea0), rev 1.00
port 2 addr 3: low speed, power 100 mA, config 1, Microsoft IntelliMouse® Explorer(0x001e), Microsoft(0x045e), rev 1.03
#camcontrol devlist
(SnapPort Stick 1.00) at scbus0 target 0 lun 0 (da0,pass0)
#camcontrol inquiry 0:0:0
pass0: Removable Direct Access SCSI-2 device
pass0: Serial Number
pass0: 650KB/s transfers
Mounting:
FAT
mount_msdos /dev/da0s1 /mnt/fat
UFS
mount /dev/da0s1a /mnt/ufs