Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Mr. Dee

macrumors 603
Original poster
Dec 4, 2003
5,990
12,840
Jamaica
Just a curious thought that popped into my head. I probably should have reached out to Steven Troughton-Smith but thought I would ask here. Does anyone know if Apple has rewritten the macOS code base since OS X was introduced in March of 2001? I know they have deprecated technologies and protocols. For instance moving from HFS+ to APFS and a host of kernel extensions. Is the codebase the same as what was launched in 2001 or even going back to its ancestor NeXTStep and into today Ventura?

I know that Big Sur couldn't see my OS X Puma PowerBook on the network, but it does see later versions.
 

monstermash

macrumors 6502a
Apr 21, 2020
974
1,062
Just a curious thought that popped into my head. I probably should have reached out to Steven Troughton-Smith but thought I would ask here. Does anyone know if Apple has rewritten the macOS code base since OS X was introduced in March of 2001? I know they have deprecated technologies and protocols. For instance moving from HFS+ to APFS and a host of kernel extensions. Is the codebase the same as what was launched in 2001 or even going back to its ancestor NeXTStep and into today Ventura?

I know that Big Sur couldn't see my OS X Puma PowerBook on the network, but it does see later versions.

Last I was writing code...there were function calls or objects beginning with "NS" which stands for NeXTStep.

Those were either some old, original code sections/fragments/objects or new stuff with old names to maintain compatibility with something (or possibly for nostalgia I guess).

Here is an example:

 
  • Like
Reactions: Mr. Dee

joevt

macrumors 604
Jun 21, 2012
6,970
4,262
Rewrite? No. Things change or become unsupported but there's stuff in the kernel from the Power Mac days that still exist now in the Apple Silicon days.

My Mac Pro 2008 boots all versions of macOS since 10.4 to 10.15 to 11 to 13. My DirectHW kext (used for lspci in pciutils and flashrom) works on Power Mac, Intel Mac, and might work on Apple Silicon Mac with some minor changes (or it might not).

I can share the screen of my Quad G5 which is running 10.5 Leopard and connect to its drives from macOS 12 Monterey. I use it to transfer files to a Power Mac 8600 or B&W G3 running Mac OS 9.2.2.
 
  • Like
Reactions: Mr. Dee

galad

macrumors 6502a
Apr 22, 2022
613
494
There is such things as a "full rewrite". There are incremental changes.
It could be that after enough changes there are no code left from 20 years ago. But this is probably not the case for macOS.
 

Mr. Dee

macrumors 603
Original poster
Dec 4, 2003
5,990
12,840
Jamaica
There is such things as a "full rewrite". There are incremental changes.
It could be that after enough changes there are no code left from 20 years ago. But this is probably not the case for macOS.
I asked because, macOS has done so many CPU architecture jumps over the past few decades: Motorala 6800 (NeXTStep) > PowerPC (Rhapsody) > Intel (Tiger) > Apple Silicon (Big Sur).

My conclusion, after so many changes, this has got to be a completely different OS after so much iterations.
 

monstermash

macrumors 6502a
Apr 21, 2020
974
1,062
I asked because, macOS has done so many CPU architecture jumps over the past few decades: Motorala 6800 (NeXTStep) > PowerPC (Rhapsody) > Intel (Tiger) > Apple Silicon (Big Sur).

My conclusion, after so many changes, this has got to be a completely different OS after so much iterations.

A lot of it is written in C, which was specifically designed to be as architecture portable as possible. You may need to make certain changes when moving from Big Endian to Little Endian systems, or when moving up in bit bandwidth on CPUs, and other kinds of things, but, overall, those kinds of changes are relatively contained. Wholesale changes to general code usually isn't required. You will of course have to rewrite any low level assembly as well.
 

Basic75

macrumors 68020
May 17, 2011
2,126
2,487
Europe
My conclusion, after so many changes, this has got to be a completely different OS after so much iterations.
You're forgetting that NextStep already ran on 68k and x86. The foundation of macOS has always been portable.
 

gilby101

macrumors 68030
Mar 17, 2010
2,970
1,640
Tasmania
Is the codebase the same as what was launched in 2001 or even going back to its ancestor NeXTStep and into today Ventura?
Might need to distinguish between written code (mostly in C?) and OS design.
Some of the OS X code goes back to NeXTStep - so that gets back to ~1990. But in turn that was based on the Mach kernel and BSD Unix and BSD Unix was based on Bell Labs Unix from 1969.
Whilst I don't know if there is any 1969 code still present, there are unchanged design structures. The original file system structure from 1969 is still present in macOS as are many of the commands to use it - ls, etc.
 
  • Like
Reactions: NoBoMac

NoBoMac

Moderator
Staff member
Jul 1, 2014
6,302
5,021
^^this.

Not to get into a semantics war about what’s what, but there are layers to it (eg. “OS” vs UI). And as others mentioned, at the lower levels, the OS is a descendant of other older OS. Might be mistaken but FreeBSD is still the major chunk where MacOS starts from and which supports ARM (first step to Apple Silicon).


Can dig through the code yourself: Apple keeps it in GitHub per open source licensing agreements (FreeBSD etal).

 
Last edited:
  • Like
Reactions: gilby101
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.