/*********************************************************************
* 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. ACboy needs your help(分组背包)

    ACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he ...

  2. 【Ajax 1】Ajax与传统Web开发的区别

    导读:从用户体验度的角度来说,利用Ajax进行开发的网站,其体验度高于利用传统Web开发技术,那么,是什么因素导致了这一现象呢?难道说Ajax开发,就一定优于传统Web技术吗?本篇文章,将主要介绍Aj ...

  3. Codeforces Round #386 (Div. 2) A+B+C+D!

    A. Compote 水题(数据范围小都是水题),按照比例找最小的就行了,3min水过. int main() { int a,b,c; while(~scanf("%d%d%d" ...

  4. hihoCoder#1127 二分图三·二分图最小点覆盖和最大独立集

    原题地址 主要是介绍了两个定理: 1. 二分图最大匹配数    = 二分图最小点覆盖数 2. 二分图最小点覆盖数 = 二分图顶点数 - 二分图最小点覆盖数 注意,都是二分图 代码:(匈牙利算法) #i ...

  5. type和metaclass元类

    元类type 1. 创建类的两种方式 (都是由type元类创建) 方式一: class Foo(object): # 默认metaclass = type, 当前类, 由type类创建 a = 'aa ...

  6. 怎么删除"自豪地采用WordPress"

    wordpress刚刚安装完毕,打开默认的主页,会发现底部有这样的一行文字:“自豪地采用WordPress”.当然了,我们做一个网站,不一定需要这些文字,我们可以删除或者修改这些文字.今天,小编就来教 ...

  7. PAT (Advanced Level) 1032. Sharing (25)

    简单题,不过数据中好像存在有环的链表...... #include<iostream> #include<cstring> #include<cmath> #inc ...

  8. 洛谷——P2916 [USACO08NOV]为母牛欢呼Cheering up the Cows

    https://www.luogu.org/problem/show?pid=2916 题目描述 Farmer John has grown so lazy that he no longer wan ...

  9. uva 662

    dp +路径输出 #include <cstdio> #include <cstdlib> #include <cmath> #include <stack& ...

  10. .NET作品集:基于svn 的.net 持续集成工具

    作品背景 这个.net 持续集成作品还是在2014年的时候从事.net 软件项目开发的时候做的,当时部门还用着vs2008用vb.net做项目(现在也是),项目代码极混乱,版本工具用的vss,而且用的 ...