OESF Portables Forum

General Forums => General Discussion => Topic started by: nilch on February 04, 2004, 11:54:32 am

Title: USB Storage ported to 5xxx ROM\'s ?
Post by: nilch 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.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman 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 (https://www.oesf.org/forums/index.php?showtopic=495&highlight=mass+storage)

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


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky 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...
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman 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
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman 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
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: slocaus 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.)
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Anonymous 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
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman 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
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky 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 (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.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman 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
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Anonymous 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
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 09, 2004, 07:01:33 pm
Thanks I\'ll take a look.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky 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\"
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman 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?
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman 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 (http://ahmedahamid.tripod.com/usbmass/usb_mass.html), source here: http://ahmedahamid.tripod.com/usbmass/usb_mass.c) (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
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 20, 2004, 07:57:53 am
I\'ve had a look to see what code 10 means and the answer is both not alot and quite alot. Basically it can mean almost anything, a couple of which are that the driver is non-conformant to the Windows driver, or that the driver has a problem. No luck there then, I\'ll take a look in the system logs and see whether there\'s anymore info there (but I doubt it).

I presume that Linux will provide more info? I\'ll have a go mounting it this evening and report back.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 20, 2004, 08:56:05 am
Foxdie has kindly presented me with what /proc/usb-storage should look like (on hos C860). Here\'s a copy:

Code: [Select]
Protocol status:STORAGE_IDLE

USB status:USB_CONNECT

Media status:MEDIA_INSERT

Media chage:MEDIA_CHANGE_OFF

Device name:/dev/hda1

Device file descriptor:0xc3183940

Device size:0x64471040

Device block size:0x512

Device write protect:WR_PROTECT_OFF

Bulk in max size:4096

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


It looks like the differences are:

USB status:USB_CONNECT - this is connected now
Media chage:MEDIA_CHANGE_OFF - this says off rather than on - ??
Device file descriptor:0xc3183940
Device size:0x64471040 - these display something now
Bulk in max size:4096 - again this is !=0


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Stubear on February 20, 2004, 09:16:05 am
Quote
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

It\'s still true, the kernel isn\'t actually transfering the data - the usb storage module is - basically it turns your Z into a card reader - you can only choose CF or SD, not the main memory.

It doesn\'t translate ext2 into windoze readable format - although you could possibly use explore2fs or similair program to read the ext2 card.

Stu
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 20, 2004, 09:26:57 am
Ah, fair enough, I was just wondering. In any case I have been testing with a FAT16 CF card so that can\'t be the problem.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Stubear on February 20, 2004, 09:31:02 am
When my Z was working, I would get a \"USB error\" if I tried to change from net to storage using qtsamba (C860 NAND on C760) if the Z was already connected to my desktop, had to unplog the cable to get it to change then plug it in again to be mounted as usb-storage.

Not sure if the same thing applies to the 5xxx Zs but it might be worth a try.

Stu
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky on February 20, 2004, 09:42:21 am
Simon,

I\'m afraid that the problem is in the sa1100_bi  driver  - that\'s the only difference USB modules between C7x0 and 5500 devices. I think pxa_bi driver has been updated to support storage functions, while sa1100_bi is still the same as for stock 5500 ROM.

I\'m not sure usb storage will work untill sa1100_bi  driver is patched...
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 20, 2004, 09:53:56 am
Yep, I tend to a agree with you. Once I get a Linux box up on the net I\'ll download the kernel and have a look see. I would have thought that there\'d be some errors somewhere though? I had a look for a klogd binary but no luck, however from reading the man page it looks as though /proc/kmsg is where the messages are placed. That said I don\'t know whether this will work or not. I\'ll have a look at it.

In any case, it\'s been an interesting diversion.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 20, 2004, 09:58:26 am
That\'s funny, I just went to look at the web site for the iPAQ storage module which I downloaded this morning (the iPAQ he was using is also an SA machine so I thought I\'d do a diff on the sa1100_bi or equivalent sources that the iPAQ and Z use) and it looks like the guy has taken all of the usb-storage info down. I have a copy though if anyone\'s interested.

Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 22, 2004, 11:06:06 am
Has anyone with a 5600 tried what we\'ve been doing?

I\'d be interested to know whether it works and am hopeful it won\'t because then I can compare the differences between your kernel and the c860 one (they should be closer than the sl5500 and c860 kernels) and try to work out what needs to be added to the sl5500 (and sl5600) to make it work.

If anyone\'s willing, it should take about 10min (once you\'ve got the files on your Z), post here if you need any more instructions, etc.

Thanks,


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 26, 2004, 05:23:34 am
I compiled storage_fd (not as part of the kernel, but by hand - a bit of a pain) and now I get a new G: drive in \"My Computer\", unfortunately when I click on it Windows tells me to \"insert a disk into drive G:\".

Progress of a sort (for me at least), I\'ve just downloaded the USB spec to see if I can work out any more.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Mitch on February 26, 2004, 07:08:13 am
Can I ask the question of why?
Why not just use samba, then map the folders as network drives?
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 26, 2004, 07:12:29 am
Because to use samba you either need drivers (for Windows) or to perform some setup (Linux) on the host machine. With usb-storage you just plug and go.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Mitch on February 26, 2004, 07:52:52 am
I was able to do it on Win98 and XP Pro with only the supplied drivers for my Zaurus.
After setting the communication to TCP/IP advanced I was able to map the network drives.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky on February 26, 2004, 08:47:26 am
Quote
I compiled storage_fd (not as part of the kernel, but by hand - a bit of a pain) and now I get a new G: drive in \"My Computer\", unfortunately when I click on it Windows tells me to \"insert a disk into drive G:\".

Progress of a sort (for me at least), I\'ve just downloaded the USB spec to see if I can work out any more.


Si

That\'s where I stopped
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 26, 2004, 09:25:04 am
Yes I realise that, I was trying to use the c860 binary and I didn\'t even get that far. After compiling the code I\'ve at least got a disk drive showing, and looking at the source I\'ve not actually changed anything in particular (ie the defines all seem to give the same numbers) so I was hopeful that I might be able to get further once I work out what I did actually change.

How did you get the module to compile? Did you compile the C860 kernel source after making alterations to the defconfig (or whatever menuconfig produces) file? I was trying to import the module into the OE (Openzaurus build system) kernel but it refuses to be compiled. In the end I had to look at the compile log when I built the OZ kernel and copy the arm-linux-gcc calls for building net_fd.o and adapt paths, etc.

It\'s a bit difficult to compare the differences between the c860 source and the 5500 source as all of the extra pxa stuff is in there. I\'ve got a quick test script which I\'ll ask someone with a 5600 to run. I hope that it won\'t work, then I can compare the 5600 kernel with the c860 kernel (which should be closer) and see whether I can work out the differences. I\'ll post that in a separate thread though with a more descriptive title.


Si

P.S. @mitch:
Quote
with only the supplied drivers for my Zaurus
- exactly, with usb mass storage you don\'t need any drivers, you just plug in and WinXP/2K and Linux will automagically recognise the device and allow you to read/write to it. This means that you don\'t have to carry around a CD with the drivers on it, etc.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Mitch on February 26, 2004, 10:29:36 am
But you still need the drivers for syncing.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 26, 2004, 10:35:49 am
Yes and no (if you can perform the sync using the data file from the Z on the PC a la Ko/Pi then no).

But I don\'t want to be able to sync, just to easily transfer information when I go to visit someone else\'s office. I don\'t want to have to install drivers on their computer (if they\'d even let me, or if they even had sufficient privileges to do so), just to plug it in and copy back and forth.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 27, 2004, 07:35:21 am
I\'ve compared the 5600 and C860 kernel source and there are almost no differences (the only ones are related to being able to set a packet size as a parameter), so I guess that once ced and greg2 grab my corrected scripts they will be able to use mass storage on their 5600s.

Not ideal for my quest to get it working on the 5500 (I was hoping that it wouldn\'t work on the 5600 and that the differences between the two sets of source would be larger and would show me what to add to the 5500 kernel), but it\'ll make 5600 users happy.


Si

P.S. I\'m getting a bit ahead of myself here, no-one has actually got it working yet (my initial scripts had a typo), but I\'m 90% sure it will work.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: ced on February 27, 2004, 10:41:17 am
so how come the pxa_bi.o from the C860 source doesn\'t work on the SL5600?
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 27, 2004, 11:06:11 am
I don\'t know, but there really are very few differences. There\'s a line in the makefile.in and config.in files (I think those are the right names) which specify that storage_fd should be built, and in the pxa.c file there are only the differences which are due to the addition of the module parameters.

Perhaps I\'ll have to dig deeper and see whether anything else is linked in (I\'m pretty sure there\'s nothing else) or try to take a look at the various #defines which may affect it.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky on February 27, 2004, 12:33:18 pm
I also think that USB storage will work on 5600 - they are using the same USB support module.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 27, 2004, 01:56:43 pm
It worked! On my 5500.

God only knows why it wouldn\'t work yesterday (I\'ve not changed anything).

Anyway, my storage_fd.o module + scripts has allowed my 256Mb CF card to be recognised and mounted on my Linux box.

Time to try WinXP.....

 
Si

P.S. The issue may have been that I hadn\'t started the storage_fd.o module before I put my Z in the cradle (or that I booted my desktop Linux box with it already in the cradle, etc.)
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 27, 2004, 02:11:05 pm
Yep, WinXP works too.

Read and write both work fine. Under Linux the device is /dev/sda (no numbers).

I suppose I should make a package for people to install. Maslovsky & ced, you\'ve both used the C860 hotplug scripts, do you think these are the best way to go (rather than my quick hack method of using 2 separate scripts to start and stop the storage funtion)?


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 27, 2004, 03:49:40 pm
Looks like the above file is also the one to use for the 5600.

Here are the commands I used to compile it (after sourcing my standard GCC2.95.3 cross toolchain script):

cd whichever/dir/has/the/source/in/it

arm-linux-gcc -D__KERNEL__ -I/home/simon/dev/OE/oe-packages-exported/tmp/base/linux-2.4.18-rmk7-pxa3-embedix-r0/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -mapcs -fno-strict-aliasing -fno-common -fno-common -pipe -mapcs-32 -march=armv4 -mtune=strongarm1100 -mshort-load-bytes -msoft-float -DMODULE  -DKBUILD_BASENAME=storage   -c -o storage_fd.o storage-fd.c

arm-linux-gcc -D__KERNEL__ -I/home/simon/dev/OE/oe-packages-exported/tmp/base/linux-2.4.18-rmk7-pxa3-embedix-r0/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -mapcs -fno-strict-aliasing -fno-common -fno-common -pipe -mapcs-32 -march=armv4 -mtune=strongarm1100 -mshort-load-bytes -msoft-float -DMODULE  -DKBUILD_BASENAME=storage   -c -o schedule_task.o schedule_task.c

arm-linux-gcc -D__KERNEL__ -I/home/simon/dev/OE/oe-packages-exported/tmp/base/linux-2.4.18-rmk7-pxa3-embedix-r0/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -mapcs -fno-strict-aliasing -fno-common -fno-common -pipe -mapcs-32 -march=armv4 -mtune=strongarm1100 -mshort-load-bytes -msoft-float -DMODULE  -DKBUILD_BASENAME=storage   -c -o storageproto.o storageproto.c

arm-linux-ld -r -a storage_fd_drv.o storage_fd.o storageproto.o schedule_task.o

mv storage_fd_drv.o storage_fd.o



Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: rrusaw on February 27, 2004, 09:02:45 pm
Code: [Select]
+++ sa1100.c    2004-02-27 19:19:34.628738128 -0500

@@ -440,6 +440,7 @@

                                         udc_interrupts, *(UDCSR), *(UDCCS0), *(UDCAR));



                        usbd_device_event (udc_device, DEVICE_RESET, 0);

+                       usbd_device_event (udc_device, DEVICE_ADDRESS_ASSIGNED,0);

                }



                if (status & UDCSR_SUSIR) {


To compile i used the 860 kernel source with the drivers/usb/device/bi directory from the 5500 kernel source. I then patched the sa1100.c driver as above (1 line)  copied the sl5500 config (arch/arm/def-configs/collie) to .config. I then manually copied the CONFIG_USBD_STORAGE section from the boxer config into the .config.

After that it was a simple matter of building the kernel and modules and copying the files over to the Z and using modified versions of lardman\'s scripts to load the appropiate modules.

Cheers and good luck

Ryan
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Anonymous on February 27, 2004, 09:48:00 pm
Nice work Si!

Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Anonymous on February 28, 2004, 04:32:23 pm
Hah, very strange, but after reading your post I\'ve tried it again at my home PC. IT WORKED! Something could be wrong with my PC at work, but WinXP was able to recognize CF card in SL5500 just fine.

I\'m using hotplug scripts from c860 root fs. I think I can write a simple application that will alow to switch between USB storage and network modes.
I will build an IPK when I get back to work on Monday.

Regards,
maslovsky
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Anonymous on February 29, 2004, 09:20:46 am
Bad news - that only worked once. Next time I connect zaurus windows does not see  a CF card being inserted. Just like before.
I cannot figure out if this is a zaurus or windows problem.

maslovsky
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 29, 2004, 11:09:31 am
It seems to be working every time for me now.

With my Z out of the cradle I run my script to insmod storage_fd, then just pop it in the cradle and it works. I may have switched off between insmoding and sticking it in the cradle actually, but ever since I can take it out and put it back in without any troubles. I also tend to not boot with the Z in the cradle, this might make a difference, I\'m not sure.

Something else to check is that the card can be cleanly umounted.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on February 29, 2004, 02:11:26 pm
Right, I\'ve managed to replicate your troubles. To get around it I have to do the following:

take Z out of cradle (might not be necessary)
run script to insmod storage_fd
suspend/switch off
turn back on and place in the cradle.

Strange.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky on March 01, 2004, 02:46:29 am
Scripts from 860 root fs always load storage_fd before zaurus is in cradle. I want to take a look at your scripts, but cannot download them form this topic.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on March 01, 2004, 04:38:58 am
My scripts:

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 get usb-storage 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=/dev/hda1
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/bi/sa1100_bi.o


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on March 01, 2004, 04:40:01 am
In the script above:

/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/storage_fd/storage_fd.o
and
storage_device=/dev/hda1

Should all be on the same line.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky on March 01, 2004, 02:05:32 pm
OK, now I can see what the problem was. That one line patch from rrusaw did the trick - it now works!
I\'m using scripts from 860 root fs and it works just fine.  A bit more testing and I\'ll create a complete package.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky on March 02, 2004, 08:39:34 am
I\'ve built the package including a simle GUI application to switch between the two modes. The package is avalable at http://my-zaurus.narod.ru/usbstorage.html (http://my-zaurus.narod.ru/usbstorage.html)
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: ced on March 02, 2004, 08:55:38 am
can you do one for the SL5600?
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: maslovsky on March 02, 2004, 10:21:24 am
Quote
can you do one for the SL5600?

I hope lardman will.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on March 02, 2004, 10:46:58 am
Yep, give me a bit of time..... :-)
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Anonymous on March 11, 2004, 07:46:21 pm
Quote
I\'ve built the package including a simle GUI application to switch between the two modes. The package is avalable athttp://my-zaurus.narod.ru/usbstorage.html

I downloaded this app and set my Z up for mass storage which worked great . I removed it from the cradle and changed to standard network but the Z stopped responding when I confirmed my choice. After a few minutes I gave up and rebooted it.
I guess I messed up as now it is not recognised as a network interface by windows; I can\'t change USB configuration (it crashes) and my CF cards are no longer automatically mounted
Should I use the scripts above to return to \"normal\" operation or is there something else I need to do?

cheers,
Sean
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Anonymous on March 11, 2004, 07:50:11 pm
OK, I wholeheartedly apologise for that post above. I restarted the Z twice after it crashed and everything appears to be working as normal.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on March 12, 2004, 05:01:43 am
Assuming my ipks even work (they never used to ;-)), and also assuming that the directory structure on the 5600/7x0 is the same as that on the 5500 with a 3.xx rom then this one should work:

