ubuntu12.04安装bochs
来源:互联网 发布:计算机的软件 编辑:程序博客网 时间:2024/05/22 16:56
安装gcc编译环境
sudo apt-get install build-essential
sudo apt-get install xorg-dev
sudo apt-get install libgtk2.0-dev
下载bochs最新版本
http://bochs.sourceforge.net/
安装命令
$tar vxzf bochs-2.6.tar.gz
$cd bochs-2.6
$./configure --enable-debugger --enable-disasm
$make
$sudo make install
安装nasm
sudo apt-get install nasm
编译boot.asm
nasm boot.asm -o boot.bin
此处的boot.asm是一段汇编代码,在屏幕上打印出hello, OS world!
代码如下:
org 07c00h ; 告诉编译器程序加载到7c00处
mov ax, cs
mov ds, ax
mov es, ax
call DispStr ; 调用显示字符串例程
jmp $ ; 无限循环
DispStr:
mov ax, BootMessage
mov bp, ax ; ES:BP = 串地址
mov cx, 16 ; CX = 串长度
mov ax, 01301h ; AH = 13, AL = 01h
mov bx, 000ch ; 页号为0(BH = 0) 黑底红字(BL = 0Ch,高亮)
mov dl, 0
int 10h ; 10h 号中断
ret
BootMessage: db "Hello, OS world!"
times 510-($-$$) db 0 ; 填充剩下的空间,使生成的二进制代码恰好为512字节
dw 0xaa55 ; 结束标志
用bximage命令来创建img文件
使用dd命令将它写进刚刚创建的软盘映像a.img的第一个扇区
dd if=boot.bin of=a.img bs=512 count=1 conv=notrunc
此时还需要配置bochs的配置文件bochsrc,标准的配置文件格式为
###############################################################
# Configuration file for Bochs
###############################################################
# how much memory the emulated machine will have
megs: 32
# filename of ROM images
romimage: file=/usr/local/share/bochs/BIOS-bochs-latest
vgaromimage: file=/usr/local/share/bochs/VGABIOS-lgpl-latest
# what disk images will be used
floppya: 1_44=a.img, status=inserted
# choose the boot disk.
boot: floppy
# where do we send log messages?
# log: bochsout.txt
# disable the mouse
mouse: enabled=0
# enable key mapping, using US layout as default.
keyboard_mapping: enabled=1, map=/usr/local/share/bochs/keymaps/x11-pc-us.map
接着便可以执行
bochs -f bochsrc
sudo apt-get install build-essential
sudo apt-get install xorg-dev
sudo apt-get install libgtk2.0-dev
下载bochs最新版本
http://bochs.sourceforge.net/
安装命令
$tar vxzf bochs-2.6.tar.gz
$cd bochs-2.6
$./configure --enable-debugger --enable-disasm
$make
$sudo make install
安装nasm
sudo apt-get install nasm
编译boot.asm
nasm boot.asm -o boot.bin
此处的boot.asm是一段汇编代码,在屏幕上打印出hello, OS world!
代码如下:
org 07c00h ; 告诉编译器程序加载到7c00处
mov ax, cs
mov ds, ax
mov es, ax
call DispStr ; 调用显示字符串例程
jmp $ ; 无限循环
DispStr:
mov ax, BootMessage
mov bp, ax ; ES:BP = 串地址
mov cx, 16 ; CX = 串长度
mov ax, 01301h ; AH = 13, AL = 01h
mov bx, 000ch ; 页号为0(BH = 0) 黑底红字(BL = 0Ch,高亮)
mov dl, 0
int 10h ; 10h 号中断
ret
BootMessage: db "Hello, OS world!"
times 510-($-$$) db 0 ; 填充剩下的空间,使生成的二进制代码恰好为512字节
dw 0xaa55 ; 结束标志
用bximage命令来创建img文件
使用dd命令将它写进刚刚创建的软盘映像a.img的第一个扇区
dd if=boot.bin of=a.img bs=512 count=1 conv=notrunc
此时还需要配置bochs的配置文件bochsrc,标准的配置文件格式为
###############################################################
# Configuration file for Bochs
###############################################################
# how much memory the emulated machine will have
megs: 32
# filename of ROM images
romimage: file=/usr/local/share/bochs/BIOS-bochs-latest
vgaromimage: file=/usr/local/share/bochs/VGABIOS-lgpl-latest
# what disk images will be used
floppya: 1_44=a.img, status=inserted
# choose the boot disk.
boot: floppy
# where do we send log messages?
# log: bochsout.txt
# disable the mouse
mouse: enabled=0
# enable key mapping, using US layout as default.
keyboard_mapping: enabled=1, map=/usr/local/share/bochs/keymaps/x11-pc-us.map
接着便可以执行
bochs -f bochsrc
来运行bochsrc虚拟机。
注:a.img bochsrc 在同一个文件夹里
0 0
- ubuntu12.04安装bochs
- ubuntu12.04安装bochs
- ubuntu12.04安装带调试功能的Bochs
- Ubuntu14.04安装运行bochs
- ubuntu16.04上安装bochs
- Bochs安装
- 安装 bochs
- bochs 安装
- bochs安装
- bochs安装
- bochs安装
- ubuntu10.04 bochs 安装配置及启动
- ubuntu14.04中安装配置bochs详解
- ubuntu12.04安装openvpn
- UBUNTU12.04安装笔记
- 安装Ubuntu12.04
- 虚拟机安装Ubuntu12.04
- Ubuntu12.04安装JDK
- java异常处理Exception
- 输出文本指定行
- Mahout初步认识
- 使用Xcode修改iOS项目工程名和路径名
- php生成随机密码的几种方法
- ubuntu12.04安装bochs
- nyoj892买牛奶
- 在curd 中提升自我 + 如何面对海量的信息(如何辨别真假)
- 我辈修士,何惧一战
- c++警告和错误汇总
- 菜鸟,大牛,教主的区别
- Java运行环境的搭建
- 微软MCITP系列免费公开课(笔记)
- Android 学习之路