Weird Fwrite Problems


dominicbeesley

Still Fresh
Joined
Aug 30, 2006
Messages
23
Hi,

I've just got my gp2x and been playing around cross-compiling stuff. I've managed to get most of Xfree86 working and bits of fvwm2 and a virtual keyboard (to appear not to actually type!)

I'm finding it a real paing transferring files to the gp2x though. My current "preferred" method is to use samba but this is quite slow when there are lots of small files.

I've tried tar-ing the stuff up, transferring to the gp2x and untarring however:

the busy box version of tar does not seem to like many of the gnu tar files (I quite often get bad tar header errors) - is this a common problem?

I've cross-compiled tar (using gp2xsdk) and it "sort of" runs but quite often segfaults! (I can list files in a tar, but lots of segfaults when writing) - anybody else have this problem?

Also a couple of other test programs I've writing also occasionally fail on fwrites - for no apparent reason?!?! Is this a gp2x/linux/kernel issue or a gcc-3.4.6 issue?

Cheers

dom
 
All methods of file transfer are quite slow when there are lots of files, it's the SD card rather than Samba.

I have run busy box tar with no problems but again the SD card limits the rate at which files are written.

I wonder if there's a problem with your SD card, may be reformatting (fat32) would help
 
It seems odd that fwrite would fail. What SDK are you using - official / open2x / devkitGP2X? Something I did wonder was whether using kernel 2.6 headers could cause issues, since the actual device only has kernel 2.4.

Still, I've built rsync for the GP2X, and it seems to work fine - I never saw any file writing issues. As Parkydr said, the SD card access is abysmally slow - writing to /tmp is really quite speedy, and shows the USB link is actually working at a reasonable speed. I don't know whether rsync does anything to speed up writing multiple small files, but it seems pretty good overall.
 
Parkydr posted on Sep 11 2006 at 02:24 PM said:
All methods of file transfer are quite slow when there are lots of files, it's the SD card rather than Samba.

I have run busy box tar with no problems but again the SD card limits the rate at which files are written.

I know they're alls abaout as slow as each other (in terms of bytes/sec), however Samba seems to have quite a bad overhead for actually creating the file (I tend to die of boredom whilst transferring all the X11 headers!)


Parkydr posted on Sep 11 2006 at 02:24 PM said:
I wonder if there's a problem with your SD card, may be reformatting (fat32) would help

I thought that but it all fsck'd fine on my linux box.

Dom

gfoot posted on Sep 11 2006 at 02:31 PM said:
It seems odd that fwrite would fail. What SDK are you using - official / open2x / devkitGP2X? Something I did wonder was whether using kernel 2.6 headers could cause issues, since the actual device only has kernel 2.4.

A newly built "official" gamepark sdk running on Linux. Got the official GPH linux headers and everything.

Still, I've built rsync for the GP2X, and it seems to work fine - I never saw any file writing issues. As Parkydr said, the SD card access is abysmally slow - writing to /tmp is really quite speedy, and shows the USB link is actually working at a reasonable speed. I don't know whether rsync does anything to speed up writing multiple small files, but it seems pretty good overall.

I downloaded the latest gnu tar stable version (can't remember exactly which now - not at the same machine).

All compiled ok but like I say it segfaults whenever it tries to write to a local file (sd or nand), also spotted after making this post it segfaults when run with no parameters.

I'll investigate further this evening - was just hoping this was a "know" problem....

I'm also less suspicious of the busybox tar now after it _worked_ on a tar file transferred by samba (but not the same one transferred by ftp - i checked it _WAS_ transferred in binary mode) - so now my suspicions are also turned to the gp2x ftp server.

Cheers

Dom
 
Last edited by a moderator:
Back
Top