在gentoo上安装bochs

来源:互联网 发布:xp添加网络win7打印机 编辑:程序博客网 时间:2024/04/30 14:56
最近向学习《Orange's一个操作系统的实现》这本书,于是在gentoo下搭载实验环境。其实,只是安装nasm和bochs两个软件。nasm很好安装,gentoo的stage3默认已经安装,bochs可是大费周章,直接emerge报错。
checking for PCI host device mapping support... yesconfigure: Linux detected as host for PCI host device mappingconfigure: error: Linux kernel 2.4 or 2.6 is required

最开始以为是系统的问题,于是emerge -e system,但是问题依然没有解决。却遇到了genkernel-3.4.24_p1编译内核的initrd出错的问题。搜遍网络,在gentoo论坛里找到了答案([solved]Errors compiling gentoo-sources-3.4.0/genkernel prob)。其实是genkernel需要用到busybox,而busybox的1.20.1版本有一个错误的#include,据文章中说,补丁已经反映到上游代码中去了。降级genkernel(mask掉3.4.24_p1版),问题解决。

回过头来说bochs。我尝试了自行./configure && make && make install,找到的更新版本的tar包,甚至尝试写一个ebuild。最后还是在gentoo论坛里找到答案(Bochs-2.4.5 configure fails - needs Linux kernel 2.4 or 2.6),很简单一条命令搞定:

setarch `uname -m` --uname-2.6 emerge bochs

好了,这下可以学编写操作系统了。我的目标是:
1、《Orange's一个操作系统的实现》
2、《Linux内核0.11(0.95)源代码注释》
3、《深入理解Linux内核源代码》和《Linux设备驱动》

愿开源保佑我。