Author Topic: USB Storage ported to 5xxx ROM\'s ?  (Read 25378 times)

nilch

  • Hero Member
  • *****
  • Posts: 668
    • View Profile
    • http://
USB Storage ported to 5xxx ROM\'s ?
« on: February 04, 2004, 11:54:32 am »
I have seen that the C7xx ROM\'s have had a lot of activity with new features and of course the X11 thing going too.

But for us old users, do we have a chance of getting the USB Storage features ported to the 5500 ROM\'s (and 5000D) ?

Last I heard that feature was possibel to be ported bacl to the older models so, I am really looking forward to getting that for my 5000D.

Also, Cacko ROM hasnt been updated for quite some time for the 5xxx series now. Guess they are busy with recent C7xx updates as well as the exciting X11 development.
New no more-C1000 / 5000D (sold my 6000 and 750) | Cacko ROM 1.23 on C1000 | 256 MB CF | 2GB PNY SD card | Socket Networker WiFi CF Card | USB Host cable from StreamlineCPUS | Mini Microphone (for voice recording) |

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB Storage ported to 5xxx ROM\'s ?
« Reply #1 on: February 04, 2004, 07:06:17 pm »
I looked into this a while back:

http://www.zaurususergroup.com/index.php?n...ht=mass+storage

but didn\'t get too far; that said, I think it\'s possible even with out humble 5500s


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

maslovsky

  • Hero Member
  • *****
  • Posts: 1426
    • View Profile
    • http://my-zaurus.narod.ru
USB Storage ported to 5xxx ROM\'s ?
« Reply #2 on: February 06, 2004, 08:49:17 am »
I managed to get my SL5500 to be recognized as a USB Mass Storage Device by Windows. But the problem is that I could not make it see an inserted card, nether SD not CF. The strange thing is that there are no error messages reported, all modles load successfuly and report no problems. But still Windows sees that no media inserted...

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB Storage ported to 5xxx ROM\'s ?
« Reply #3 on: February 06, 2004, 12:04:53 pm »
Where would the problems be sent anyway? Surely most would go to klogd if it were running rather than syslogd (or even stderr)?

Next thing, do we have a version of klogd for the Z?

Maslovsky, which ROM are you running? Can you provide some info as to where you got the modules and which ones you loaded/unloaded? and what arguments you passed them?

