Are macOS and Linux completely different?

"What is Docker? I'll explain it carefully. " I'm writing now.

https://qiita.com/SatoshiSobue/items/a612ebbb3a9242c09db5

macOS and Linux (Linux in a broad sense) are completely different in the upper layer It's not an exaggeration to say, but it's the lower layer At the kernel level, the OS architecture is UNIX. Is it close to the pedigree with layers implemented according to the rules? The OS.

XNU kernel for macOS is Carnegie Mellon University Derived from the mach microkernel developed in The kernel.

The XNU kernel is based on FreeBSD code It has an implemented BSD layer. (The BSD layer of the XNU kernel is the Linux kernel There is a part that adopts the API of. )

macOS uses the BSD layer of the XNU kernel A UNIX compatible OS that conforms to the UNIX specifications, and It has become.

The Linux kernel (Linux in the narrow sense) is POSIX compliant and Implemented according to the UNIX specification, to the UNIX specification It is a UNIX compatible OS that is almost compliant.

(The Open Group, which manages UNIX specifications You can't call yourself UNIX unless you're authenticated by It can be said that it conforms to the UNIX specifications (write) not.

UNIX authentication is expensive. OSS Linux development side is expensive UNIX authentication I didn't feel the need and I still You won't feel it. )

UNIX compatibility layer becomes a core feature of the kernel on Linux Built-in and inseparable, macOS XNU In the kernel, it is separate from the core functionality of the kernel, Both have UNIX compatible layers, although they are different. is.

In the terminal on macOS, shell such as bash Youth using the features of the BSD layer through In the case, you can feel the difference from Linux Almost none.

Both are compatible at the native code level Although none at all, in implementation on macOS BSD layer APIs compatible with Linux Or the difference between the two running on both A type that uses a library to absorb If it's a program, it's a native app Even achieving compatibility at the source code level Is possible.

macOS wraps it with Core Foundation (C) Foundation (Objective-C, migrate to Swift) Have a library called Plan?) On top of it Implemented libraries of AppKit, Mac Catalyst etc It has been.

These libraries and their implementation Tools make macOS macOS, It's completely different from Linux.

Bonus

Windows and Linux, from the top to the bottom It's a completely different thing, there is no compatibility anywhere.

How to run Linux apps on Windows There is WSL.

WSL1 makes Linux kernel system calls Replaced with Windows kernel system calls It was a rough implementation to execute, In WSL2, lightweight virtual installed in Windows 10 Customize on a virtual machine with a machine Changed to run the Linux kernel is.

Recommended Posts

Are macOS and Linux completely different?
Python a + = b and a = a + b are different
numpy's matrix and mat are different
yum and apt update / upgrade are different
What are Linux POSIX options and GNU options?
OS and Linux distribution
The VIF calculated by Python and the VIF calculated by Excel are different .. ??
Linux: files and directories
Studying Linux commands and frustration
CLI and Linux basic terms
Linux (about files and directories)
Device and Linux file system
About LINUX files and processes
What are environment variables? (Linux)
Recording and playback on Linux
Linux file and directory permissions
[Work memo] Until matplotlib and numpy are installed in Amazon Linux
[sed] Use sed to replace tab characters on both macOS and Linux
What are the directories such as Linux, / etc and / var / log?