OS 学习笔记(7) 虚拟机

OS 学习笔记(7) 虚拟机

这篇笔记对应的王道OS 1.6 虚拟机,同时参考了 《Operating System Concepts, Ninth Edition》和 俗称ostep的《 Operating Systems: Three Easy Pieces》还有 《Operating Systems: Principles and Practice》

文章目录

  • OS 学习笔记(7) 虚拟机
  • 什么是虚拟机
  • 第一类虚拟机管理程序
  • 第二类虚拟机管理程序
  • 两类VVM的对比
  • 英文表达、术语积累(《操作系统概念》第九版、ostep 《OPERATING SYSTEMS THREE EASY PIECES》、《Operating Systems: Principles and Practice》)

什么是虚拟机

  • 虚拟机是一台逻辑计算机,是指利用特殊的虚拟化技术,通过隐藏特定计算平台的实际物理特性,为用户提供抽象的、统一的、模拟的计算环境。
  • 虚拟机:使用虚拟化技术,将一台物理机器虚拟化为多台虚拟机器(Virtual Machine,VM),每个虚拟机器都
    可以独立运行一个操作系统
  • 同义术语:虚拟机管理程序/虚拟机监控程序/Virtual MachineMonitor(VMM) /Hypervisor

第一类虚拟机管理程序

OS 学习笔记(7) 虚拟机_第1张图片

第二类虚拟机管理程序

OS 学习笔记(7) 虚拟机_第2张图片

两类VVM的对比

《操作系统概念》9ed上面chap16 讲了 3种 vmm,我没有细看.

第一类VMM 第二类VMM
对物理资源的控制权 直接运行在硬件之上,
能直接控制和分配物理资源
运行在Host OS之上,
依赖于Host OS为其分配物理资源
资源分配方式 在安装Guest OS时,VMM要在原本的硬盘上自 行分配存储空间,类似于"外核"的分配方式,分I 配未经抽象的物理硬件 GuestOS拥有自己的虚拟磁盘,
该盘实际上是 Host OS文件系统中的一个大文件。GuestOS分 配到的内存是虚拟内存
性能 性能更好 性能更差,需要HostOS作为"中介"
可支持的虚拟机数量 更多,不需要和Host OS竞争资源,相同的硬件 资源可以支持更多的虚拟机 更少,Host OS本身需要使用物理资源,
Host OS上运行的其他进程也需要物理资源
虚拟机的可迁移性 更差 更好,只需导出虚拟机镜像文件即可迁移到另一 台 HostOS上,商业化应用更广泛
运行模式 第一类VMM运行在最高特权级(Ring 0),可以 执行最高特权的指令。 第二类VMM部分运行在用户态、部分运行在内核 态。
GuestOS发出的系统调用会被VMM截获, 并转化为VMM对HostOS的系统调用

英文表达、术语积累(《操作系统概念》第九版、ostep 《OPERATING SYSTEMS THREE EASY PIECES》、《Operating Systems: Principles and Practice》)

  • permeate

    • The term virtualization has many meanings, and aspects of virtualization permeate(渗透) all aspects of computing. Virtual machines are one instance of this trend.
  • delve into sth 深入探索;探究

    • This chapter delves into the uses, features, and implementation of virtual machines.
  • pertinent 有关的;恰当的;相宜的

    • One option is to add virtual machine support to the kernel. Because that implementation method is the most pertinent to this book, we explore it most fully. Additionally, hardware features provided by the CPU and even by I/O devices can support virtual machine implementation, so we discuss how those features are used by the appropriate kernel modules.
  • illusion n. 错觉;幻想;错误的观念;幻想的事物

    • The fundamental idea behind a virtual machine is to abstract the hardware of a single computer (the CPU, memory, disk drives, network interface cards, and so forth) into several different

      and so forth 等等

      forth **adv.**向前;离去;外出;向某处 **prep.**来自

      execution environments, thereby creating the illusion that each separate environment is running on its own private computer. This concept may seem similar to the layered approach of operating system implementation (see Section 2.7.2), and in some ways it is. In the case of virtualization, there is a layer that creates a virtual system on which operating systems or applications can run.

  • paravirtualization 半虚拟化

  • blur

    • v(使)变得模糊不清;(使)视线模糊;(使)看不清;(使)难以区分
    • n(移动的)模糊形状;模糊的记忆

    Take a moment to note that with virtualization, the definition of “operating system” once again blurs. For example, consider VMM software such as VMware ESX. This virtualization software is installed on the hardware, runs when the hardware boots, and provides services to applications. The services include traditional ones, such as scheduling and memory management, along with new types, such as migration of applications between systems. Furthermore, the applications are in fact guest operating systems. Is the VMware ESX VMM an operating system that, in turn, runs other operating systems? Certainly it acts like an operating system. For clarity, however, we call the component that provides virtual environments a VMM.

  • indirection 间接性;间接取值;间接层

    ​ “All problems in computer science can be solved by another level of indirection”—David Wheeler “. . . except for the problem of too many layers of indirection.”—Kevlin Henney


  • 突然好奇 VMware能否套娃
    • 虚拟机中运行虚拟机中运行虚拟机……如此循环能运行多少个? - 冯若航的回答 - 知乎 https://www.zhihu.com/question/20145026/answer/34461631

你可能感兴趣的:(操作系统,虚拟机,操作系统)