Linux 操作系统和内核之间有什么关系?

发布于 2024-09-12 23:44:16 字数 444 浏览 10 评论 0原文

我使用 Linux 已有好几年了,但从来没有超越过从 CD/DVD 安装的范围。如果应用程序管理器没有我在软件中寻找的东西,那么我就失败了。

但现在我正试图了解“Linux”是什么。

我脑海中浮现的第一个词是“内核”。阅读维基百科后,我了解到内核是运行的软件,旨在让其他软件(操作系统+应用程序)访问硬件(CPU、RAM+++)。它还处理内存,但这不是操作系统应该做的事情(我在操作系统类中记得的)?

Linux 发行版只是一个打包的软件列表吗?

以我最喜欢的发行版为例:Fedora。现在版本为 14,附带内核 2.6.35。

内核是否来自某个中心位置并且是每个 Linux 发行版的核心?如果这是真的,那么 Linux 发行版是否只是让带有内核的计算机更方便用户使用的一种方式?这样,发行版+内核就是操作系统,因为没有其中一个就无法使用(也许是纯内核,但谁坐在上面?)。

I've been using Linux for several years, but never stepped beyond installing from a CD/DVD. If the app manager didn't have what I was looking for in the software, then I was a lost cause.

But right now I'm trying to get a grip around what "Linux" is.

The first word that pops into my head is "kernel". After reading on Wikipedia, I understand that a kernel is software running to give other software (OS + apps) access to hardware (CPU, RAM+++). It also handles memory, but isn't that what the OS is supposed to do (what I remember from OS class)?

Is the Linux distro just a packed list of software?

Take my favorite distro: Fedora. It's now in version 14 and ships with kernel 2.6.35.

Does the kernel come from somewhere central and is the core of every Linux distro? If this is true, then is the Linux distro just a way of making the computer with the kernel more user-friendly to use? In that way, the distro+kernel is the OS because the one without the other is not usable (maybe pure kernel, but who sits on that?).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

从﹋此江山别 2024-09-19 23:44:16

非常正确。对我来说,“linux”只是内核。但将整个发行版称为 linux 是很常见的。这就是 RMS 如此恼火的原因。他坚持认为它应该被称为 GNU/Linux,因为他将发行版视为 Linux 内核加上 GNU 项目的附加软件。这也有道理,但我从不使用术语 GNU/Linux。我要么谈论 Linux 内核,要么谈论“Linux 发行版”,或者特定的发行版。

所以是的。发行版只是内核(可能包括特定于发行版的补丁)加上所有使其可用的额外程序。

内核是一个中心项目,名义上在每个发行版中都是相同的,但大多数发行版都会对其进行一些定制。

额外的软件不仅使内核更加用户友好,而且使其更加可用。内核只是中断处理程序、设备驱动程序和系统调用。它基本上虚拟化硬件并为程序运行提供标准环境。

就“操作系统”这个词而言,它可能会令人困惑。有些人可能会说内核就是操作系统,其他一切要么是实用程序,要么是应用程序,要么是其他东西。其他人可能会说内核加上一些其他软件包组成了操作系统,但大多数软件并不是操作系统的一部分。其他人可能会说发行版中的所有软件都是操作系统的一部分。

Pretty much correct. To me, "linux" is just the kernel. But it is pretty common to refer to entire distributions as linux. That is what annoys RMS so much. He maintains it should be called GNU/Linux, as he sees distributions as the linux kernel plus the additional software from the GNU project. This makes sense too but I never use the term GNU/Linux. I am either talking about the kernel linux, or "linux distributions", or a specific distribution.

So yes. A distribution is just the kernel (which may include distribution specific patches) plus all the extra programs that make it usable.

The kernel is a central project, and is nominally the same in each distro, but most distros customize it a bit.

And the extra software doesn't just make the kernel more user friendly, it makes it usable at all. A kernel is just interrupt handlers, device drivers, and system calls. It basically virtualizes the hardware and provides a standard environment for programs to work on.

As far as the phrase "operating system" goes, it can be confusing. Some people may say the kernel IS the operating system, and everything else is either a utility or an application or something else. Other people may say the kernel plus some other packages make up the operating system, but most of the software is not part of the operating system. Others may say all the software in the distro forms part of the operating system.

安人多梦 2024-09-19 23:44:16

Linux 是内核。这就是 Linus 所写的内容,也是内核开发人员今天继续致力于的工作。它控制硬件。

操作系统包括内核和一些较低级别的“应用程序”,允许您作为用户使用计算机执行有用的操作(例如文件管理器、控制面板等) 。

发行版(发行版)是一种操作系统,打包了绝对大量的高级应用程序(a),例如 DVD 创作工具、网络浏览器、办公套件等接近无限(b)

现在内核/操作系统甚至操作系统/发行版之间存在灰色区域,但我认为这是理解它如何结合在一起的一个公平的起点。


