1.创建hd60M.img

yangjun@yangjun-Inspiron-7559:~/bochs$ bin/bximage
========================================================================bximageDisk Image Creation / Conversion / Resize and Commit Tool for Bochs$Id: bximage.cc 13481 2018-03-30 21:04:04Z vruppert $
========================================================================1. Create new floppy or hard disk image
2. Convert hard disk image to other format (mode)
3. Resize hard disk image
4. Commit 'undoable' redolog to base image
5. Disk image info0. QuitPlease choose one [0] 1Create imageDo you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd] hdWhat kind of image should I create?
Please type flat, sparse, growing, vpc or vmware4. [flat] flatChoose the size of hard disk sectors.
Please type 512, 1024 or 4096. [512] Enter the hard disk size in megabytes, between 10 and 8257535
[10] 60What should be the name of the image?
[c.img] hd60M.imgThe disk image 'hd60M.img' already exists.  Are you sure you want to replace it?
Please type yes or no. [no] yesCreating hard disk image 'hd60M.img' with CHS=121/16/63 (sector size = 512)The following line should appear in your bochsrc:ata0-master: type=disk, path="hd60M.img", mode=flat

2. 编译mbr,并写入Img

yangjun@yangjun-Inspiron-7559:~/opensource/system/code/c2/a/boot$ nasm -o mbr.bin mbr.S
yangjun@yangjun-Inspiron-7559:~/opensource/system/code/c2/a/boot$ dd if=mbr.bin of=/home/yangjun/bochs/hd60M.img bs=512 count=1 conv=notrunc
记录了1+0 的读入
记录了1+0 的写出
512字节已复制,0.000480522 s,1.1 MB/s

3. 配置bochsrc.disk

megs : 512#注意路径 必须是你安装的路径 别弄错了
romimage: file=/home/yangjun/bochs/share/bochs/BIOS-bochs-latest
vgaromimage: file=/home/yangjun/bochs/share/bochs/VGABIOS-lgpl-latestboot: disklog: bochs.outmouse:enabled=0
keyboard:keymap=/home/yangjun/bochs/share/bochs/keymaps/x11-pc-us.mapata0:enabled=1,ioaddr1=0x1f0,ioaddr2=0x3f0,irq=14
ata0-master: type=disk, path="hd60M.img", mode=flat#gdbstub:enabled=1,port=1234,text_base=0,data_base=0,bss_base=0

4. 运行bochs

yangjun@yangjun-Inspiron-7559:~/bochs$ bin/bochs -f bochsrc.disk
========================================================================Bochs x86 Emulator 2.6.10Built from SVN snapshot on December 1, 2019Compiled on Sep  4 2022 at 08:32:20
========================================================================
00000000000i[      ] BXSHARE not set. using compile time default '/home/yangjun/bochs/share/bochs'
00000000000i[      ] reading configuration from bochsrc.disk
00000000000e[      ] bochsrc.disk:15: ataX-master/slave CHS set to 0/0/0 - autodetection enabled
------------------------------
Bochs Configuration: Main Menu
------------------------------This is the Bochs Configuration Interface, where you can describe the
machine that you want to simulate.  Bochs has already searched for a
configuration file (typically called bochsrc.txt) and loaded it if it
could be found.  When you are satisfied with the configuration, go
ahead and start the simulation.You can also start bochs with the -q option to skip these menus.1. Restore factory default configuration
2. Read options from...
3. Edit options
4. Save options to...
5. Restore the Bochs state from...
6. Begin simulation
7. Quit nowPlease choose one: [6]
00000000000i[      ] installing x module as the Bochs GUI
00000000000i[      ] using log file bochs.out
Next at t=0
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b          ; ea5be000f0
<bochs:1> c

5. 结果成功

