USB Mass Storage Device with HPS Stack

Xiaofan Chen xiaofanc at gmail.com
Mon Apr 28 13:46:49 UTC 2008


On Mon, Apr 28, 2008 at 4:35 PM, Hans Petter Selasky <hselasky at c2i.net> wrote:
>  >
>  > >  Then try to mount again. You can also try loading ata-usb instead of
>  > > umass. ata-usb will query the disk size regularly.
>  >
>  > Hmm, I do not see any thing similar to ata-usb module in the kernel and
>  > I can not load ata-usb.
>  >
>  Do you have:
>
>  /sys/modules/ata/atausb ?
>

Hmm yes I have the module.

[mcuee at freebsd7 /sys/modules/ata/atausb]$ sudo make
[mcuee at freebsd7 /sys/modules/ata/atausb]$ sudo make install
install -o root -g wheel -m 555   atausb.ko /boot/kernel
kldxref /boot/kernel
[mcuee at freebsd7 /sys/modules/ata/atausb]$ sudo kldload atausb

After plugging in the USB disk, I got the following:
[mcuee at freebsd7 ~]$ dmesg
umass0: <USB Mass Storage, class 0/0, rev 2.00/2.00, addr 2> on usb2
umass0:  SCSI over Bulk-Only; quirks = 0x0000
umass0:0:0:-1: Attached to scbus0
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <NATIONAL FLASH DISK 2.00> Removable Direct Access SCSI-2 device
da0: 40.000MB/s transfers
da0: 477MB (976896 512 byte sectors: 64H 32S/T 477C)
cd0 at umass-sim0 bus 0 target 0 lun 1
cd0: <NATIONAL FLASH DISK 2.00> Removable CD-ROM SCSI-2 device
cd0: 40.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present
GEOM_LABEL: Label for provider da0s1 is msdosfs/NATIONAL.

[mcuee at freebsd7 ~]$ sudo cat /dev/null > /dev/cd0
bash: /dev/cd0: Permission denied
[mcuee at freebsd7 ~]$ su -
freebsd7# bash
[root at freebsd7 ~]# cat /dev/null > /dev/cd0
[root at freebsd7 ~]# mount_cd9660 /dev/cd0 /media/usbcd
mount_cd9660: /dev/cd0: Invalid argument

[root at freebsd7 ~]# kldunload umass
kldunload: can't find file umass

So it seems that umass is still claiming the device. How do
I unload umass without rebuilding the kernel?

Xiaofan


More information about the freebsd-usb mailing list