(a) 即使 Windows 在某种程度上也做到了这一点,包括写字板、计算器和画图,尽管还没有达到 Linux 发行版所扩展到的疯狂多产的水平 - 我们真的需要 472 个不同的文件管理器吗?选择是好的,是的,但仅限于一定程度:-)


(b) 是的,我知道“ad-near-infinitum”没有任何意义,因为从无限中减去任何有限的量仍然是无限的。但是,如果您想要数学准确性,您可能应该访问 https://math.stackexchange.com :-)

Linux is the kernel. That's what Linus wrote and that's what the kernel developers continue to work on today. It controls the hardware.

An operating system is something that includes a kernel plus quite a few lower-level "applications" to allow you as a user to do useful stuff with your computer (think file manager, control panel and so on).

A distro (distribution) is an operating system packaged with an absolute massive amount of higher-level applications(a) like DVD authoring tools, web browsers, office suites and so on ad-near-infinitum(b).

Now there are grey areas between kernel/OS and even OS/distro but I think that's a fair starting point for understanding how it hangs together.


(a) Even Windows does this to some extent, with the inclusion of Wordpad, Calculator and Paint, though not to the insanely prolific level that Linux distros extend to - do we really need 472 different file managers? Choice is good, yes, but only up to a point :-)


(b) Yes, I'm aware that "ad-near-infinitum" makes no sense since any finite amount subtracted from the infinite is still infinite. But, if you want mathematical accuracy, you should probably be over at https://math.stackexchange.com :-)

反差帅 2024-09-19 23:44:16

操作系统只是内核和外壳,它们协同工作。

Distro 是在内核上运行的定制 shell 的组合。例如,这意味着 Kali、Ubuntu、fedora、Mint 等是在 Linux 内核上运行的不同发行版。

Shell 充当用户和内核之间的接口。 Shell 可以是命令行界面或图形用户界面。 Bash、sh、Windows GUI 是一些 shell。

内核是操作系统的中心。它为程序分配时间和内存并处理文件存储等。

为了进一步解释 shell 和内核,假设您输入 cd。 shell 在文件存储中搜索包含程序 cd 的文件,然后通过系统调用请求内核在 myfile 上执行程序 cd。

举一个简单的例子 - Windows GUI 是一个 Shell,Windows OS 是 Microsoft 的发行版。

同样,Ubuntu OSfedora OS 等使用 Linux 内核在各种 shell 上运行的发行版。

Shell 或发行版并不使内核更易于使用,但它使其可供用户使用。

现在,您可以简单地说 Linux 是一个内核。
Linux + shell(Bash、Gnome 等)是一个 Linux 发行版,例如 Ubuntu、Mint、Kali 等,它们每个都是一个操作系统。

OS is just kernel and Shell which work hand in hand.

Distro is combination of customized shell(s) working on a kernel. This means, for examples - Kali, Ubuntu, fedora, Mint, etc. are different distros which work on Linux kernel.

Shell acts as an interface between the user and the kernel. Shell can be command line interface or Graphic user interface. Bash, sh, Windows GUI are some shells.

Kernel is hub of operating system. It allocates time and memory to programs and handles the filestore etc.

To further explain shell and Kernel suppose you type cd. The shell searches the filestore for the file containing the program cd, and then requests the kernel, through system calls, to execute the program cd on myfile.

To take a simple example - Windows GUI is a Shell, Windows OS a distribution by Microsoft.

Similarly, Ubuntu OS or fedora OS etc. a distro working on various shell using Linux kernel.

Shell or a distro does not make Kernel more user friendly to use but it makes it usable for user.

So now, simply you can say Linux is a kernel.
Linux + shell (Bash, Gnome etc.) is a Linux distro say Ubuntu, Mint, Kali etc. and each of them is a OS.

剩一世无双 2024-09-19 23:44:16

“kernel”和“shell”是原始术语,就像“core”和“shell”一样。 “Shell”是命令解释器。 “发行版”这个术语表示定制的 shell + 该发行版中包含的特定程序。不过,一个发行版可能有多个 shell。从用户的角度来看,这接近于人类语言的概念。是您必须与将与 shell 对话的终端对话的语言。 Shell 将读取它并在文件存储中查找文件(仍在 shell/发行版内)。一旦找到文件(可执行文件),shell 就会将其发送到执行工作(进程)的内核。想象一下一辆汽车,多年来其发动机基本保持不变,但会改变其车架/车身。我想我需要在这里停下来......

"kernel" and "shell" are the original terms, as in let's say "core" and "shell". "Shell" is the command interpreter. "Distro" is a term that means a customized shell(s) + specific programs included in that distribution. One distribution might several shells though. From a user perspective this is close to the concept of human language. Is the language that you have to talk to the terminal which will talk to shell. Shell will read it and look for a file within the filestore (still inside the shell/ distro). Once the file (executable) is found, shell sends this to the kernel which does the job (process). Think of a car which will have the same basically unmodified engine over many years but will change its frame/ body. I think I need to stop here...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文