gpt4 book ai didi

kernel - 托管内核和虚拟机之间的差异

转载 作者:行者123 更新时间:2023-12-04 12:59:13 26 4
gpt4 key购买 nike

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












想改进这个问题?将问题更新为 on-topic对于堆栈溢出。

3年前关闭。




Improve this question




我一直在阅读 AROS,尤其是托管版本。 AROS 说如下。

kernel.resource contains AROS microkernel. It's the lowest level component,
which is responsible for handling CPU and motherboard. For
hosted ports kernel.resource contains a virtual machine.


根据我对虚拟机的了解,有两种类型的系统虚拟机和进程虚拟机。我知道 AROS 不是系统虚拟机,但所有进程虚拟机都与 Java JVM、Mono、Python、Ruby 等类似。它们都是特定于语言的。 AROS 似乎是一个在用户模式下运行的完整系统/平台,类​​似于用户模式 ​​Linux。

AROS-hosted: An Operating System in an Operating System?

AROS is originally developed on Linux running on an Intel-based computer. It runs on many more machines and operating systems, though. This may sound strange: an OS running on top of an other OS, that's emulation, right?

A nice term for what AROS-hosted does is "API emulation". API is a three-letter acronym for Application Programmer's Interface. In plain English: an API provides (C Language) functions that a programmer can use. The AmigaOS API consists of a load of library calls that an Amiga programmer can use to make an Amiga program. AROS emulates the AmigaOS API: it tries to provide the same library calls as AmigaOS. An Amiga emulator, such as UAE; emulates the Amiga computer: the processor, the connected hardware, everything. This has its advantages, like being able to play binary Amiga games on different hardware, and its disadvantages, like not being able to use the emulator as a "real" OS, on a "real" processor. AROS-hosted runs on the "real" processor. But it isn't a "real" OS, unless you run in such a way that it doesn't require Linux. This is called "native" AROS.

AROS can run natively on the Intel and Amiga computers, but not quite as well as it runs on Linux. AROS library functions are made to run under Linux first, internally using Linux kernel and library calls. This way a programmer has the opportunity to bother about the implementation of the whole system first, and to bother about the technical details in a later stadium. People are currently working on making the "native" AROS more usable. The results are very impressive and it is perfectly possible to use AROS-native as a real (and only) Operating system on an IBM PC compatible machine.

Of course, AROS is not only an API emulator. It also tries to provide replacements to all the AmigaOS 3.1 system software, and you will also find a few demo's and games being shipped with AROS, just to show that they work - we might just be at 77% of the whole system, but we already have Quake running!



从这些信息中,我觉得 AROS kernel.resource 在用作虚拟机时只是简单地包装了 Linux 内核的系统调用接口(interface)?还是我错过了什么

另外还有像AROS这样的系统吗?

我想做这样的东西,可以在许多操作系统上托管。

最佳答案

(编者注:这个问题征求意见,因为我固执己见......):

内核架构的分类不像物种甚至头发颜色那样严格。像(微|单片|虚拟)内核这样的术语比分类分区更模糊的描述。这有助于将啤酒卖给有争议的极客。

所有内核都呈现某种虚拟机。在 UNIX 中,它通常是用户模式指令集 + 解释一组系统调用以执行各种操作 + 一些 CPU 作为线程。这个抽象机器可以强制执行其他规则,例如内存类型(堆栈、堆、文本)的位置和范围。在虚拟化内核中,它通常是整个指令集、一组 CPU、内存和设备。在大多数情况下,对内存的访问由虚拟化内核(常见:管理程序)仲裁,设备通过解释对它的访问在管理程序内实现,系统指令由管理程序模拟。

但是这两个(UNIX,管理程序)都呈现虚拟机,只是具有不同的抽象。 UNIX 虚拟机可能具有优先级的概念,即进程确定它应该或多或少地优先使用 CPU 或内存资源;而纯虚拟计算机(管理程序)将无法传达这样的概念。

不管环境如何,在我的执行单元(进程、虚拟机)中,我可能会选择制定我自己的线程、进程、设备和交互的运行时概念。 gvisor 项目提供了这个概念的相当完整的实现,但即使是 golang 运行时也将 golang 程序与底层内核分离。对于倾向于将内核视为特权共享库的 C 程序员来说,这是一个相当陌生的概念。

所以,是的,您可以在内核下运行内核,直到满足您的心愿。使用 linux 很有趣,如果你在周围搜索一下,你可以弄清楚如何构建一个使用 qemu-* 作为加载器的容器,这样你的分区就可以在 x86 机器上运行 arm bash 并无缝运行 arm 和 x86 二进制文件。当你向他们展示这个时,你的 friend 会取笑你。

实际问题:

..还是我错过了什么..? AROS 可以将自己嵌套在 Linux 环境中,不会将 Linux 环境泄露给它的客人。在这种模式下运行内核通常称为托管。请参阅 gvisor 示例,了解您可以如何做到这一点,甚至无需成为 root。

有没有其他类似 AROS 的系统?无数。

关于kernel - 托管内核和虚拟机之间的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13226693/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com