PXA processor, Sharp ROM: http://students.bath.ac.uk/enpsgp/Zaurus/u...ROM_PXA_arm.ipk (http://students.bath.ac.uk/enpsgp/Zaurus/usb-storage_1.0.0_SharpROM_PXA_arm.ipk)

For PXA OZ machines try this: http://students.bath.ac.uk/enpsgp/Zaurus/u..._OZ_PXA_arm.ipk (http://students.bath.ac.uk/enpsgp/Zaurus/usb-storage_1.0.0_OZ_PXA_arm.ipk)
For SA (5000D/5500) OZ machines try this: http://students.bath.ac.uk/enpsgp/Zaurus/u...0_OZ_SA_arm.ipk (http://students.bath.ac.uk/enpsgp/Zaurus/usb-storage_1.0.0_OZ_SA_arm.ipk)

The two OZ ipks haven\'t been tested, at all (sorry I\'ve been busy). But they should backup the scripts which they alter and then restore them when you uninstall the ipk. I was planning to add this into the hotplug scripts myself but I\'m a bit to busy to do that for a while, currently they use the same script changes as Maslovsky originally had in his ipk (and I don\'t know whether this works on OZ).


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Anonymous on March 13, 2004, 07:29:25 am
Hi,

I\'ve been messing with the app as well.

