kernelhypervisormicrokernel

Difference/relationship between Kernel/Microkernel/Hypervisor


I am a newbie on this topic. I have been surfing the web looking for information about the topic and, now, I am also more confused. If I am not wrong they manage the hardware and create a connection between the user-space and the real physical part of the device (please correct me if it is not so). But which is the real difference between one and another? How can I classify them? What I am looking for is a clear answer that can drive me on right reference to understand better and study deeply the field.


Solution

  • The following is probably not 100% accurate from an academic point of view but I believe captures the essence of it:

    Kernel - a program whose purpose is control and multiplexing of hardware for the benefit of other programs. Typically runs at the highest privileged mode of operation of the CPU. The innermost component of an operating system.

    Two example tasks for a kernel are (1) scheduling, that is allowing different programs to share the CPU, each being guaranteed of a (more or less) fair share of the CPU and (2) provide a file systems, which allows a different program to access storage devices, such as a disk.

    A prime example of a kernel is Linux.

    Micro-kernel - a specific architecture for building a kernel, wherein a modular approach is taken to segment the kernel program into a set of isolated and replaceable code modules. The design allows running some of the functions normally associated with a kernel in a lower privilege level.

    To re-use the same example as before, the micro-kernel would still handle scheduling, but file systems and disk access, in general, would be implemented as a program, running with lower privileges than the micro-kernel itself, which other programs connect to using a client/server methodology to get access to disk resources.

    The prime example for a micro-kernel is the GNU Hurd.

    Hypervisor - a program whose purpose is control and multiplexing of hardware for other kernels. Typically runs at an even higher privileged level than a kernel, which was invented for this purpose. Allows sharing a single hardware between multiple operating systems or instances thereof. Where hypervisors differ from kernels is their interface - kernel expose a system call programming interface, such as POSIX, while the hypervisor interface (as in what the OS running as a guest observes) mainly looks as simply a "naked" CPU and hardware, with optional deviations of this principle possible for the sake of performance in the shape of para-virtualization.

    If we again take our example services from above, scheduling within a hypervisor is not different than in essence from a kernel (except the scheduled entities are OS virtual CPU and not singular programs) but a hypervisor will not typically expose a file system interface at all, instead exposing what looks like a raw storage device, such as disk to the guest OS it controls.

    A good example of a hypervisor is KVM, which is interesting in that it is a hypervisor which is built into a kernel (the kernel being Linux).