Usb Access & Linux Developement.


Knurz

Still Fresh
Joined
Nov 17, 2005
Messages
47
Age
52
Location
Austria
Website
Visit site
Hi!

I am trying to connect with the gp2x under Linux.

The gp2x is being recognized:
Dec 2 11:18:14 london kernel: usb-storage: device found at 13
Dec 2 11:18:14 london kernel: usb-storage: waiting for device to settle before scanning
Dec 2 11:18:19 london kernel: Vendor: Linux Model: File-Stor Gadget Rev: 0229
Dec 2 11:18:19 london kernel: Type: Direct-Access ANSI SCSI revision: 02
Dec 2 11:18:19 london kernel: SCSI device sda: 1983494 512-byte hdwr sectors (1016 MB)
Dec 2 11:18:19 london kernel: sda: assuming drive cache: write through
Dec 2 11:18:19 london kernel: SCSI device sda: 1983494 512-byte hdwr sectors (1016 MB)
Dec 2 11:18:19 london kernel: sda: assuming drive cache: write through
Dec 2 11:18:19 london kernel: sda: unknown partition table
Dec 2 11:18:19 london kernel: Attached scsi disk sda at scsi10, channel 0, id 0, lun 0
Dec 2 11:18:19 london kernel: usb-storage: device scan complete

But it does not recognize the partition Table provided by the gp2x.

fdisk reads as follows:
Device Boot Start End Blocks Id System
/dev/sda1 ? 398636 983425 570754815+ 72 Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(357, 116, 40) logical=(398635, 6, 23)
Partition 1 has different physical/logical endings:
phys=(357, 32, 45) logical=(983424, 30, 61)
Partition 1 does not end on cylinder boundary.
/dev/sda2 ? 86419 1078237 968014120 65 Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(288, 115, 43) logical=(86418, 26, 1)
Partition 2 has different physical/logical endings:
phys=(367, 114, 50) logical=(1078236, 17, 53)
Partition 2 does not end on cylinder boundary.
/dev/sda3 ? 957932 1949749 968014096 79 Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(366, 32, 33) logical=(957931, 2, 32)
Partition 3 has different physical/logical endings:
phys=(357, 32, 43) logical=(1949748, 25, 36)
Partition 3 does not end on cylinder boundary.
/dev/sda4 ? 1478321 1478349 27749+ d Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(372, 97, 50) logical=(1478320, 8, 25)
Partition 4 has different physical/logical endings:
phys=(0, 10, 0) logical=(1478348, 22, 13)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

USBSticks and Cardreaders are always recognized by my system. Whats different with the gp2x (the SD card was formatted with linux and FAT32).

And I have another question. I downloaded the gcc-3.4.4 with binutils and the embedded newlib fro m redhat. I compiled the gcc with --target=arm-elf. Is this the correct configuration for the gp2x CPU ? (there are some pages who say the --cpu=arm9 flag is required too)..

I don't have SDL compiled by now, so I haven't tried any example to check it out..

Thx ya :)
 
Try fdisk on the card, and see what it reports. I think that the GP2X does something very wrong as a mass storage device, and it's got me confused.

If I plug the GP2X into my computer, I get one device: /dev/sdc. I can mount that, and if I run fdisk on it and print the partition table I get:
Code:
val First # fdisk /dev/sdc

Command (m for help): p

Disk /dev/sdc: 255 MB, 255800320 bytes
8 heads, 61 sectors/track, 1023 cylinders
Units = cylinders of 488 * 512 = 249856 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help):
It's very interesting that the SD card has no partition table entries at all.

When I connect my 6-in-1 card reader and plug the same SD card into it, I get one base device
(/dev/sde in this case), and one partition: /dev/sde1. Running fdisk on /dev/sde I get:
Code:
val First # fdisk /dev/sde

Command (m for help): p

Disk /dev/sde: 255 MB, 255852544 bytes
16 heads, 32 sectors/track, 976 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1         976      249805+   6  FAT16

Command (m for help):
Note that the System is reported as FAT16, but the card is actually formatted as FAT32. That's fine because no-one should take any real notice of the System field in the partition table when it comes to FAT.

I have also written my own raw hardware SD code, which shows that there is indeed a single entry in the partition table.

The difference in sizes reported by the GP2X and the card reader are a bit of a worry, but I don't think they're a problem as they are related to the heads/sectors/cylinders numbers, and those are actually ignored by the SD card. In any case the DOS formatted size is 251848704 bytes, which is smaller than either reported size, so there won't be any issue.

You could try removing all the partition table entries and then reformatting, or adding a single partition and reformatting, or any number of other things. Please let us know what (if anything) works!
 
Back
Top