
Simple KVM Firmware in Rust - adamnemecek
https://github.com/intel/rust-hypervisor-firmware
======
thenewwazoo
This is great, and even includes what looks like a complete FAT32
implementation[1]. I bet this could be broken up into a number of separate,
publishable crates, if the interfaces are clean enough (read: use traits).

[1] [https://github.com/intel/rust-hypervisor-
firmware/blob/maste...](https://github.com/intel/rust-hypervisor-
firmware/blob/master/src/fat.rs)

~~~
xiphias2
From the source code it looks like the implementation is read-only though,
writing to a file system efficiently is much harder (but not needed for a boot
loader)

------
akavel
Could someone please ELI5 this to me? It's not clear to me what KVM even is?
how does this new thing fit into a PC boot process and what it does? Why is it
called firmware? What's so exciting in it that people upvoted it to ~100
points on HN? TIA!

~~~
sjagoe
KVM is the Kernel-based Virtual Machine [1], a hypervisor system in the Linux
Kernel. The firmware in question is, as I (minimally) understand it, like a PC
BIOS, that does the initial system bootstrapping. So it's not firmware on the
physical host, but acts as firmware in the virtualized host.

I don't know enough about KVM to know why this firmware is significant, but I
have seen some of QEMU (which can use KVM for its hypervisor) requiring a
kernel image separate from the virtual host disk image. This firmware loads a
kernel from the disk image itself, like a kernel is loaded from disk on a
physical host.

[1] [https://en.wikipedia.org/wiki/Kernel-
based_Virtual_Machine](https://en.wikipedia.org/wiki/Kernel-
based_Virtual_Machine)

~~~
bonzini
QEMU runs a full-blown firmware (SeaBIOS or UEFI) so it does not need this.
You can, if you want, pass the kernel on a command line but it's not the
default.

However, Firecracker can _only_ boot from a manually-provided kernel so you
need this in order to boot from a partition. It is still not a complete
replacement for e.g. Grub, which supports boot from various filesystems and
from LVM, including encrypted logical volumes.

------
lykr0n
> Works with Firecracker as a drop in replacement for the Linux kernel

Oh my. I'm watching this.

~~~
timthorn
You'll want to keep an eye on Rust-vmm then:
[https://opensource.com/article/19/3/rust-virtual-
machine](https://opensource.com/article/19/3/rust-virtual-machine)

~~~
lykr0n
My interest lies in a rust unikernel where I can compile my binary into a VM
image that has just what I need to run the application and deploy it.
Configuration is read from a known network address, and off it goes.

But that is still awesome

