os-001-bochs


title: os 001 bochs
tags: [os]
categories:

  • os
    date: 2021-05-11 20:59:35

make an os -001

  • 积攒了这么久,终于要开始写一个操作系统了,加油。
bochs
wget https://cfhcable.dl.sourceforge.net/project/bochs/bochs/2.6.2/bochs-2.6.2.tar.gz
  • 解压进入目录中
  • configure

./configure --prefix=/lib/bochs --enable-debugger --enable-disasm --enable-iodebug --enable-x86-debugger --with-x --with-x11

  • make
    make会出现lpthread未链接的信息,则添加以下内容。
    修改Makefile 在93行加入以下信息

./configure --prefix=/lib/bochs --enable-debugger --enable-disasm --enable-iodebug --enable-x86-debugger --with-x --with-x11
191行与192行改为

$(LIBS) \
-lpthread

  • make install

  • Makefile的示例如下
    makefile

  • 配置bochs的启动选项
    conf

# Bochs配置文件

# 机器内存: 32MB
megs: 32

# 对应真实机器的bios
romimage: file=/lib/bochs/share/bochs/BIOS-bochs-latest
# 对应真实机器的VGA bios
vgaromimage: file=/lib/bochs/share/bochs/VGABIOS-lgpl-latest

# 启动方式
boot: disk

log: bochs.out

# 关闭鼠标
mouse: enabled=0
keyboard:keymap=/lib/bochs/share/bochs/keymaps/x11-pc-us.map
# 硬盘设置

ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="hd60M.img", mode=flat, cylinders=121, heads=16, spt=63

  • 添加环境变量
    /etc/profile 的最后一行添加
export PATH=/lib/bochs/bin:$PATH
source /etc/profile
  • 启动bochs
boshs
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值