/dev/random

Reality has a liberal bias

/dev/random random header image

Intel Mac performance

January 31st, 2006 · Comments Off · Uncategorized

I should receive my new iMac tomorrow, so my tests were done on my DTK. Several sites have done performance tests showing the Intel iMac to be slower than a G5. However, anyone using a G4 (as I am) will see a big speedup with an Intel mac. I use a PowerBook as my primary [...]

[Read more →]

Tags:

Intel blows away G5

January 26th, 2006 · Comments Off · Macintosh

I’m looking forward to my new iMac (which is in Shanghai as I write this).
See the speed comparison here.

[Read more →]

Tags:

DTK Exchange

January 13th, 2006 · Comments Off · Macintosh

I’ll be getting a new Intel iMac thanks to Apple’s DTK Exchange Program. I’m now setting up a server-based home directory, so I can access my email & other stuff from both my PowerBook and the iMac, which will become my primary machine.

[Read more →]

Tags:

Universal builds for PPC & x86

November 8th, 2005 · 5 Comments · Uncategorized

The latest version of XCode allows you to specify separate settings for x86 & PPC code, although it isn’t really obvious how to do it. After some digging I figured it out.
Some of the build settings such as SDKROOT & GCC_VERSION allow you to specify which architecture they apply to by appending _ppc or _i386 [...]

[Read more →]

Tags:

Intel porting tip

October 23rd, 2005 · Comments Off · Uncategorized

I now have most of my code working on the Intel Mac. Once again, I need to reiterate this bit of advice: Never assume Macs are Big Endian.
We already have a cross platform product that works on both Macs & PCs. Since it deals with binary data read from a file, it needs to [...]

[Read more →]

Tags:

New category & feed

October 18th, 2005 · Comments Off · Macintosh, Programming, Web

I’ve created a new category, Mac x86 for all of my posts about porting to Intel. You can also subscribe to a feed for that category only here

[Read more →]

Tags:

Porting to Intel V

October 18th, 2005 · Comments Off · Programming

For any networking code, make sure you’re using htonl & htons when building a socket address structure. If you look at the structure you’re passing to connect(), the IP address & port should appear reversed. Dealing with these byte ordering issues can be very confusing. Always be aware of what byte order is expected for [...]

[Read more →]

Tags:

Porting to Intel IV - W00t!

October 14th, 2005 · Comments Off · Programming

I got a major part of my application working on the Intel Mac.
Here are a few macros I came up with to handle the byte ordering issues when reading & writing binary data from a file:

#define W(w) ((unsigned short)w)
#define WSWAP(w) (W((W(w) << 8 ) | (W(w) [...]

[Read more →]

Tags:

Porting to Intel III

October 12th, 2005 · Comments Off · Programming

The XCode debugger (and gdb) will confuse you with word & long values. For example, I have an IP address & port stored as the bytes 00 50 c0 a8 0 64 (that’s 192.168.0.100:80). Displaying memory in the debugger will show it as a8c05000 00006400 if you use the default word size of 4. [...]

[Read more →]

Tags:

Porting to Intel II

October 11th, 2005 · Comments Off · Programming

Never assume Macs are big-endian. I found code which uses #ifdef __MAC__ to decide whether byte order swapping is required - that’s just plain wrong.

[Read more →]

Tags:

Porting to Intel

October 7th, 2005 · Comments Off · Programming

An IP address is not a long int - it’s 4 bytes. Doing something like this is bad:

sprintf(buf,”%ld.%ld.%ld.%ld”, (ip>>24) & 255, (ip>>16) & 255, (ip>> 8 ) & 255, ip & 255);

[Read more →]

Tags:

Mac x86 porting

June 8th, 2005 · 2 Comments · Macintosh, Programming

Although I don’t have the x86 development system, I’ve been using XCode 2.1. For one of my projects, I was able to convert to x86 in less than 15 minutes. I simply opened the project in XCode 2.1, selected the 10.4 universal SDK, chose intel & ppc architectures, and made sure it was using GCC [...]

[Read more →]

Tags: