archlinux编译bochs

系统信息

bochs官网

从官网信息可以看到现在代码也迁移到了github上

1 包管理器安装

1.1 安装

1
yay -Ss bochs

我们肯定是想要gui的,方便看调试输出信息

以sdl库支持的版本为例

1
2
yay -Syy bochs-sdl
whereis bochs

1.2 使用

bochs选项4生成配置文件,并将floppya配置项内容指定上软盘镜像,修改为floppya: type=1_44, image=/home/dingrui/MyDev/doc/tutorial/os/64bit_os/01/build/my_os_floppy.img, status=inserted, write_protected=0

随后启动bochs -q -f ./my_bochs_cfg,启动报错找不到gui的库

修改配置文件中display_library: sdl2配置项再次启动还是报错

从官网上看到,不同平台都会有推荐的选择以及默认的库

所以我的猜想是上传在aur上的包,可能在编译的时候没有指定display lib所以用的是默认的x,但是我当前的linux不支持这个gui。

所以稳妥的办法是,自己下载源码进行编译,在编译的时候指定编译选项。

2 手动编译

2.1 安装bochs

跟着官方文档操作即可

2.1.1 download source code

1
2
3
wget -P ~/MyDev/env https://sourceforge.net/projects/bochs/files/bochs/2.7/bochs-2.7.tar.gz
mkdir bochs
tar -zxvf ./bochs-2.7.tar.gz -C ./bochs --strip-components 1

2.1.3 config file

修改一下configure命令

1
vim .conf.linux

至于使用哪个lib,根据自己的情况

  • –with-sdl

  • –with-sdl2

2.1.4 configure

1
sh -x .conf.linux

2.1.5 make

1
2
make
sudo make install

2.1.4 error

  • Plugin support requires libltdl installed on your syste

    1
    2
    apt search libltdl
    sudo apt install libltdl-dev
  • fatal error: SDL.h: No such file or directory

    1
    2
    apt search sdl2
    sudo apt install libsdl2-dev

2.1.5 uninstall

以后卸载也很简单

1
2
3
4
5
6
cd ~/MyDev/env/bochs
sudo make uninstall
make clean
make dist-clean
cd ..
rm -rf bochs

2.2 使用

1
2
3
4
bximage --help
bochs --help cpu

bochs -q -f ./my_bochs_cfg

怎么配置ssh的远程gui,ssh远程主机


archlinux编译bochs
https://bannirui.github.io/2024/02/28/archlinux编译bochs/
作者
dingrui
发布于
2024年2月28日
许可协议