Thanks,


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB Storage ported to 5xxx ROM\'s ?
« Reply #4 on: February 06, 2004, 12:09:43 pm »
This (https://www.oesf.org/forums/index.php?showtopic=1484) might also be of interest (though it almost certainly only does what we\'ve tried in an automatic fashion).


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

slocaus

  • Full Member
  • ***
  • Posts: 243
    • View Profile
    • http://
USB Storage ported to 5xxx ROM\'s ?
« Reply #5 on: February 06, 2004, 01:01:43 pm »
It\'s been some time back, but Proto stated that he thought he could do it for the 5500 tkcROM.  Knowing the tkcKompany status on licensing and wanting to only host their ROM on a Sharp site (stated by Shawn Gordon in their mail list), that ROM is of unknown status.  Hopefully Proto will show up again sooner or later and let us know. (he did state on the tkc ML that development continues and they are waiting for DevNet to come back up.)
Handheld:. Sl-5500 tkcROM 1.0 (defunct) * apps on ext2 Lexar 256 SD
Desktop:. Mandrakelinux 10.2 Cooker * kernel 2.6.11
Both computers run linux, proud to be MS Free

Anonymous

  • Guest
USB Storage ported to 5xxx ROM\'s ?
« Reply #6 on: February 06, 2004, 04:54:55 pm »
I was looking at what dmesg and syslog says - no error messages from modules, all initialize fine.
I built storage_fd module myself from c860 kernel source.
I also copied hotplug, usb, and some other scripts from 860 root fs.
With these scripts, modules get loaded automaticaly wia hotplug mechanism with proper parameters.
But still - no media inserted is reported by Windows...

regards,
maslovsky

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB Storage ported to 5xxx ROM\'s ?
« Reply #7 on: February 08, 2004, 11:15:54 am »
Could you make your files available?

On a side not, can the cards be ext2 formatted? I presume they probably can be.

Cheers,

Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

maslovsky

  • Hero Member
  • *****
  • Posts: 1426
    • View Profile
    • http://my-zaurus.narod.ru
USB Storage ported to 5xxx ROM\'s ?
« Reply #8 on: February 09, 2004, 01:37:03 am »
Quote
Could you make your files available?

Everything is available on Sharp Japan Developer site -
http://developer.ezaurus.com/sl_j/source/source_dl.htm

You need the 860 kernel sources and hotplug scripts from root fs.

Quote
On a side not, can the cards be ext2 formatted?

Yes, but Windows will not read it.

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB Storage ported to 5xxx ROM\'s ?
« Reply #9 on: February 09, 2004, 08:07:46 am »
Cheers, I\'ve grabbed the files.

Quote
Quote
On a side not, can the cards be ext2 formatted?

Yes, but Windows will not read it.

In the standard case in a card reader, etc. but is this also true when using the Z as a mass storage device. I was wondering whether it would be okay as the Z\'s kernel is still being used to transfer the data back and forth.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Anonymous

  • Guest
USB Storage ported to 5xxx ROM\'s ?
« Reply #10 on: February 09, 2004, 02:59:03 pm »
The compiled storage_fd module goes to /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/storage_fd/ folder, followed by depmod -a

You then need to copy these files from the c860 root fs:
/etc/hotplug/*
/etc/pcmcia/ide
/etc/usbcontrol
/etc/sdcontrol
/etc/rc.d/init.d/usb

They can be found in /root/.home_default.tar

Also make sure to update /etc/hotplug/usbd.agent file to include this line:
MODULE_BI=sa1100_bi
instead of
MODULE_BI=pxa_bi

To switch to USB storage mode, create a file /etc/hotplug/usbdstorage.conf containg the name of the device to be used (/dev/mmcda1 or /dev/hda1) and do:
/etc/rc.d/init.d/usb restart

To return to normal mode (USB network) simply delete that file and restart USB.

Good luck,
maslovsky

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB Storage ported to 5xxx ROM\'s ?
« Reply #11 on: February 09, 2004, 07:01:33 pm »
Thanks I\'ll take a look.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

maslovsky

  • Hero Member
  • *****
  • Posts: 1426
    • View Profile
    • http://my-zaurus.narod.ru
USB Storage ported to 5xxx ROM\'s ?
« Reply #12 on: February 10, 2004, 01:07:30 am »
Last note: you may also need to do \"echo storage ] /etc/hotplug/usbd.ftype\" to switch to storage mode in addition to creating a conf file. To switch back do \"echo net ] /etc/hotplug/usbd.ftype\"

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB Storage ported to 5xxx ROM\'s ?
« Reply #13 on: February 19, 2004, 05:33:11 pm »
Right I\'ve finally had just about enough time to have a go with this.

I\'m lacking kernel headers (and kernel) so I just used the storage_fd module which I extracted from the C860 fs.

I also decided that I wouldn\'t overwrite all of my existing hotplug scripts, but instead write my own to load and unload the modules in question:

So I have start_net.sh (to return to normal operation)

#!/bin/sh
/sbin/rmmod sa1100_bi
/sbin/rmmod storage_fd
/sbin/rmmod usbdcore
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/usbdcore.o
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/net_fd/net_fd.o
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/bi/sa1100_bi.o
mount /mnt/cf

and start_storage.sh (to try and get the storage fn working)

#!/bin/sh
umount /dev/hda1
/sbin/rmmod sa1100_bi
/sbin/rmmod net_fd
/sbin/rmmod usbdcore
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/usbdcore.o
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/storage_fd/storage_fd.o storage_device=$2
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/bi/sa1100_bi.o shortpacket=1 recvpacket=256

It didn\'t work, but there is hope....

I tried start_storage.sh and it produced the following error:

/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/bi/sa1100_bi.o: invalid parameter parm_shortpacket

Presumably this is bad ;-) I did a modinfo on sa1100_bi and the only parameter it accepts is dbg (string). I don\'t know what the missing parameters do exactly but they seems to be important. Maslovsky, did you build your own sa1100_bi module?

Anyway it looks like the storage_fd module probably loads okay as a /proc/usb-storage file is produced (and filled with data), but it seems to think that it\'s not connected.

You\'ll all be glad to hear that start_net.sh returns me to a fully working USB TCP/IP setup (so my script abilities are not *that* bad ;-))

Any suggestions?


Si

P.S. Mickey, you said you had this working on a 3.3.6pre1 ROM (with your C750) do you have any tips?
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB Storage ported to 5xxx ROM\'s ?
« Reply #14 on: February 20, 2004, 07:37:00 am »
Silly me, a couple of mistakes in the above. Firstly I was trying to pass /mnt/cf as an argument rather than /dev/hda1, secondly I wasn\'t even passing that in the start_storage.sh script as I\'d left in a $2 instead.

With those errors fixed I\'m up to maslovsky\'s last point, WinXP recognises that there\'s a mass storage device attached, but that\'s it. In fact in the device manager it tells me that it has encountered error #10 (\"This device cannot start\"). I will look on msdn to see if I can find out what this means.

In the meantime here\'s the output of /proc/usb-storage to whet your appetites:

Case 1 - attempting to use /mnt/cf rather than /dev/hda1:

Code: [Select]
Protocol status:STORAGE_IDLE

USB status:USB_DISCONNECT

Media status:MEDIA_EJECT

Media chage:MEDIA_CHANGE_OFF

Device name:/mnt/cf

Device file descriptor:0x00000000

Device size:0x0

Device block size:0x512

Device write protect:WR_PROTECT_ON

Bulk in max size:0

Bulk out max size:0

device write error:0

device read error:0

device flush error:0

write data bulk out timout:0

device write max time:0 msec

Schedule task max num:0x512

Schedule task use num:0x1

Schedule task max use num:0x1


It doesn\'t think there\'s a card there even though the card was unmounted successfully. Fair enough I know this is not how you\'re supposed to do it.


Case 2 - Using /dev/hda1

Code: [Select]
Protocol status:STORAGE_IDLE

USB status:USB_DISCONNECT

Media status:MEDIA_INSERT

Media chage:MEDIA_CHANGE_ON

Device name:/dev/hda1

Device file descriptor:0x00000000

Device size:0x0

Device block size:0x512

Device write protect:WR_PROTECT_OFF

Bulk in max size:0

Bulk out max size:0

device write error:0

device read error:0

device flush error:0

write data bulk out timout:0

device write max time:0 msec

Schedule task max num:0x512

Schedule task use num:0x0

Schedule task max use num:0x2



Case 3 - Using /dev/hda1 and also passing extra size parameters to storage_fd.o (out_pkt_sz = in_pkt_sz = 256)

Code: [Select]
Protocol status:STORAGE_IDLE

USB status:USB_DISCONNECT

Media status:MEDIA_INSERT

Media chage:MEDIA_CHANGE_ON

Device name:/dev/hda1

Device file descriptor:0x00000000

Device size:0x0

Device block size:0x512

Device write protect:WR_PROTECT_OFF

Bulk in max size:0

Bulk out max size:0

device write error:0

device read error:0

device flush error:0

write data bulk out timout:0

device write max time:0 msec

Schedule task max num:0x512

Schedule task use num:0x0

Schedule task max use num:0x6


It looks like the only difference is in the Schedule task numbers. I don\'t know what that means.

I note the following points:

USB status:USB_DISCONNECT - this can\'t be good
Device size:0x0 - ?? Probably not a good sign
Bulk in max size:0
Bulk out max size:0 - ?? also probably not too good.

I now note (after looking at the kernel code) that passing these parameters is not necessary, but I thought it might have something to do with the shortpacket=1 and recvpacket=256 which I can\'t pass to sa1100_bi (as it doesn\'t want to accept them). I also note, after looking at the source for pxa_bi that these two parameters are probably not all that important as they simply override existing defaults (in the pxa, I don\'t have the source for the sa1100).

Right, well I\'m a little stuck now, but still hopeful that this will work itself out. I had wanted to test another mass storage kernel module (instructions here: http://ahmedahamid.tripod.com/usbmass/usb_mass.html, source here: http://ahmedahamid.tripod.com/usbmass/usb_mass.c), unfortunately I need the kernel headers for this. Could some kind soul with a set of the latest kernel headers for OZ point me to where I can get them (I use Windows so I can\'t bitkeeper them) or even just compile it and post a link?

I wonder if someone with a C860 could post their /proc/usb-storage file so I can see what it should look like? I\'ll stick a separate post in the Cxxx section to get more attention.


Simon
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva