FS Endianess

Andrey V. Elsukov bu7cher at yandex.ru
Mon Jul 11 05:31:16 UTC 2011


On 11.07.2011 8:48, Sam wrote:
> Hi,
> 
> I am under the assumption that a Filesystem created on big endian
> machine cant be read on little endian machine and vice versa. However
> I am able to mount FAT formatted(on Windows PC) USB flash drive on
> FreeBSD(PowerPC - BigEndian) and able to view contents of a text file.
> I am not able to locate FS code where it does the byte conversion. Can
> somebody kindly point me the code? Or my assumption is wrong?

[freebsd msdosfs]> pwd
/usr/home/devel/freebsd/base/head/sys/fs/msdosfs
[freebsd msdosfs]> grep -E '[0-9]+(dec|enc)' *
bpb.h:#define   getushort(x)    le16dec(x)
bpb.h:#define   getulong(x)     le32dec(x)
bpb.h:#define   putushort(p, v) le16enc(p, v)
bpb.h:#define   putulong(p, v)  le32enc(p, v)

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20110711/e92781b0/signature.pgp


More information about the freebsd-fs mailing list