tkvm is a minimal VMM which can run a very simple VM and can run a whole operation system in the future. It uses KVM API to simulate a VM. It is a learning project contemporarly.
Learning of tkvm can be divided into 4 steps:
- Build a prototype of KVM API usage
- Accomplish the part of Memory set
- Accomplish the part of load kernel boot and initrd
- Accomplish the part of CPU
Run the tkvm
and then run the command
./tkvm -kernel image/bzImage -initrd image/initramfs-busybox-x86.cpio.gz
Build your own Linux image
Notice: If you need to build the KVM acceleration kernel, change the command make kvmconfig
to make kvm_guest.config
. Reference: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2140886.html
You may need to re-run the programme many time for successfully get the terminal. Only for x86 structure yet.
- kvmtool阅读笔记(一) | 通用结构体&函数执行概括
- kvmtool阅读笔记(二) | 内存初始化
- kvmtool阅读笔记(三) | Linux内核加载
- kvmtool阅读笔记(四) | 设置BIOS
- kvmtool阅读笔记(五) | 终端&Console初始化
- https://github.com/kvmtool/kvmtool
- Inside the Linux Virtualization Principle and Implementation