macOS 和 Linux 的内核有什么区别
内核 macOS
有些人可能会认为 macOS 和 Linux 内核之间存在相似之处，因为它们可以处理类似的命令和类似的软件。有些人甚至认为苹果公司的 macOS 是基于 Linux 的。事实上是，两个内核有着截然不同的历史和特征。今天，我们来看看 macOS 和 Linux 的内核之间的区别。


![macOS vs Linux](/data/attachment/album/201807/20/001525dgb53g13bxb4vgbz.jpg)


### macOS 内核的历史


我们将从 macOS 内核的历史开始。1985 年，由于与首席执行官 John Sculley 和董事会不和，<ruby> 史蒂夫·乔布斯 <rt>  Steve Jobs </rt></ruby>离开了苹果公司。然后，他成立了一家名为 [NeXT](https://en.wikipedia.org/wiki/NeXT) 的新电脑公司。乔布斯希望将一款（带有新操作系统的）新计算机快速推向市场。为了节省时间，NeXT 团队使用了卡耐基梅隆大学的 [Mach 内核](https://en.wikipedia.org/wiki/Mach_(kernel)) 和部分 BSD 代码库来创建 [NeXTSTEP 操作系统](https://en.wikipedia.org/wiki/NeXTSTEP)。


NeXT 从来没有取得过财务上的成功，部分归因于乔布斯花钱的习惯，就像他还在苹果公司一样。与此同时，苹果公司曾多次试图更新其操作系统，甚至与 IBM 合作，但从未成功。1997年，苹果公司以 4.29 亿美元收购了 NeXT。作为交易的一部分，史蒂夫·乔布斯回到了苹果公司，同时 NeXTSTEP 成为了 macOS 和 iOS 的基础。


### Linux 内核的历史


与 macOS 内核不同，Linux 的创建并非源于商业尝试。相反，它是由[芬兰计算机科学专业学生<ruby> 林纳斯·托瓦兹 <rt>  Linus Torvalds </rt></ruby>于 1991 年创建的](https://www.cs.cmu.edu/%7Eawb/linux.history.html)。最初，内核是按照林纳斯自己的计算机的规格编写的，因为他想利用其新的 80386 处理器（的特性）。林纳斯[于 1991 年 8 月在 Usenet 上](https://groups.google.com/forum/#!original/comp.os.minix/dlNtH7RRrGA/SwRavCzVE7gJ)发布了他的新内核代码。很快，他就收到了来自世界各地的代码和功能建议。次年，Orest Zborowski 将 X Window 系统移植到 Linux，使其能够支持图形用户界面。


在过去的 27 年中，Linux 已经慢慢成长并增加了不少功能。这不再是一个学生的小型项目。现在它运行在[世界上](https://www.zdnet.com/article/sorry-windows-android-is-now-the-most-popular-end-user-operating-system/)大多数的[计算设备](https://www.linuxinsider.com/story/31855.html)和[超级计算机](https://itsfoss.com/linux-supercomputers-2017/)上。不错！


### macOS 内核的特性


macOS 内核被官方称为 XNU。这个[首字母缩写词](https://github.com/apple/darwin-xnu)代表“XNU is Not Unix”。根据 [苹果公司的 Github 页面](https://github.com/apple/darwin-xnu)，XNU 是“将卡耐基梅隆大学开发的 Mach 内核和 FreeBSD 组件整合而成的混合内核，加上用于编写驱动程序的 C++ API”。代码的 BSD 子系统部分[“在微内核系统中通常实现为用户空间的服务”](http://osxbook.com/book/bonus/ancient/whatismacosx/arch_xnu.html)。Mach 部分负责底层工作，例如多任务、内存保护、虚拟内存管理、内核调试支持和控制台 I/O。


### Linux 内核的特性


虽然 macOS 内核结合了微内核（[Mach](https://en.wikipedia.org/wiki/Mach_(kernel)）和宏内核（[BSD](https://en.wikipedia.org/wiki/FreeBSD)）的特性，但 Linux 只是一个宏内核。[宏内核](https://www.howtogeek.com/howto/31632/what-is-the-linux-kernel-and-what-does-it-do/)负责管理 CPU、内存、进程间通信、设备驱动程序、文件系统和系统服务调用（ LCTT 译注：原文为 system server calls，但结合 Linux 内核的构成，译者认为这里翻译成系统服务调用更合适，即 system service calls）。


### 用一句话总结 Linux 和 Mac 的区别


macOS 内核（XNU）比 Linux 历史更悠久，并且基于两个更古老一些的代码库的结合；另一方面，Linux 新一些，是从头开始编写的，并且在更多设备上使用。


如果您发现这篇文章很有趣，请花一点时间在社交媒体，黑客新闻或 [Reddit](http://reddit.com/r/linuxusersgroup) 上分享。




---


via: <https://itsfoss.com/mac-linux-difference/>


作者：[John Paul](https://itsfoss.com/author/john/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[stephenxs](https://github.com/stephenxs) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

We often [compare Linux with Windows](https://itsfoss.com/linux-better-than-windows/), but what about comparing it with macOS?

While the differences between Linux and Windows are quite obvious, Linux and macOS may seem similar to many.

Both can run Unix commands in the terminal, and the user experience is vastly different from Windows. And not all Windows applications and games are available for macOS and Linux.

This is why some people even think Apple’s macOS is based on Linux. But that is not the case. macOS is not Linux despite the similarities.

There are plenty of differences between the two UNIX-like operating systems and I shall highlight both the similarities and the differences in this article.

So, let’s compare Apple and ~~Orange~~ Penguin.

## macOS vs. Linux: Origins

macOS has a fascinating history. The foundation of it was built by Steve Jobs’s NeXT computer company when he wasn’t at Apple. Technically, it was based on the [Mach Kernel](https://en.wikipedia.org/wiki/Mach_(kernel)?ref=itsfoss.com) and the UNIX-derived BSD.

Back then, a [NeXTSTEP](https://en.wikipedia.org/wiki/NeXTSTEP?ref=itsfoss.com) operating system was created to power the devices/computers built by ** NeXT**. While it got some attention, it wasn’t a big success. Apple later acquired NeXT and brought back Steve onboard as part of the deal, making NeXTSTEP OS the base for macOS.

This is why macOS has a combination of Unix components along with Apple’s proprietary technologies.

** On the contrary**, Linux (the kernel) was built as a free and open-source replacement for Unix.

Linux is not an operating system but needs different components like [desktop environments](https://itsfoss.com/what-is-desktop-environment/) to form an operating system. There are hundreds of Linux-based operating systems called ** distributions**.

For simplicity, we tend to address it as ** Linux** OS instead of a specific Linux distribution.

** Recommended Read **📖

[What is Linux? Why There are 100’s of Linux OS?Cannot figure out what is Linux and why there are so many of Linux? This analogy explains things in a simpler manner.](https://itsfoss.com/what-is-linux/)![](https://itsfoss.com/content/images/wordpress/2020/03/too-many-linux-choices.png)


![](https://itsfoss.com/content/images/wordpress/2020/03/too-many-linux-choices.png)

## macOS kernel vs Linux kernel

The macOS kernel is officially known as XNU. The [acronym](https://github.com/apple/darwin-xnu?ref=itsfoss.com) stands for “XNU is Not Unix.” According to [Apple’s GitHub page](https://github.com/apple/darwin-xnu?ref=itsfoss.com):

"XNU is a hybrid kernel combining the Mach kernel developed at Carnegie Mellon University with components from FreeBSD and C++ API for writing drivers”.

The BSD subsystem part of the code is [“typically implemented as user-space servers in microkernel systems”](http://osxbook.com/book/bonus/ancient/whatismacosx/arch_xnu.html?ref=itsfoss.com). The Mach part is responsible for low-level work, such as multitasking, protected memory, virtual memory management, kernel debugging support, and console I/O.

While the macOS kernel combines the feature of a microkernel ([Mach](https://en.wikipedia.org/wiki/Mach_(kernel)?ref=itsfoss.com)) and a monolithic kernel ([BSD](https://en.wikipedia.org/wiki/FreeBSD?ref=itsfoss.com)), Linux is solely a monolithic kernel. A [monolithic kernel](https://www.howtogeek.com/howto/31632/what-is-the-linux-kernel-and-what-does-it-do/?ref=itsfoss.com) is responsible for managing the CPU, memory, inter-process communication, device drivers, file system, and system server calls.

## Here’s What They Have in Common

macOS utilizes Unix components, and Linux was built as an alternative to Unix. So, what do we have in common here?

Both give access to ** Unix commands, Bash/Zsh, and other shells**.

The [default shell](https://linuxhandbook.com/change-shell-linux/?ref=itsfoss.com) can be different, but you can always change it as per your preferences.

That’s about it. I can’t think of anything else similar between the two.

Probably a decade back, we could say that both Linux/macOS offered fewer applications.

But that’s not the case anymore.

The software ecosystem and game support for both have evolved over the years, which we will discuss later in this article.

## Codebase: Proprietary vs. Open-Source

![open source proprietary illustration](https://itsfoss.com/content/images/wordpress/2022/08/open-source-proprietary-illustration.jpg)

macOS is a proprietary operating system, meaning you cannot view the complete operating system’s source code.

Sure, you have [part of the macOS (mostly GNU) libraries’ source code available](https://opensource.apple.com/releases/?ref=itsfoss.com). There is also the [XNU kernel code](https://github.com/apple/darwin-xnu?ref=itsfoss.com) used in the development of macOS and iOS operating systems. But [you cannot just take this code and build a macOS clone](https://www.techrepublic.com/article/why-apple-open-sourcing-mac-os-x-isnt-terribly-exciting/?ref=itsfoss.com) to be installed on any hardware.

It’s not the end of the world without the source code, but you get ** less transparency** on Apple’s claims and practices to secure and enhance your computer experience.

Some might argue that proprietary code remains hidden for security reasons. However, both proprietary and open-source software remain vulnerable to threats.

** The difference between them** is: open-source software often gets fixed sooner because of community participation by several developers, compared to limited employees working on macOS.

Unless you trust Apple without questions, Linux’s open-source model gets an edge.

## Purpose and Usage: macOS vs. Linux

macOS is tailored for desktop and laptop usage. It is well-suited for ** video editing, graphics designing, and audio editing**.

When it comes to Linux, you get a host of possibilities. You can use Linux for:

- Desktop
- Toaster (yes! I hope you know about
[IoT](https://www.ibm.com/blogs/internet-of-things/what-is-the-iot/?ref=itsfoss.com)) - Single Board Computers
- Server

Of course, it is not the same experience when using it on various platforms, but Linux can run for various use cases.

So, if you like Linux, you can choose to continue using it on other platforms for a comfortable experience.

## macOS vs Linux: User Experience

When it comes to user experience, it comes down to personal preferences.

macOS offers a ** pleasing user interface**. It is visually appealing with subtle animations and high-resolution wallpapers/icons.

![macos monterey screenshot](https://itsfoss.com/content/images/wordpress/2022/08/macos-monterey-screenshot.jpg)

You can expect an easy and seamless experience across the platform.

With Linux, you can get an equally pleasing user interface that is easy to use.

![zorin os 16 mac](https://itsfoss.com/content/images/wordpress/2021/12/zorin-os-16-mac.png)

** Unfortunately**, the user experience slightly varies because of the distribution you decide to install and the desktop environment it comes along with.

You can explore some of the [best desktop environments](https://itsfoss.com/best-linux-desktop-environments/) listed. You can even opt for [macOS-like Linux distributions](https://itsfoss.com/macos-like-linux-distros/).

For instance, if you are using ** Pop!_OS, Ubuntu, Zorin OS, or elementary OS**, you could have an excellent user experience.

![pop os screenshot 2022](https://itsfoss.com/content/images/wordpress/2022/08/pop-os-screenshot-2022.png)

If you end up using something like MX Linux, or different, the user experience may not be comparable to macOS.

![Screenshot of MX Linux](https://itsfoss.com/content/images/wordpress/2022/07/10.-MX-Linux.jpg)

Overall, the out-of-the-box experience with Linux is inconsistent, but it is capable enough if you know what you are doing.

And if you are coming from Windows, the interface could be confusing initially.

## Customizability

![customizability illustration](https://itsfoss.com/content/images/wordpress/2022/08/customizability-illustration.jpg)

If you want an operating system that lets you tinker with every aspect of it, macOS is not for you.

While Apple’s designs could be aesthetically pleasing by default, not everyone likes them.

If you want to personalize, take control, and heavily customize the operating system’s nuts and bolts, Linux should be the perfect pick.

You can choose to customize the user interface as much as you want, with a wide range of different elements, and go wild with your preferences. To get started, look at our [KDE customization](https://itsfoss.com/kde-customization/) guide to explore the possibilities.

While that is good, it could backfire when customizing things on a Linux system. So, you need to learn/explore what you want to customize.

## Hardware Requirements to Run macOS vs Linux

![hardware illustration](https://itsfoss.com/content/images/wordpress/2022/08/hardware-illustration-800x450.jpg)

This is where macOS suffers a solid defeat.

If you want access to macOS and have a good experience with it, you need to purchase Apple hardware, which is costly.

For example, the base configurations for macOS-powered laptops start with ** 8 GB of RAM** and

**, available for**

**256 GB of storage****or more.**

**$1200**Unless you want to constantly use the swap space for multitasking and already have a cloud storage space, it would be a terrible idea to get one for yourself.

In contrast, if you would rather not spend a lot but still want a decent configuration for your system (PC/laptop), it is easy to get a device with 16 GB RAM + 512 GB SSD to run Linux for around 800 USD.

**: I’m used to 32 Gigs of RAM + 500 GB of SSD storage. To get that kind of multitasking headroom (without using the swap), I will have to pay a premium to Apple.**

**A personal note**Some skilled tinkerers try running macOS on non-Apple hardware. Such a system is called [Hackintosh](https://www.freecodecamp.org/news/build-a-hackintosh/?ref=itsfoss.com) but it is certainly nowhere close to the comfort of running Linux on a regular computer.

## Software Ecosystem

macOS offers a ** top-notch native experience** with macOS-exclusive applications or tools made by Apple.

Yes, you may have to purchase those applications. However, unlike some subscription options, you get one-time purchase alternatives with macOS for professional applications.

![final cut pro mac](https://itsfoss.com/content/images/wordpress/2022/08/final-cut-pro-mac.jpg)

For users who want to design, edit videos, edit photos, and have a creative workflow, macOS’s software suite should be a great choice if you do not mind investing in it.

The free Apple tools like iMovie, Keynote, etc. are good. Couple them with premium tools like Final Cut Pro, Affinity Designer, and more and you get world-class editing experience. Not to forget that creative tools like Adobe are also available on macOS.

Additionally, Apple has strict guidelines for applications available for its platform that enhance the native experience with third-party apps (free or paid).

This is why many designers and editors prefer using macOS over any other operating system.

For the Linux platform, you have ** great FOSS alternatives** to some macOS-only apps. Unless you like or have experience with macOS-specific applications, you should not have trouble with software available for Linux.

![kdenlive editor interface](https://itsfoss.com/content/images/wordpress/2022/08/kdenlive-editor.jpg)

The native app experience depends on the Linux distribution you use.

![planner board view](https://itsfoss.com/content/images/wordpress/2021/08/planner-board-view.png)

It may not be as seamless as macOS, but if you are not a professional-grade video/graphics editor, you should not have any issues.

## Gaming on Linux and macOS

![gaming illustration](https://itsfoss.com/content/images/wordpress/2022/08/gaming-illustration.jpg)

While Apple’s making good progress on making its new M1/M2 chips as capable as possible, macOS currently has poor support for games.

A handful of games work, and most aren’t supported officially. To be honest, investing in a Mac for gaming is not what it is for.

Regarding Linux, numerous AAA games and Indie titles work fine. Sure, there are some hiccups with certain games. But, with Valve’s push towards official game support for Steam Deck, even the latest releases like “** Spider-Man: Remastered**” are Steam Deck verified.

Ultimately, helping improve the game support for the Linux platform.

Additionally, considering that the PC graphics card market is almost back to normal (near or below MSRP), you can get a sweet PC build or laptop without worrying about performance bottlenecks.

Would you spend upwards of ** $1800 for a Mac with 16 GB of RAM and 512 GB of SSD** or get a PC/laptop with 32 GB RAM (or more), and at least 1 TB SSD (or more)?

That’s your call.

## Package Manager

![package manager illustration new](https://itsfoss.com/content/images/wordpress/2022/08/package-manager-illustration-new.jpg)

A package manager helps you quickly find, install, and remove software in your operating system.

Linux has been the superior force in package management compared to anything out there.

You get options like [Flatpak](https://itsfoss.com/what-is-flatpak/), [Snap](https://itsfoss.com/use-snap-packages-ubuntu-16-04/), [Synaptic](https://itsfoss.com/synaptic-package-manager/), and more out of the box.

But, Mac users do not have anything to rely on by default. Fortunately, an option like [Homebrew](https://itsfoss.com/homebrew-linux/) makes life easier for macOS users. Since it also supports Linux, you can use it across multiple devices to make things easy.

There's also a __dedicated tutorial for Homebrew__, which you can check out:

[Installing and Using Homebrew Package Manager on LinuxHomebrew, also known as Brew, is a command line package manager primarily created for macOS. Homebrew grew quite popular among macOS users as more developers created command line tools that could be easily installed with Homebrew. This popularity resulted in the creation of Linuxbrew, a Li…](https://itsfoss.com/homebrew-linux/)![](https://itsfoss.com/content/images/wordpress/2021/11/homebrew-linux.png)


![](https://itsfoss.com/content/images/wordpress/2021/11/homebrew-linux.png)

## Operating System Updates

![software update illustration](https://itsfoss.com/content/images/wordpress/2022/07/software-update-illustration.jpg)

Apple does not share specific timelines for software updates to the operating system.

For instance, ** macOS Ventura** (the upcoming version upgrade at the time of writing) suddenly ditched all Mac devices before 2017.

Interestingly, the previous operating system versions had average support for about ** seven years**, but with newer changes, it seems to be about

**now.**

**five**With Apple silicons, it may not be a straightforward answer. But, it is safe to assume at least 4-5 years of software support.

Linux gives you options. If you want a stable operating system without feature upgrades but focused on maintenance and security, [LTS editions](https://itsfoss.com/long-term-support-lts/) of Linux distributions give you up to ** five years** of updates for free. This is primarily true for

[Ubuntu](https://itsfoss.com/getting-started-with-ubuntu/)or Ubuntu-based distributions like Linux Mint.

Furthermore, there’s a subscription plan for Ubuntu, where you can continue receiving security updates for up to ** 10 years**.

And, it does not end there; you can also opt for [rolling-release distributions](https://itsfoss.com/best-rolling-release-distros/) that get constant bleeding-edge updates with no timeline for an end. As long as your hardware is competent enough, you should be able to update the operating system with no issues.

## macOS vs. Linux: What Should You Pick?

macOS can be well worth the price tag if you need it.

It is not an easy recommendation for users who just need to surf the web, send emails, and perform some tasks that are possible on any platform.

macOS remains a niche pick.

However, Linux has improved to become a usable choice for former Windows/macOS users, computer science students, developers, creative professionals (like us) and a wide range of potential users.

Here are some funny jokes that compare the three operating system giants:

[Windows Vs Mac Vs Linux: 10 Funny Jokes In PicturesThe Windows Vs Mac Vs Linux debate continues. Their fans continue to be at the each others throat. The baseline of most debate is that Windows is clumsy and full of security issues, Linux is complicated and not user-friendly and Mac is all looks that burns your money for each](https://itsfoss.com/10-funny-jokes-pictures-windows-mac-linux/)![](https://itsfoss.com/content/images/wordpress/2013/07/Windows-Mac-Linux.png)


![](https://itsfoss.com/content/images/wordpress/2013/07/Windows-Mac-Linux.png)

There are many reasons to pick Linux over macOS, but not the other way around (I think). Just like this, we have also compared Linux with Windows:

[11 Reasons Why Linux is Better Than WindowsAre you wondering if Linux is better than Windows? Don’t wonder. Linux is better than Windows and in this article, we’ll see the advantages of Linux over Windows.](https://itsfoss.com/linux-better-than-windows/)![](https://itsfoss.com/content/images/wordpress/2016/12/Why-Linusx-is-better-than-Windows-1.jpg)


![](https://itsfoss.com/content/images/wordpress/2016/12/Why-Linusx-is-better-than-Windows-1.jpg)

What are your thoughts on macOS vs. Linux? You are welcome to share your thoughts in the comments down below.