Original address: juejin.cn/post/684490…

Q&A

I often hear a similar question: What is the connection between Unix, Linux and MacOS? What difference does it make?

First the conclusion:

  • Linux is a Unix-like operating system, and most of the software in its kernel runs according to POSIX protocol, so it has a similar effect to Unix.
  • The MacOS kernel is a branch of the Unix family. The kernel is based on a mixture of NeXTSTEP and FreeBSD development, so some functions run the same as Unix systems and some functions are different (custom development).

The diagram below:

Let’s start with the details.

Unix

Unix is a general name for the multi-user and multi-process computer operating system. It originated from the AT&T Unix developed by AT&T Bell Labs in the United States from the 1970s, including many similar but different varieties of operating systems. Unix is a commercially proprietary product that must be purchased or licensed for use.

POSIX

As the number of Unix variants of operating systems increased, there was a need for standards to regulate each variant to ensure compatibility between systems, and POSIX came into being.

POSIX: Portable Operating System Interface (POSIX), a set of standards defined by the IEEE Computer Society to ensure compatibility between UNIX Operating systems.

The standards defined in POSIX are:

  • Core Services: Core Services, including Process, Signals, Pipes, C Library, etc.
  • Real-time Extensions: Includes Priority Scheduling, real-time Signals, Shared Memory, Asynchronous and Synchronous I/O, etc.
  • Threads extensions: Including Thread Creation, Control, and Cleanup, Thread Scheduling, Thread Synchronization, Signal Handling, etc.
  • Shell and Utilities: includes Command Interpreter and Utility Programs.cd.cp.lsAnd so on.

SUS

SUS: Single UNIX Specification, created for the same purpose as POSIX to ensure compatibility between UNIX systems. It is now developed and maintained by The Austin Group, a joint effort of IEEE and The Open Group.

The Austin Group defines a common set of standards from POSIX and SUS called the Open Group Base Specification.

POSIX and SUS intersect

Linux

Linux is a general name of unix-like operating system based on Linux kernel.

The Linux kernel is an operating system kernel published by Linus Torvalds.

GNU Project

GNU Project is a Project about free-software, mass-collaboration. The idea is that users can freely use, share, learn and modify software.

The GNU project and the Linux kernel can form a Unix-like operating system:

  • GNU Packages: Tools and applications that contain many operating systems, such asshell.coreutils.compilers.librariesAnd according to POSIX standard implementation of the class library.
  • Linux kernel: provides process scheduling, multi-task processing, driver management, memory management and other functions.
  • Non-gnu programs: non-GNU applications.

The Linux kernel does not belong to the GNU Project, but is based on the GNU General Public License.

Linux distribution

Linux distributions are made up of the Linux kernel plus some software. Different combinations make up different distributions. Distributions typically include:

  • Linux kernel.
  • GNU packages.
  • Window management software, such as GNOME.
  • The document.

Popular distributions are: Debian, Fedora, Ubuntu, etc.

MacOS

MacOS, newly named Darwin, is a Unix-like operating system released by Apple with a kernel built on XNU, a hybrid development based on NeXTSTEP and FreeBSD. The architecture diagram is as follows:

Evolution of Unix and UniX-like systems

reference

  • POSIX
  • Single UNIX Specification
  • Linux