LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 07-21-2008, 11:25 AM   #1
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
How did they get the Mac *OS* to Intel-ise?


When Apple switched from PowerPC to x86, the MacOS uptil then was obviously powerpc. How the HELL did it suddenly one day boot up and do same thing on x86???!!!
 
Old 07-21-2008, 11:43 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by resetreset View Post
When Apple switched from PowerPC to x86, the MacOS uptil then was obviously powerpc. How the HELL did it suddenly one day boot up and do same thing on x86???!!!
Well, I would guess that --before the Intel Macs were announced-- they spent some time porting the SW to the x86 architecture.

I'm trying to remember if MacOS became Unix-based at the same time.
 
Old 07-21-2008, 11:51 AM   #3
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by pixellany View Post
Well, I would guess that --before the Intel Macs were announced-- they spent some time porting the SW to the x86 architecture.
Uh yes - this porting *how*?
 
Old 07-21-2008, 11:58 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by resetreset View Post
Uh yes - this porting *how*?
In principle, with modern tools, most SW is platform-independent. For something like an OS, there are header files that take car of the machine-specific details.

simplistically, "porting" means re-compiling the SW for the new environment (and perhaps a bit of de-bugging....)
 
Old 07-21-2008, 12:31 PM   #5
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
They typed 'make'.

But seriously, they'd been maintaining an x86 branch the whole time. Same as Microsoft did with NT on PowerPC and Alpha.

Dave
 
Old 07-21-2008, 12:48 PM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
The Apple file system has multiple resource forks, so a particular file can actually exist for two different CPU architectures simultaneously. Their file system and toolchain had the hooks built in for a long time to be able to be built for x86, so it was just a matter of actually compiling the software for the extra architecture and then installing it on the new hardware.

Remember that existing hardware didn't suddenly switch architectures, so all the existing PPC machines are still PPC and run the PPC version of all the Apple apps. Only the new Intel-based machines actually run the x86 version.

To assist in the transition from software that was written only for the PPC architecture, Apple created a VM layer called Rosetta that would translate PPC instructions into x86 so that any time you start an app built for PPC, it would automatically execute through the VM and so it would work transparently without having to wait for a new version of the software.
 
Old 07-21-2008, 12:56 PM   #7
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by pixellany View Post
I'm trying to remember if MacOS became Unix-based at the same time.
It became BSD-based after they merged with NeXT. OS9 was the last in the family of the original MacOS. With OS X they went to a BSD/Mach hybrid. Notice that since then they haven't changed the major revision number (10), but instead bumped the minor number (0, 1, 2, 3, 4, 5, and now 6 with Snow Leopard). Essentially "OS X" became the brand name of the OS (like "Windows").

I can't remember how long they've had the x86 hooks in the toolchain, but certainly the file system was designed for just that sort of thing from the outset.
 
Old 07-21-2008, 01:09 PM   #8
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
I seem to recall an interview with Apple (Jobs, probably) where they said that they had built an Intel version of every release of OS X (.0, .1, .2, etc).

As PPC interrupt handling is different (as in, different from useful, if you are trying to do real-time stuff), there was probably a fair amount of 'ifdef-ing' in the hardware-specific code and the interrupt handlers, but that's such a small percentage of the code base, although a tricky one.

But once the very hardware-specific stuff is out of the way, its all C, right?
 
Old 07-26-2008, 10:17 PM   #9
D-EJ915
LQ Newbie
 
Registered: Oct 2007
Location: Virginia Beach, VA
Distribution: Arch, Debian, Ubuntu, OpenBSD, HP-UX, Solaris
Posts: 1

Rep: Reputation: 0
NextSTEP/OpenSTEP (where OS X came from) originally ran on Intels, 68k, sparc and parisc so they actually ported it to powerpc to use with OS X, they obviously dropped the other platforms besides i386 though.

Last edited by D-EJ915; 07-26-2008 at 10:18 PM.
 
Old 07-26-2008, 11:31 PM   #10
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Steve Jobs was a good boy and asked Santa for a miracle for Christmas - he sure saved a lot of money because he didn't need to hire programmers to do the job.

In the alternate universe, someone typed 'make BUILD=gnu-ppc-osx HOST=gnu-i686-osx'. Then they spent the next week building all the other stuff.
 
Old 07-27-2008, 01:07 PM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Quote:
Originally Posted by resetreset View Post
Uh yes - this porting *how*?
More-or-less the same way that Linux does it.

Look in the /arch subdirectory of any Linux source and you'll see about 25 different architectures represented there. The same Linux can run on any of them.

"Most of Linux" is architecture-independent. The parts that aren't, are right here. These files will include, for example, asm sections for this-or-that CPU.

Also notice that the same compiler is used.

Modern language systems, like gcc, are also built to be "architecture-independent," and they have the ability to generate code for a CPU of a different type than the one they are running on ... a feat called "cross-compiling."

Although this has been technically-possible for many, many years, Apple was one of the first to "boldly and confidently do it, and succeed." That's one of the first times when Wall Street really sat up and started taking notice of AAPL...
 
Old 07-28-2008, 10:24 AM   #12
ninjaslim
LQ Newbie
 
Registered: Jul 2008
Location: North Brunswick, NJ
Distribution: FreeBSD 7-STABLE, Mac OS X
Posts: 29

Rep: Reputation: 15
Quote:
Originally Posted by pixellany View Post
Well, I would guess that --before the Intel Macs were announced-- they spent some time porting the SW to the x86 architecture.

I'm trying to remember if MacOS became Unix-based at the same time.
Mac OS X has been Unix-based since development started in 1998 or 1999, except that Leopard is the only version to be UNIX certified. Mac OS X is a BSD operating system borrowing the userland from FreeBSD 5 and using the Mach kernel as the base.
 
  


Reply



Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mac OS X on Intel Ammad Other *NIX 2 11-17-2007 07:27 AM
Mac OS X on intel kc3377 Other *NIX 14 04-01-2007 03:46 PM
Linux on an Intel Mac redneon Linux - General 1 02-08-2007 02:28 PM
Mac switch to intel mimithebrain General 8 06-29-2005 08:26 PM
ISE semiconductor process simulation max2878 Linux - Software 0 05-22-2002 02:27 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 10:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration