Re: Endianness

2010-01-12 Thread RW
On Tue, 12 Jan 2010 12:51:00 -0800
Rob Farmer  wrote:

> I'm trying to create a port of an application which only works on
> little endian systems and I'm trying to figure out how to set
> ONLY_FOR_ARCHS.  Wikipedia says PowerPC, Sparc, and IA64 are bi-endian
> and the OS chooses the mode. I'm not familiar with these platforms -
> I'm sure it has been answered somewhere, but I can't find it - which
> FreeBSD archs are little/big endian? Thanks.

Perhaps your makefile could check endianess on the build machine and set
IGNORE if it's bigendian, e.g. if the output of "file /bin/ls" doesn't
contain LSB.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Endianness

2010-01-12 Thread Lowell Gilbert
Rob Farmer  writes:

> On Tue, Jan 12, 2010 at 1:47 PM, Lowell Gilbert
>  wrote:

>> As the original poster observed, PowerPC, Sparc and IA64 are all capable
>> of being used in either endian setting.
>>
>> I checked endian.h, and it looks as though FreeBSD uses Sparc as
>> big-endian, IA64 as little-endian, and PowerPC as whatever it picks up
>> from gcc (probably big-endian, since the architecture does funny things
>> with alignment in little-endian mode.
>>
>> My best advice, though, is to suggest that Mr. Farmer shouldn't assume
>> that the application will work anywhere without actually trying it.
>
> Well, the upstream author states in the documentation that there are
> endian problems and to use it only on little endian machines. I don't
> have any hardware that is non-i386/amd64 and about a year ago when I
> tried to cross build to powerpc in tinderbox it didn't work, so I
> can't really do that.

I didn't mean to imply that you need to check, just that it's likely to
not work (regardless of endianness) and you should be aware of that.
powerpc and sparc aren't "tier-1" architectures anyway, so ordinary
users are unlikely to run into them, and there are probably lots of
ports that won't run on them.  The tinderbox doesn't even build for
powerpc.

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
http://be-well.ilk.org/~lowell/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Endianness

2010-01-12 Thread Rob Farmer
On Tue, Jan 12, 2010 at 1:47 PM, Lowell Gilbert
 wrote:
> Kaya Saman  writes:
>
>> David Kelly wrote:
>>> On Tue, Jan 12, 2010 at 12:51:00PM -0800, Rob Farmer wrote:
>>>
 I'm trying to create a port of an application which only works on
 little endian systems and I'm trying to figure out how to set
 ONLY_FOR_ARCHS.  Wikipedia says PowerPC, Sparc, and IA64 are bi-endian
 and the OS chooses the mode. I'm not familiar with these platforms -
 I'm sure it has been answered somewhere, but I can't find it - which
 FreeBSD archs are little/big endian? Thanks.

>>>
>>> i386 is little endian. Would expect ia64 to be the same.
>>>
>>>
>>
>> SPARC is big endian. Or at least it used to be.
>>
>> Power4,5,6 are all big endian too if I'm not mistaken.
>>
>> Correct me if I'm wrong but anything based around the CISC
>> architecture is big endian.
>
> As the original poster observed, PowerPC, Sparc and IA64 are all capable
> of being used in either endian setting.
>
> I checked endian.h, and it looks as though FreeBSD uses Sparc as
> big-endian, IA64 as little-endian, and PowerPC as whatever it picks up
> from gcc (probably big-endian, since the architecture does funny things
> with alignment in little-endian mode.
>
> My best advice, though, is to suggest that Mr. Farmer shouldn't assume
> that the application will work anywhere without actually trying it.

Well, the upstream author states in the documentation that there are
endian problems and to use it only on little endian machines. I don't
have any hardware that is non-i386/amd64 and about a year ago when I
tried to cross build to powerpc in tinderbox it didn't work, so I
can't really do that.

-- 
Rob Farmer

>
> --
> Lowell Gilbert, embedded/networking software engineer, Boston area
>                http://be-well.ilk.org/~lowell/
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Endianness

2010-01-12 Thread Rob Farmer
On Tue, Jan 12, 2010 at 1:51 PM, David Kelly  wrote:
> On Tue, Jan 12, 2010 at 11:29:21PM +0200, Kaya Saman wrote:
>> David Kelly wrote:
>> >On Tue, Jan 12, 2010 at 12:51:00PM -0800, Rob Farmer wrote:
>
> [...]
>
>> >>I'm sure it has been answered somewhere, but I can't find it - which
>> >>FreeBSD archs are little/big endian? Thanks.
>>
>> >i386 is little endian. Would expect ia64 to be the same.
>>
>> SPARC is big endian. Or at least it used to be.
>>
>> Power4,5,6 are all big endian too if I'm not mistaken.
>>
>> Correct me if I'm wrong but anything based around the CISC
>> architecture is big endian.
>
> Believe the O.P. is asking, "What endian is FreeBSD on these
> architectures?"
>
> If I was making an application that needed endian information then I'd
> look in arpa/inet.h and machine/endian.h to discover what I was running
> on.

Ah - thanks for the pointer - I was looking at /src/sys/sys/endian.h
rather than the machine specific versions, which is why I didn't get
anything out of it. For the archives, it appears that amd64, arm,
i386, ia64, and pc98 are little endian.

-- 
Rob Farmer
>
> --
> David Kelly N4HHE, dke...@hiwaay.net
> 
> Whom computers would destroy, they must first drive mad.
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Endianness

2010-01-12 Thread David Kelly
On Tue, Jan 12, 2010 at 11:29:21PM +0200, Kaya Saman wrote:
> David Kelly wrote:
> >On Tue, Jan 12, 2010 at 12:51:00PM -0800, Rob Farmer wrote:

[...]

> >>I'm sure it has been answered somewhere, but I can't find it - which
> >>FreeBSD archs are little/big endian? Thanks.
>
> >i386 is little endian. Would expect ia64 to be the same.
> 
> SPARC is big endian. Or at least it used to be.
> 
> Power4,5,6 are all big endian too if I'm not mistaken.
> 
> Correct me if I'm wrong but anything based around the CISC
> architecture is big endian.

Believe the O.P. is asking, "What endian is FreeBSD on these
architectures?"

If I was making an application that needed endian information then I'd
look in arpa/inet.h and machine/endian.h to discover what I was running
on.

-- 
David Kelly N4HHE, dke...@hiwaay.net

Whom computers would destroy, they must first drive mad.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Endianness

2010-01-12 Thread Rolf G Nielsen

On 2010-01-12 22:04, David Kelly wrote:

On Tue, Jan 12, 2010 at 12:51:00PM -0800, Rob Farmer wrote:

I'm trying to create a port of an application which only works on
little endian systems and I'm trying to figure out how to set
ONLY_FOR_ARCHS.  Wikipedia says PowerPC, Sparc, and IA64 are bi-endian
and the OS chooses the mode. I'm not familiar with these platforms -
I'm sure it has been answered somewhere, but I can't find it - which
FreeBSD archs are little/big endian? Thanks.


i386 is little endian. Would expect ia64 to be the same.



ia64 (Itanium) hardware has selectable endianess. I've never worked with 
Itanium in any OS, so I can't say whether FreeBSD supports selecting or 
is fixed at either little- or bigendian.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Endianness

2010-01-12 Thread Lowell Gilbert
Kaya Saman  writes:

> David Kelly wrote:
>> On Tue, Jan 12, 2010 at 12:51:00PM -0800, Rob Farmer wrote:
>>   
>>> I'm trying to create a port of an application which only works on
>>> little endian systems and I'm trying to figure out how to set
>>> ONLY_FOR_ARCHS.  Wikipedia says PowerPC, Sparc, and IA64 are bi-endian
>>> and the OS chooses the mode. I'm not familiar with these platforms -
>>> I'm sure it has been answered somewhere, but I can't find it - which
>>> FreeBSD archs are little/big endian? Thanks.
>>> 
>>
>> i386 is little endian. Would expect ia64 to be the same.
>>
>>   
>
> SPARC is big endian. Or at least it used to be.
>
> Power4,5,6 are all big endian too if I'm not mistaken.
>
> Correct me if I'm wrong but anything based around the CISC
> architecture is big endian.

As the original poster observed, PowerPC, Sparc and IA64 are all capable
of being used in either endian setting.  

I checked endian.h, and it looks as though FreeBSD uses Sparc as
big-endian, IA64 as little-endian, and PowerPC as whatever it picks up
from gcc (probably big-endian, since the architecture does funny things
with alignment in little-endian mode.

My best advice, though, is to suggest that Mr. Farmer shouldn't assume
that the application will work anywhere without actually trying it.

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
http://be-well.ilk.org/~lowell/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Endianness

2010-01-12 Thread Kaya Saman

David Kelly wrote:

On Tue, Jan 12, 2010 at 12:51:00PM -0800, Rob Farmer wrote:
  

I'm trying to create a port of an application which only works on
little endian systems and I'm trying to figure out how to set
ONLY_FOR_ARCHS.  Wikipedia says PowerPC, Sparc, and IA64 are bi-endian
and the OS chooses the mode. I'm not familiar with these platforms -
I'm sure it has been answered somewhere, but I can't find it - which
FreeBSD archs are little/big endian? Thanks.



i386 is little endian. Would expect ia64 to be the same.

  


SPARC is big endian. Or at least it used to be.

Power4,5,6 are all big endian too if I'm not mistaken.

Correct me if I'm wrong but anything based around the CISC architecture 
is big endian.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Endianness

2010-01-12 Thread David Kelly
On Tue, Jan 12, 2010 at 12:51:00PM -0800, Rob Farmer wrote:
> I'm trying to create a port of an application which only works on
> little endian systems and I'm trying to figure out how to set
> ONLY_FOR_ARCHS.  Wikipedia says PowerPC, Sparc, and IA64 are bi-endian
> and the OS chooses the mode. I'm not familiar with these platforms -
> I'm sure it has been answered somewhere, but I can't find it - which
> FreeBSD archs are little/big endian? Thanks.

i386 is little endian. Would expect ia64 to be the same.

-- 
David Kelly N4HHE, dke...@hiwaay.net

Whom computers would destroy, they must first drive mad.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Endianness

2010-01-12 Thread Rob Farmer
I'm trying to create a port of an application which only works on
little endian systems and I'm trying to figure out how to set
ONLY_FOR_ARCHS.  Wikipedia says PowerPC, Sparc, and IA64 are bi-endian
and the OS chooses the mode. I'm not familiar with these platforms -
I'm sure it has been answered somewhere, but I can't find it - which
FreeBSD archs are little/big endian? Thanks.

-- 
Rob Farmer
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Endianness of freeBSD

2008-02-04 Thread Christian Weisgerber
Heiko Wundram (Beenic) <[EMAIL PROTECTED]> wrote:

> > Alpha is little endian. i had alpha 21066 running linux.
> 
> Not true. Alpha is big- or little-endian (so, it's bi-endian),

Alpha is little-endian in practice.  I've never heard of DEC--or
anybody else for that matter--building a big-endian alpha.  Note
that DEC's previous CPU architecture, the VAX, was also little-endian.

> depending on how it's booted,

... on how _the CPU_ is booted, yes.  By the time you are running
firmware and thinking of booting an operating system, it's much too
late.

> and IIRC the Windows NT version running on Alpha used the 
> big-endian mode of the CPU. But I might be mistaken.

I think you are mistaken.  The ARC MIPS platform, which Windows NT
originally was written for, was also little-endian.

-- 
Christian "naddy" Weisgerber  [EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Endianness of freeBSD

2008-02-04 Thread Wojciech Puchar


Not true. Alpha is big- or little-endian (so, it's bi-endian), depending on
how it's booted, and IIRC the Windows NT version running on Alpha used the
big-endian mode of the CPU. But I might be mistaken.


i had SRM console used netbsd too later, too little endian.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Endianness of freeBSD

2008-02-04 Thread Enno Davids
On Mon, Feb 04, 2008 at 01:20:14PM +0100, Heiko Wundram (Beenic) wrote:
|
|As I said above: it depends on the hardware. There is even hardware (ARM, in 
|particular) which can run in little- or big-endian mode, depending on how it 
|is initialized.

If I recall correctly some of the MIPS chips had/ve an endian selector bit
on each page table entry in the MMU. The idea was to map each of the I/O
devices through the MMU and let that bit help in talking to the hardware
(i.e. Intel peripherals expecting little endian and motorola chips wanting
the opposite.)


E.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Endianness of freeBSD

2008-02-04 Thread Heiko Wundram (Beenic)
Am Montag, 4. Februar 2008 14:30:12 schrieb Wojciech Puchar:
> > the Windows NT days, which ran on Alpha workstations which were
> > big-endian.
>
> Alpha is little endian. i had alpha 21066 running linux.

Not true. Alpha is big- or little-endian (so, it's bi-endian), depending on 
how it's booted, and IIRC the Windows NT version running on Alpha used the 
big-endian mode of the CPU. But I might be mistaken.

-- 
Heiko Wundram
Product & Application Development
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Endianness of freeBSD

2008-02-04 Thread Wojciech Puchar

the Windows NT days, which ran on Alpha workstations which were big-endian.


Alpha is little endian. i had alpha 21066 running linux.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Endianness of freeBSD

2008-02-04 Thread Wojciech Puchar



1. Is FreeBSD little Endian like windows?

2. Linux is Big endian?

wrote a code int i = 1;if((i >> 1) == 0) little else big
got little on all platforms bsd,linux,windows.

*Does endianness depends on OS or the hardware?*


on hardware
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Endianness of freeBSD

2008-02-04 Thread Heiko Wundram (Beenic)
Am Montag, 4. Februar 2008 13:03:25 schrieb navneet Upadhyay:
> 1. Is FreeBSD little Endian like windows?

FreeBSD endianness depends on the hardware architecture it runs on (as 
endianness is a hardware characterization). (Very) generally, anything that's 
related to an Intel CPU is little-endian, whereas anything that's related to 
a Motorola, IBM or Sparc CPU is big-endian.

(Modern) Windows exists only on little-endian hardware [Intel, AMD and clones] 
(AFAIK, someone correct me here), so basically it's always little-endian, you 
could say that. There were Windows versions for other CPUs, though, back in 
the Windows NT days, which ran on Alpha workstations which were big-endian.

> 2. Linux is Big endian?

Same as for FreeBSD.

> wrote a code int i = 1;if((i >> 1) == 0) little else big
> got little on all platforms bsd,linux,windows.

This won't tell you what endianness the platform has. It'll say "little" for 
any architecture (because ( 1 >> 1 ) == 0 for any CPU that knows how to do 
binary shifts).

What you can use to test for little or big-endianness, is something like the 
following:

unsigned long test = 0x12345678;
char* ptest = (char*)&test;

if( *ptest == 0x78 )

else if( *ptest == 0x12 )

else


> *Does endianness depends on OS or the hardware?*

As I said above: it depends on the hardware. There is even hardware (ARM, in 
particular) which can run in little- or big-endian mode, depending on how it 
is initialized.

-- 
Heiko Wundram
Product & Application Development
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Endianness of freeBSD

2008-02-04 Thread Ivan Voras
> 1. Is FreeBSD little Endian like windows?
>=20
> 2. Linux is Big endian?
>=20
> wrote a code int i =3D 1;if((i >> 1) =3D=3D 0) little else big
> got little on all platforms bsd,linux,windows.
>=20
> *Does endianness depends on OS or the hardware?*

It depends on the hardware.
http://en.wikipedia.org/wiki/Endianess




signature.asc
Description: OpenPGP digital signature


Re: Endianness of freeBSD

2008-02-04 Thread Wouter Oosterveld
Endianness depends on the hardware.

In internal kernel structures endianness does not matter, if
communicating with other machines protocols (usually) define a
bitorder.

The c-library and/or systemlibrary contains utility functions for conversion.

Regards,

Wouter Oosterveld

2008/2/4, navneet Upadhyay <[EMAIL PROTECTED]>:
> 1. Is FreeBSD little Endian like windows?
>
> 2. Linux is Big endian?
>
> wrote a code int i = 1;if((i >> 1) == 0) little else big
> got little on all platforms bsd,linux,windows.
>
> *Does endianness depends on OS or the hardware?*
> **
> **
> *Thanks,*
> *navneet*
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
>


-- 
[
  [EMAIL PROTECTED] is binnenkort niet meer,
[EMAIL PROTECTED] is mijn nieuwe email-adres.
]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Endianness of freeBSD

2008-02-04 Thread navneet Upadhyay
1. Is FreeBSD little Endian like windows?

2. Linux is Big endian?

wrote a code int i = 1;if((i >> 1) == 0) little else big
got little on all platforms bsd,linux,windows.

*Does endianness depends on OS or the hardware?*
**
**
*Thanks,*
*navneet*
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


UFS endianness

2005-04-08 Thread Jeremy Baggs
I was just wondering if anyone was working on support for NeXT/Apple UFS
file systems under FreeBSD.

  Jeremy

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"