Skip to contentSkip to conversation

cramfs byte order

U-Boot-Users Gleb Natapov 2 participants 2 messages Apr 21, 2004 – Apr 25, 2004

lore
Share & tools
lore
#0 lore raw

Hello all,

It seems there is a problem with cramfs support in u-boot. u-boot implementation of cramfs
do swap bytes on big endian machines (ppc) and linux never swap bytes and expects the file system to be in the machine byte order.

This is from linuxsrc/Documentation/filesystems/cramfs.txt:
Currently, cramfs must be written and read with architectures of the same endianness.

The result is the file system can be read or from linux or from u-boot but not from both of them.

The other problem is when I am trying to load a file from cramfs (fsload filename) I am getting the following error:
### CRAMFS LOAD ERROR<ffffffff> for vmlinuz!
What can it be?

Thank you.

--
Gleb.

#1 lore raw

Hallo Robert & Kai-Uwe,

Quoted 11 lines · in message <[email protected]> Gleb Natapov wrote:

It seems there is a problem with cramfs support in u-boot. u-boot implementation of cramfs
do swap bytes on big endian machines (ppc) and linux never swap bytes and expects the file system to be in the machine byte order.

This is from linuxsrc/Documentation/filesystems/cramfs.txt:
Currently, cramfs must be written and read with architectures of the same endianness.

The result is the file system can be read or from linux or from u-boot but not from both of them.

Gleb is right. The comments in your code about cramfs being little- endian and teh code itself is wrong. Can you please submit a patch to clean up this problem, i. e. remove all the byte-swapping code and the custom macros you added to the Linux code?

Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
If a train station is a place where a train stops,
                                           then what's a workstation?