My experience:
OK under windows with my (FAT formatted) CF
Not working under Windows with my (ext formatted) SD

I guess this is due to the filesystem?!

Not working at all under Linux (MandrakeLinux 10) :-(
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on March 13, 2004, 07:56:45 am
The OS has to be able to mount and read the storage card directly - Windows can\'t mount ext2 filesystems.

I\'m not running Mandrake 10 (yet) so I can\'t really help you there, but if you post some more info/symptoms I\'ll try.


Simon
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Anonymous on March 15, 2004, 03:34:42 am
Hi,

Thx for your reply.

So with this:
Quote
The OS has to be able to mount and read the storage card directly - Windows can\'t mount ext2 filesystems.
you mean indeed that ext file formats will NOT work with USB storage mode and windows.

I haven\'t tried very much with mdk10. I just know that my USB memory stick works out of the box, whereas the Z didn\'t. There is a service under mdk10 I hadn\'t seen before, called hotplug. But I can\'t enable it, because it crashes my system.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on March 15, 2004, 04:54:09 am
Yes that\'s correct. Windows will not work with ext2 formatted cards via usb-storage (or any other direct method such as a card reader for that matter).

If your memory stick works then so should the Z, but I don\'t have a memory stick so I can\'t compare myself.


Si
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: Hrw on January 04, 2005, 02:40:46 am
maslovsky: can you provide usb-storage for 5500 as patch to kernel? We add it into next OZ releases then.

all: can you "modprobe usbdmonitor" and check does usbnet working after resume/suspend? It should be all what is needed - hotplug will take care of (un)loading modules.
Title: USB Storage ported to 5xxx ROM\'s ?
Post by: lardman on January 04, 2005, 05:50:24 am
Part of it's here - the patch to sa1100.c (post and patch from rrusaw): https://www.oesf.org/forums/inde...opic=1485&st=30 (https://www.oesf.org/forums/index.php?showtopic=1485&st=30)

Though the usb storage source files will also be required from the cxxx source. I don't know off the top of my head whether the 5500 kernel is actually built from the cxxx source (which would make life easier), otherwise there'll have to be some file copying to get the source in the right place I suppose.


Si