是什么?
一种可以在用户态运行的linux内核
有什么用?
进行内核隔离,替代qemu/bochs调试linux内核,在低性能设备上代替kvm进行虚拟化
怎么做?
编译linux内核
git下载源代码
1 | git clone --depth 1 https://mirrors.tuna.tsinghua.edu.cn/git/linux.git |
编译
1 | cd linux |
现在 你获得了一个vmlinux
文件 这个vmlinux和正常内核的区别就是这个vmlinux可以在用户态运行
先别着急启动,先来准备rootfs
一下内容以debian为例
先安装debootstrap
1 | sudo apt install debootstrap |
然后构建rootfs
1 | sudo su |
1 | sudo chown `whomi` rootfs |