Skip to content

Commit

Permalink
add source code
Browse files Browse the repository at this point in the history
  • Loading branch information
yifengyou committed Jul 25, 2018
1 parent 9f928eb commit 5792962
Show file tree
Hide file tree
Showing 39 changed files with 11,454 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/KVM内核模块源码分析/KVM内核模块源码分析.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
# KVM内核模块源码分析

* KVM基于内核的虚拟机 在2007年2月被导入Linux 2.6.20核心中。散步内核不同顶层目录下
- 主要包括两个目录:virt和arch/x86/kvm
- virt包含内核中非硬件体系架构相关的部分如IOMMU、中断控制等
- arch/x86很明显arch就是跟体系相关。KVM不单单支持x86,还支持PowerPC、MIPS等
* 在此之前都是单模块,以色列开发人员搞得,就是个内核模块单目录

## 源码获取

下载目录:<https://sourceforge.net/projects/kvm/files/?source=navbar>

![1532478632446.png](image/1532478632446.png)

这里要分清不同目录

* kvm-kmod里面存放不同内核版本的kvm功能模块,仅包含kvm功能模块,不包含其它内核内容
* qemu-kvm其实就是支持kvm的改版qemu
* kvm是更早之前,没有加入内核模块的kvm,单独的内核模块和qemu-kvm补丁
* 剩下的两个是客户端驱动,半虚拟化用到

获取kvm目录中最早期的源码

![1532479038159.png](image/1532479038159.png)

这时候还是单模块+补丁的形式打进内核。最原始的源码,这,只能说我能找到的最原始的源码了。






## END
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/2006-11-02/kvm-module-1.tar.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions src/2006-11-02/kvm-module/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
EXTRA_CFLAGS := -I$(PWD)/include
obj-m := kvm.o
kvm-objs := kvm_main.o mmu.o x86_emulate.o debug.o
16 changes: 16 additions & 0 deletions src/2006-11-02/kvm-module/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
KERNELDIR := /lib/modules/`uname -r`/build

rpmrelease = devel

all::
$(MAKE) -C $(KERNELDIR) M=`pwd` "$$@"

tmpspec = .tmp.kvm-kmod.spec

rpm: all
mkdir -p ../BUILD ../RPMS/$$(uname -m)
sed 's/^Release:.*/Release: $(rpmrelease)/' kvm-kmod.spec > $(tmpspec)
rpmbuild --define="kverrel $$(uname -r)" \
--define="objdir $$(pwd)" \
--define="_topdir $$(pwd)/.." \
-bb $(tmpspec)
Loading

0 comments on commit 5792962

Please sign in to comment.