/*********************************************************************
* Ubuntu Bochs boot.asm 测试
* 说明:
* 本文仅仅是在Ubuntu下通过Bochs验证《自己动手编写操作系统》中的
* Boot Sector(引导区)的汇编代码,算是撘一个测试环境。
*
* 2016-7-22 深圳 南山平山村 曾剑锋
********************************************************************/ 一、参考文档:
. ubuntu下bochs安装使用
http://blog.csdn.net/xnwyd/article/details/7421703
. bochs安装一系列问题
http://blog.chinaunix.net/uid-23817499-id-3418083.html
. 自己动手写操作系统之1:bochs初步使用
http://blog.csdn.net/zhaodedong/article/details/51082128 二、测试目录文件:
aplex@aplex:~/os/system$ ls
a.img bochsout.txt boot.asm boot.bin 三、cat boot.asm
org 07c00h
mov ax, cs
mov ds, ax
mov es, ax
call DispStr
jmp $ DispStr:
mov ax, BootMessage
mov bp, ax
mov cx,
mov ax, 01301h
mov bx, 000ch
mov dl,
int 10h
ret
BootMessage: db "Hello, OS world!"
times -($-$$) db dw 0xaa55 四、cat ~/.bochsrc
###############################################################
# Configuration file for Bochs
############################################################### # how much memory the emulated machine will have
megs: # filename of ROM images
romimage: file=/usr/share/bochs/BIOS-bochs-latest
vgaromimage: file=/usr/share/vgabios/vgabios.bin # 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= # enable key mapping, using US layout as default.
#keyboard_mapping: enabled=, map=/usr/share/bochs/keymaps/x11-pc-us.map display_library: sdl 五、命令运行流程:
aplex@aplex:~/os/system$ ls
a.img bochsout.txt boot.asm boot.bin
aplex@aplex:~/os/system$ nasm boot.asm -o boot.bin
aplex@aplex:~/os/system$ bximage
========================================================================
bximage
Disk Image Creation Tool for Bochs
$Id: bximage.c,v 1.34 // :: sshwarts Exp $
======================================================================== Do you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd] fd Choose the size of floppy disk image to create, in megabytes.
Please type 0.16, 0.18, 0.32, 0.36, 0.72, 1.2, 1.44, 1.68, 1.72, or 2.88.
[1.44] 1.44
I will create a floppy image with
cyl=
heads=
sectors per track=
total sectors=
total bytes= What should I name the image?
[a.img] The disk image 'a.img' already exists. Are you sure you want to replace it?
Please type yes or no. [no] yes Writing: [] Done. I wrote bytes to a.img. The following line should appear in your bochsrc:
floppya: image="a.img", status=inserted
aplex@aplex:~/os/system$ dd if=boot.bin of=a.img
记录了1+ 的读入
记录了1+ 的写出
512字节( B)已复制,0.00040927 秒,1.3 MB/秒
aplex@aplex:~/os/system$ bochs
========================================================================
Bochs x86 Emulator 2.4.
Build from CVS snapshot, on February ,
Compiled at Jun , ::
========================================================================
00000000000i[ ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'
00000000000i[ ] BXSHARE not set. using compile time default '/usr/share/bochs'
00000000000i[ ] reading configuration from /home/aplex/.bochsrc
00000000000i[ ] lt_dlhandle is 0x378ba30
00000000000i[PLGIN] loaded plugin libbx_sdl.so
00000000000i[ ] installing sdl module as the Bochs GUI
00000000000i[ ] using log file bochsout.txt
aplex@aplex:~/os/system$ 六、效果图:

Ubuntu Bochs boot.asm 测试的更多相关文章

  1. 操作系统实现-boot.asm实现

    博客网址:www.shicoder.top 微信:18223081347 欢迎加群聊天 :452380935 这一次我们进入操作系统实现的真实编码, 这一次主要是完善对boot.asm文件的全部实现, ...

  2. 在Ubuntu中部署并测试Fabric 1.0 Beta

    [更新:1.0Beta已经是过去式了,现在出了1.0.0的正式版,请大家参照 http://www.cnblogs.com/studyzy/p/7437157.html  安装Fabric 1.0.0 ...

  3. Spring Boot(十二):spring boot如何测试打包部署

    Spring Boot(十二):spring boot如何测试打包部署 一.开发阶段 1,单元测试 在开发阶段的时候最重要的是单元测试了,springboot对单元测试的支持已经很完善了. (1)在p ...

  4. [Ubuntu] 解决 ubuntu 升级时 /boot 空间不足

    经常升级Linux内核,导致更新时警告/boot分区空间不足.这是以为多次升级内核后,导致内核版本太多,清理一下没用的内核文件就行了. 原文地址请保留http://www.cnblogs.com/ro ...

  5. 关于ubuntu系统boot分区空间不足而又无法卸载旧内核的解决方法

    2016年09月03日 14:16:45 萧氏一郎 阅读数:7802 标签: ubuntuboot分区清理更多 个人分类: linux   版权声明:本文为本猿原创文章,转载务必注明出处,多谢. ht ...

  6. spring boot应用测试框架介绍

    一.spring boot应用测试存在的问题 官方提供的测试框架spring-boot-test-starter,虽然提供了很多功能(junit.spring test.assertj.hamcres ...

  7. Spring Boot从入门到放弃-Spring Boot 整合测试

    站长资讯摘要:使用Spring Boot 整合测试,对Controller 中某个方法进行测试或者对Service,Mapper等进行测试,不需要运行项目即可查看运行结果是否和期望值相同,Spring ...

  8. Linux下搭建mpi集群(ubuntu下用虚拟机测试)

    一 建立SSH连接(无密码登陆) 1 SSH连接的简单介绍 SSH 为 Secure Shell 的缩写,中文翻译为安全外壳协议,建立在应用层,是一种远程连接安全协议.传统的telnet,pop,ft ...

  9. (转)Spring Boot(十二):Spring Boot 如何测试打包部署

    http://www.ityouknow.com/springboot/2017/05/09/spring-boot-deploy.html 有很多网友会时不时的问我, Spring Boot 项目如 ...

随机推荐

  1. CD(01背包)

    You have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is o ...

  2. CodeForces 632A

    A - Grandma Laura and Apples Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & ...

  3. Leetcode39.Combination Sum组合总和

    给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合. candidates 中的数字可以无限制重复被选 ...

  4. HDU1711 最基础的kmp算法

    Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], .... ...

  5. sencha architect开发sencha touch应用注意事项

    以下说明文字针对sencha architect v2.2.2 一.无限期试用 1. 下载地址: http://www.sencha.com/products/architect/download/ ...

  6. 1716: [Usaco2006 Dec]The Fewest Coins 找零钱

    n<=100种硬币,给每种的硬币的面额<=120和我每种有多少个<=10000,店主的硬币跟我一样但有无限个,求买t<=10000块钱的东西钱最少转手几次. 我拿的硬币最少几次 ...

  7. Sudoku---hdu2676(数独DFS)

    http://poj.org/problem?id=2676 递归深搜 #include<stdio.h> #include<string.h> #include<alg ...

  8. T1992 聚会 codevs

    http://codevs.cn/problem/1992/  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold 题目描述 Description 小S 想要从某地 ...

  9. jfree-生成xy图

    需要导入的包: import org.jfree.chart.*; import org.jfree.chart.plot.PlotOrientation; import org.jfree.data ...

  10. androidstudio Cannot resolve symbol 'xxx'

    Android Studio 无法识别同一个 package 里的其他类,将其显示为红色,但是 compile 没有问题.鼠标放上去后显示 “Cannot resolve symbol XXX”,重启 ...