Re: [uCsimm] Is the FAT filesystem working?

From: Erwin Authried (eauth@softsys.co.at)
Date: Fri Sep 15 2000 - 11:50:33 EDT


Frank,

It seems that you have discovered some endianness problems.
Obviously the FAT filesystem has never been used on big endian architectures
with the 2.0 kernel.

Look at include/linux/msdos_fs.h, it presumes little-endian order:

/*
 * Conversion from and to little-endian byte order. (no-op on i386/i486)
 *
 * Naming: Ca_b_c, where a: F = from, T = to, b: LE = little-endian,
 * BE = big-endian, c: W = word (16 bits), L = longword (32 bits)
 */

#define CF_LE_W(v) (v)
#define CF_LE_L(v) (v)
#define CT_LE_W(v) (v)
#define CT_LE_L(v) (v)

It It should be something like:

#define CF_LE_W(v) le16_to_cpu(v)
#define CF_LE_L(v) le32_to_cpu(v)
#define CT_LE_W(v) cpu_to_le16(v)
#define CT_LE_L(v) cpu_to_le32(v)

I have no idea if there are additional bugs. Hope that helps.

Regards,

Erwin

Frank Haverkamp[SMTP:haver@ibr.cs.tu-bs.de] wrote:
> Hi,
>
> I do some experiments with SmartMedia which uses a FAT (vFAT)
> filesystem. I can read the card, write it, formatting is
> not finished yet. I wanted to see if I could write a readonly
> filesystem for my SmartMedia card. Therefore I enabled the
> FAT-support in my uClinux distribution for the Coldfire uC.
> When I passed the partition boot record of my SmartMedia card
> I got the following:
>
> [MS-DOS FS Rel. 12,FAT 0,check=n,conv=b,uid=0,gid=0,umask=022,bmap]
> [me=0xf8,cs=0,#f=2,fs=0,fl=0,ds=0,de=1,data=0,se=26430,ts=0,ls=2,rc=0,fc=429496]
> Transaction block size = 512
> VFS: Can't find a valid MSDOS filesystem on dev 78:00. (0x78 is my major
> number)
>
> which was strange to me, cause my notebook pcmcia stuff
> accepted the card getting the same pbr, and it detected
> the correct parameters. The field "ls" is the logical sector
> size which should be 0x0200 and not 2 indicating 512 bytes
> for one logical sector.
>
> Does anyone had similar experience or have anybody used
> the FAT/vFAT support with uClinux?
>
> Thanks,
>
> Frank
>
> --
> Frank Haverkamp Domologic Homeautomation
> mailto: haver@ibr.cs.tu-bs.de Rebenring 33
> WWW: http://www.colibree.de 38106 Braunschweig
> This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/
>
>

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:38 EST