操作系统真象还原 第二章相关推荐

  1. 操作系统真象还原第一章

    开一个新坑,最终目标是按照<操作系统真象还原>这本书实现一个操作系统. 在读每一章的过程中都会按照书中的步骤配环境.写代码.做实验,完成每章后都产出一篇博客. 写博客的主要目的是鞭策自己不 ...

  2. 操作系统真象还原 第一章

    参考:<操作系统真象还原>第一章 ---- 安装Vmware Station 安装Ubuntu 装载配置Bochs 安装Vmware tools 开始乘帆历险!_Love 6的博客-CSD ...

  3. 操作系统真象还原[11章]-用户进程

    本章在内核线程的基础上实现用户进程,主要区别是内核线程运行在特权级别3下,用户进程运行在特权级别0下. Intel原生为CPU提供的多任务机制主要是LDT/TSS,关于LDT/TSS简要阐述一下,现代 ...

  4. 《操作系统真象还原》第二章

    <操作系统真象还原>第二章 编写MBR主引导记录 载入内存 过程: (1)程序被加载器(软件或硬件)加载到内存某个区域. (2)CPU的cs:ip寄存器被指向这个程序的起始地址. 从按下主 ...

  5. 《操作系统真象还原》第二章 ---- 编写MBR主引导记录 初尝编写的快乐 雏形已显!

    文章目录 专栏博客链接 前引 相关术语 理清操作系统启动程序运行流程(部分) 编写MBR引导内容 编译并检验mbr.bin Linux dd 磁盘操作指令与参数 模拟操作试一试 结束语 专栏博客链接 ...

  6. 《操作系统真象还原》第九章 ---- 终进入线程动斧开刀 豁然开朗拨云见日 还需解决同步机制才能长舒气

    文章目录 专栏博客链接 相关查阅博客链接 本书中错误勘误 进程 线程的自我小理解 线程 进程的状态 内核级线程 & 用户级线程 初步实现内核级线程 浪费两三个小时调试的辛酸史 编写thread ...

  7. 《操作系统真象还原》第十四章 ---- 实现文件系统 任务繁多 饭得一口口吃路得一步步走啊(上一)

    文章目录 专栏博客链接 相关查阅博客链接 本书中错误勘误 部分缩写熟知 闲聊时刻 实现文件系统的原理 inode构建原理 目录构建原理 超级块构建思路 创建文件系统 编写完的super_block.h ...

  8. 《操作系统真象还原》第十四章 ---- 实现文件系统 任务繁多 饭得一口口吃路得一步步走啊(上二)

    文章目录 专栏博客链接 相关查阅博客链接 本书中错误勘误 闲聊时刻 部分缩写熟知 实现文件描述符的原理 文件描述符的介绍 文件描述符与inode的介绍 文件描述符与PCB的描述符数组的介绍 实现文件操 ...

  9. 《操作系统真象还原》第十四章 ---- 实现文件系统 任务繁多 饭得一口口吃路得一步步走啊(总结篇)

    文章目录 专栏博客链接 闲聊时刻 第十四章代码总览 编写完的fs.c(fs/fs.c) 编写完的fs.h(fs/fs.h) 编写完的dir.c(fs/dir.c) 编写完的dir.h(fs/dir.h ...

最新文章

  1. oracle解析xml字符串命名空间,XML命名空间
  2. Java报错解决:org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closi
  3. WPF获取当前用户控件的父级窗体
  4. hibernate_和ORM的关系
  5. 中继(洪泛中继、定向中继)在无线通讯中的应用
  6. WEB环境下打印报表的CRYSTAL的解决方案
  7. IOS设计模式学习(7)单例
  8. 使用TortoiseGit提交代码到github上
  9. 在PreferenceScreen加入自定义布局
  10. 惠普bios硬重置_惠普BIOS密码重置工具|惠普笔记本BIOS密码重置工具 - 万方软件下载站...
  11. Word设置标题以及自动编号——保姆级教程
  12. 基于python 爬虫的数据库设计开题报告_爬虫开题报告
  13. Leetcode 5773:插入后的最大值
  14. 基于产生式表示的动物识别系统
  15. 利用JDBC连接服务器数据库(Android)
  16. Guitar Pro8电脑版更新下载及主要功能介绍
  17. 优雅的点(2017网易校园招聘)---最详细的解答
  18. python网络爬虫与信息提取北京理工大学ppt_Python网络爬虫与信息提取
  19. 如果您的浏览器不支持javascript功能
  20. H.265是有损压缩吗?

热门文章

  1. nyoj 284 坦克大战
  2. 用powershell安装临时中文输入法
  3. 牛奶可乐经济学之Q2:为什么女装的扣子在左边,男装的扣子却总在右边?
  4. rust三人服_rust怎么设置第三人视角 | 手游网游页游攻略大全
  5. 什么是人工智能?终于说明白了
  6. 系统定时任务linux,linux系统下定时任务(示例代码)
  7. 巧用ffmpeg从视频中截图
  8. 漫画:如何打赢冗杂多变的“内容攻防战”
  9. ZSYH大数据实验室面试
  10. Beckhoff TwinCAT3.1 通过EtherCAT驱动电机(上)