Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Would an "endian" switch help Macs?

Would an "endian" switch help Macs?
Thread Tools
NeoMac
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Aug 18, 2001, 11:38 AM
 
I hear a lot about how Macs use a different "endian" than PCs. It seems to slow down software and hardware ports to Macs.

Is it feasible for Apple to switch to the PC "end" ?? What would it improve, it anything? Would we have a bigger selection of 3D cards and software, etc??

Just curious.
"Last time the French asked for more evidence, it rolled through France with a German flag." - David Letterman
     
Dalgo
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Aug 18, 2001, 11:47 AM
 
It's a non issue. Switching the endian nature of the processor would break all current apps for the mac, including the OS. In other words apple is never going to do it unless they switch to a totally different processor line which is powerful enough to emulate the PowerPC instruction set at a decent speed.

FYI: The PowerPC processor can run in big or little endian mode, according to Motorola's documentation. It is pretty much a choice that must be made at boot time. It does, however, appear to be less efficient in little endian mode since it looks like some instructions aren't supported and would need to be done via software. Macs use big endian mode.
     
AirSluf
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Aug 19, 2001, 03:58 PM
 
Also, unless they do something like assembler, programmers don't speak in "endians", code that comes out of a compiler for a specific CPU model does. Endian-ness is more an emulation speed issue than a porting one unless you need to be touching code at a very low level with human hands.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Aug 19, 2001, 04:42 PM
 
Originally posted by AirSluf:
<STRONG>Also, unless they do something like assembler, programmers don't speak in "endians", code that comes out of a compiler for a specific CPU model does. Endian-ness is more an emulation speed issue than a porting one unless you need to be touching code at a very low level with human hands.</STRONG>
No, this isn't correct. Whenever you deal with bytes directly you normally have to deal with endians. Like GIF is little endian even on PowerPC, I think. I know it's involved with file access and sockets.
     
AirSluf
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Aug 20, 2001, 11:28 PM
 
No, this isn't correct. Whenever you deal with bytes directly you normally have to deal with endians. Like GIF is little endian even on PowerPC, I think. I know it's involved with file access and sockets.
Endian-ness or not, everything I do is 100% cross platform and I have not had to make any allowances in any of the work I do on the Mac to interface with PC or Linux(non-PPC) for endian-ness, including network and/or file streams which are definitely byte related. Your description would also break all ability to save a Word file on a Mac HFS+ disk and e-mail it as an attachment to a PC user who can then use it completely unmodified, or the reverse with Word or even MS-Dos Text. I do this constantly with non-Mac savvy folks so endian-ness usually isn't an issue for users or higher level programmers. By no means am I an expert at the endian issue, but it has not presented itself as an obstacle in any of the x-platform applications I have had a hand in developing.

The ability of identical PCI or AGP hardware to run in a Mac or PC also shows endian-ness is not a significant roadblock to anything. Yes, the dual-use hardware must have support built in for both ends but the economics of that decision are positive as the effort to incorporate both is much less than the end return in profit. The biggest obstacle to other peripheral manufactures is the physical market size. While two competing products can be profitable, the overall outlook for a third or fourth product in the same niche is MUCH gloomier. A marketing decision rather than a technical one.
     
ink
Mac Elite
Join Date: May 2001
Location: Utah
Status: Offline
Reply With Quote
Aug 21, 2001, 02:04 AM
 
Originally posted by Angus_D:
<STRONG>
No, this isn't correct. Whenever you deal with bytes directly you normally have to deal with endians. Like GIF is little endian even on PowerPC, I think. I know it's involved with file access and sockets.</STRONG>
But who reads GIF files in the raw? Libraries do that (which is what I think AirSluf was talking about). The only place I've been bitten by endianness was with some network code (hence htonl and htons), but even a silly protocol like HTTP does that for you.
     
Scott_H
Professional Poster
Join Date: Jan 2000
Status: Offline
Reply With Quote
Aug 21, 2001, 02:25 AM
 
I deal with medical images and often have to byte swap. Most image files have a tag in the header that states endian-ness. It's a non issue because everyone is aware of it.

There's a kick ass unix command that you can use to swap bytes right on the command line
     
Scribble
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Aug 21, 2001, 08:55 AM
 
Scott_H --

And that command would be??? I know several people, including myself, that would be very interested in knowing what it is.


I'd just write a stupid little C-program to swap, which does the trick also.


Scribble
     
Scott_H
Professional Poster
Join Date: Jan 2000
Status: Offline
Reply With Quote
Aug 21, 2001, 10:48 AM
 
Originally posted by Scribble:
<STRONG>Scott_H --

And that command would be??? I know several people, including myself, that would be very interested in knowing what it is.


I'd just write a stupid little C-program to swap, which does the trick also.


Scribble</STRONG>
You can use sed and ed to do it. I'd plunk out an example but I'm in OS 9 right now and can't test it.
     
AG3
Fresh-Faced Recruit
Join Date: Jan 2001
Location: vic
Status: Offline
Reply With Quote
Aug 21, 2001, 05:56 PM
 
PPC is bi-endian.......It has support for little endian as well as PPC native Big endian.

Why would you want anything to do with x86, its going to be obsolete when the itanium comes out in a years time. Itanium will come out as 800mhz, then well see some hi-cups.
     
Scott_H
Professional Poster
Join Date: Jan 2000
Status: Offline
Reply With Quote
Aug 21, 2001, 06:09 PM
 
Originally posted by AG3:
<STRONG>PPC is bi-endian.......It has support for little endian as well as PPC native Big endian.</STRONG>
Sure but once you make it part of a motherboard then it's set. As far as I know there's no dynamic way to change it. It wouldn't help anyway because programmers often step byte by byte through data. So there's no way to guess how they might expect the data. Unless you tell them in the file headder "big endian" and then they can swap or not swap and then use the data how they want to.
     
Molz
Junior Member
Join Date: Sep 2000
Location: Tempe, Az USA
Status: Offline
Reply With Quote
Aug 21, 2001, 06:33 PM
 
Originally posted by Scribble:
<STRONG>Scott_H --

And that command would be??? I know several people, including myself, that would be very interested in knowing what it is.


I'd just write a stupid little C-program to swap, which does the trick also.


Scribble</STRONG>
Here you go:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
$ dd <font color = green>if</font>=infile.foo of=outfile.foo.swaped conv=swab
</font>[/code]

Where infile.foo is the input file and outfile.foo.swaped is the the swaped byte version of the input file. Don't ask me why the conversion operation is called swab but it is.
     
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Aug 21, 2001, 06:44 PM
 
Using endianness as a roadblock to porting is like saying the Mac line terminator blocks porting (\r (Mac) \n (Unix) \r\n (Stupid DOS)). In any good software shop, reading endian bytes is handled in a macro so that the endianness of the whole application can be swapped with a flag. For things like GIF, those don't play into the equation at all because the processor does not execute GIF's, so the orientation of the pixels would have to be handled anyway. The single biggest barriers to porting are the hardware and API differences.

At any rate, that's why we use Macs, because they are different.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:58 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,