CX School SCH.cx – Is it macOS UNIX? (What does it mean?). Still similar to Unix? We answer endless debates and explain standards such as POSIX and SUS along the way.
macOS: Is it UNIX?
This topic raises many different questions. What is the pedigree of macOS? Does it matter how much genetic material still exists in macOS today? Before we start answering whether something is UNIX, Unix, or Unix-like, we need to understand the meaning of these terms. Who decides whether it is Unix or UNIX, and what standard they use?
Let’s start from the beginning.
Unix was fifty years ago at Bell Labs ( Bell Labs created), Bell Labs is AT & T’s research and development company. Fast forward to 1973 and rewrite the 4th edition of Unix using the C programming language. This makes the operating system more portable and easier to transfer to different hardware platforms. In the same year, two core Unix architects, Ken Thompson and Dennis Ritchie published a paper at a conference on operating systems. They immediately received a request for a copy of the operating system.
Subject to the consent order dating back to 1956, AT&T had to avoid “any business other than the provision of ordinary carrier communication services.” Unix does not meet the conditions for AT&T to profit from it. Therefore, the company did a very good job at the time: to distribute Unix as source code with a free license. Small fees cover transportation and packaging costs as well as “reasonable royalties”.
The proliferation of Unix
Because Unix is provided “as is”, it has no support. As a result, the Unix community began to unite to help members and to patch and extend Unix. Therefore, you can get the source code, modify it, and get community support. This is a familiar ring. Various styles of Unix began to emerge, adapt, and adjust to suit the organization engaged in this work.
The University of California, Berkeley computer science professor Bob Fabry participated in the program committee in the 1973 Operating System Principles seminar. He listened to Thompson and Ritchie’s lecture entitled UNIX Time-Sharing System.
Fabry requested a copy of the operating system and installed Unix on the PDP/11 of UC Berkeley’s Computer Science Research Group (CSRG) in 1974. It is worth mentioning that Ken Thompson stayed there for a year, working to make the university quickly become Unix style. Copies of changes and additions from the University of California, Berkeley have been distributed and are referred to as Berkeley Software Distribution (BSD). In the end, these became the distribution of the entire Unix system (still called BSD). The version number (for example, 4.2BSD) identifies the different releases.
In 1984, AT&T got rid of the restrictions of the 1956 consent order and was able to sell its operating system appropriately. It includes BSD codes such as TCP/IP, vi, and C shell csh. Even with this kind of cross-pollination and collaboration, licensing remains difficult. BSD contains AT&T code, it is not open source, but BSD elements are.
A BSD version without AT&T code was developed to solve these problems. However, when the AT&T code was deleted, about 20% of the kernel was lost. William Jolitz wrote the part of the missing, and the version of Unix was released 386BSD. The 386BSD project stalled, but in 1993, its source code base produced the NetBSD and FreeBSD projects.
This gives us a puzzle: FreeBSD.
Next, Inc.
In 1985, Steve Jobs (Steve Jobs) after being fired from Apple, founded a company called NeXT, Inc. Of the company. In order to provide an operating system for its workstation product line, NeXT developed NeXTSTEP. It uses BSD as the code base but introduces a completely different kernel.
NeXT uses the Mach microkernel and a modified version of 4.3BSD to form NeXTSTEP, which is the second part of the puzzle. Mach was developed at Carnegie Mellon University to promote research on distributed and parallel computing. The research team used BSD as the operating system and replaced the kernel instead of writing its own operating system.
XNU
In 1996, Apple, Inc. acquired NeXT, Inc., thereby acquiring NeXTSTEP. Apple began developing the eventual adoption of Mac OS X to become macOS of the operating system. It upgraded the Mach kernel and replaced it with a more advanced version developed by the Open Software Foundation and used in the OSF/1 operating system. Apple also upgraded the BSD components with updated and improved versions in the FreeBSD distribution.
Apple brought the elements of the BSD kernel back to the Mach kernel. It has also developed a hybrid kernel that combines the characteristics of monolithic and micro-kernel architectures.
It also includes I/O kits developed by Apple based on NeXTSTEP’s DriverKit. This allows the driver to be added to the kernel without having to modify it every time.
XNU is the third part of the puzzle.
POSIX and SUS standards
In 1996, two standards bodies ( X/Open and the Open Software Foundation) merged to form The Open Group.
Open Group is a certification body for UNIX trademarks. In other words, before you name it UNIX, it must offset the operating system to make it conform to its standards. All capital letters in UNIX are signs of compliance.
Therefore, the categories are as follows:
- Unix: Operating system family. This family includes both UNIX operating systems and Unix-like operating systems.
- UNIX operating systems: These operating systems have been proven to comply with standards.
- Unix-like operating systems: Their appearance and operation are similar to Unix, but they have not yet been certified.
Of course, it is entirely possible that certain operating systems in the “Unix-like” category will be tested and meet the requirements tomorrow. These are actually UNIX now, but they can only be classified as Unix because they don’t have rubber stamps yet.
There are two standards for certifying UNIX: POSIX and Single UNIX Specification (SUS). SUS is a superset of POSIX. Therefore, some things are compatible with POSIX, but this does not make it UNIX. However, if something complies with SUS, it is UNIX.
POSIX and SUS formed a large collection of documents (approximately 3,700 pages). They define the operation and expected behavior of all aspects of compatible UNIX systems. Everything from asynchronous and synchronous I/O to script interfaces and user-level programs is cataloged and defined.
These standards define application program interfaces and runtime behavior, but do not specify how to implement them.
So, is macOS UNIX?
The answer must be yes.
You can trace its lineage back to BSD through FreeBSD, and then back to Unix distributed by Bell Labs, and then collect license fees from AT&T.
But it’s okay.
If you write an operating system from scratch now, as long as it meets the requirements of SUS, you can consider it to be UNIX. The implementation is also irrelevant. The XNU kernel at the core of macOS is a hybrid architecture. It combines Apple’s code and some Mach and BSD kernels.
But this is not important. It is important that it meets the requirements of the tested standard.
The BSD part of the XNU kernel provides POSIX application programming interfaces (such as various APIs and BSD system calls). Keeping this element of the BSD kernel in XNU intact is the key to obtaining UNIX certification. It allows XNU to have compatible UNIX dialogues with the rest of the system.
macOS is a UNIX 03-compliant operating system certified by The Open Group. Since 2007, it started with MAC OS X 10.5. The only exception is Mac OS X 10.7 Lion, which regained compliance with OS X 10.8 Mountain Lion.
Interestingly, just as GNU stands for “GNU’s Not Unix”, XNU stands for “X is Not Unix”.