Jarkko Lavinen wrote:
I am trying to get usb mass storage on MMC card working with Windows
on an Arm based test board with 2.6.16-omap1 kernel. Windows detects
the usb mass storage but fails to see the disk.

I load the module with "insmod g_file_storage.ko stall=0
file=/dev/mmcblk0".
When I hook the device to Win2K, It seems to try to read the MBR after
which it issues a reset. These attempts go on and on, just as Windows
couldn't read the MBR at all.

Comparing with Linux host, everything works and I can read and write
to the MMC card.  Using some other file instead of MMC block device
has the same results: Linux host pc works, Win2K does not.

Any help is appreciated.

I found Windows to be picky about the backing file.  Here are my notes
for a 4mb file that worked for me.

# dd bs=1M count=4 if=/dev/zero of=dsk4mb.img
4+0 records in
4+0 records out

# /sbin/fdisk dsk4mb.img
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF 
disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

You must set cylinders.
You can do this from the extra functions menu.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): x

Expert command (m for help): s
Number of sectors (1-63, default 63): 8
Warning: setting sector offset for DOS compatiblity

Expert command (m for help): h
Number of heads (1-256, default 255): 1

Expert command (m for help): c
Number of cylinders (1-1048576): 1024

Expert command (m for help): r

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (2-1024, default 2):
Using default value 2
Last cylinder or +size or +sizeM or +sizeK (2-1024, default 1024):
Using default value 1024

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): p

Disk dsk4mb.img: 0 MB, 0 bytes
1 heads, 8 sectors/track, 1024 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

     Device Boot      Start         End      Blocks   Id  System
dsk4mb.img1               2        1024        4092    b  W95 FAT32

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 25: Inappropriate 
ioctl for device.
The kernel still uses the old table.
The new table will be used at the next reboot.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

# /sbin/losetup -o 4096 /dev/loop0 dsk4mb.img

# mkdosfs /dev/loop0
mkdosfs 2.8 (28 Feb 2001)
Loop device does not match a floppy size, using default hd params

# mount -t vfat /dev/loop0 /mnt/loop

# echo "4mb backing file" >/mnt/loop/test

# umount /dev/loop0

# /sbin/losetup -d /dev/loop0


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to