构建 Linux 内核
我刚刚收到 Robert Love 写的《Linux 内核开发》一书。它有很多地方需要您修改和构建内核。那么我应该如何处理呢?使用虚拟机是否更好,或者我应该以某种方式为其获取合适的测试机,因为我不想弄乱我的系统和数据。
i Just got the book Linux Kernel Development by Robert Love . It has lots of places where you are required to modify and build the kernel . So how should i go with it . Is it better to use a VM , or should i somehow get a proper test machine for it , since i dont want to goof up on my system and data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
VM 的优点是提供快照。这些允许您保存机器的状态 - 如果内核构建不起作用,您只需恢复快照,并且您可以拍摄尽可能多的快照,只要您有磁盘空间来存储它们。您还可以克隆并重新部署虚拟机映像,因此您可以在许多相同的系统上进行测试。
在物理机上进行相同的实验需要付出更大的努力(重影/克隆磁盘、重新安装操作系统等)。
VirtualBox 是免费的跨平台虚拟化软件。
A VM has the advantage of offering snapshots. These allow you to save the state of the machine - if the kernel build doesn't work you simply restore the snapshot, and you are able to take as many snapshots as you have disk space to store them. You are also able to clone and re-deploy the VM image, so you have many identical systems to test on.
The same experiment on a physical machine would require far greater effort (ghosting/cloning the disk, re-installing the OS etc).
VirtualBox is free, cross-platform virtualisation software.
网上有很多关于此主题的教程,例如:
There are a lot of tutorials on the web about this topic, e.g. here:
您可以选择其中之一或两者都做。介于两者之间的另一种选择是设置双启动。这比虚拟机风险稍高,但也不算太大。
You could do either or both. An alternative somewhere in between is to setup a dual boot. This is a little riskier than a VM, but not too much.
coLinux
或使用 Windows 上的 QEMU 运行 linux iso 映像
coLinux
or run linux iso image using QEMU on windows