From owner-freebsd-fs@FreeBSD.ORG Mon Jul 11 06:23:08 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DC93106566B for ; Mon, 11 Jul 2011 06:23:08 +0000 (UTC) (envelope-from samueldotj@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id BBA1A8FC1C for ; Mon, 11 Jul 2011 06:23:07 +0000 (UTC) Received: by ewy1 with SMTP id 1so1556022ewy.13 for ; Sun, 10 Jul 2011 23:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=qbLO+KAZDrggfgFREj6B0oVaaS2308a04iL4fy0opA4=; b=jLEzJAgVpdp+cmV6uqDhD9CY8onV3sFtD4SSCNiO7h5TkbzluRVtD6G6y4IYG4YK05 ztVlJ9GsVwPqaEhNeJnkdx7fShf72xaYQ8mMDkRbpXODk26SNU4crfd4frKq1NCiwN8o kJr67gy7vYzRruvhZEEwnuo0+9/fN+NtssREw= MIME-Version: 1.0 Received: by 10.14.0.69 with SMTP id 45mr1330747eea.123.1310365386508; Sun, 10 Jul 2011 23:23:06 -0700 (PDT) Received: by 10.14.119.16 with HTTP; Sun, 10 Jul 2011 23:23:06 -0700 (PDT) In-Reply-To: <4E1A8A8B.4020005@yandex.ru> References: <4E1A8A8B.4020005@yandex.ru> Date: Mon, 11 Jul 2011 11:53:06 +0530 Message-ID: From: Sam To: "Andrey V. Elsukov" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@freebsd.org Subject: Re: FS Endianess X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2011 06:23:08 -0000 Thanks for the quick response. Samuel 2011/7/11 Andrey V. Elsukov : > 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 =A0 getushort(x) =A0 =A0le16dec(x) > bpb.h:#define =A0 getulong(x) =A0 =A0 le32dec(x) > bpb.h:#define =A0 putushort(p, v) le16enc(p, v) > bpb.h:#define =A0 putulong(p, v) =A0le32enc(p, v) > > -- > WBR, Andrey V. Elsukov > >