/*********************************************************************
* 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. 表连接sql执行计划学习

    循环嵌套连接(Nested Loop Join) 合并连接(Merge Join) 哈西匹配(Hash Join) 文章:浅谈SQL Server中的三种物理连接操作 循环嵌套,如果内循环列上有索引, ...

  2. PTA 01-复杂度2 Maximum Subsequence Sum (25分)

    题目地址 https://pta.patest.cn/pta/test/16/exam/4/question/663 5-1 Maximum Subsequence Sum   (25分) Given ...

  3. oracle sqlplus 导出csv文件

    et colsep , set feedback off set heading off set trimout on spool D:\DBoracle\lfc.csv select '" ...

  4. [luoguP1027] Car的旅行路线(Floyd)

    传送门 建图麻烦,建完图搞一遍Floyd就好了. ——代码 #include <iostream> #include <cstdio> #include <cmath&g ...

  5. android中的OnClickListener两种实现方式

    android的activity点击事件中,通过OnClickListener来实现,要实现点击事件有两种方式 1.通过定义一个OnClickListener的内部类来实现 The example b ...

  6. 【转载】ubuntu16.04 无线/Wifi 上网速度慢的解决方法

    原文链接:http://tieba.baidu.com/p/4737599703[侵删] 一直以为是域名解析的问题,可也觉得不像.今天在百度搜索“ubuntu16.04域名解析慢”的时候无意中看到了h ...

  7. sgu179 SGU起航!

    //发现dfs除了搜索功能外的其他功能,他本身是一种序列,这个题恰是"先序"的下一个(合法范围内)序列! #include<iostream> #include< ...

  8. 【webstorm 系列之一】快捷键很好用啊

    书签 bookmarks , 在多文件中调试很方便 断点只能在js文件中用,而bookmark可以在所有文件中使用 书签开关 F11  (给光标所在行加书签) 显示书签 Shift + F11 书签号 ...

  9. POJ 2337 【字典序】【欧拉回路】

    题意: 给你一些单词,判断这些单词能否在保证首尾单词相同的情况下连成一排. 如果有多组解,输出字典序最小的一组解. 这题... WA了两天. 错误有以下: 1.没有初始化好起始位置,默认起始位置是a了 ...

  10. androidstudio Cannot resolve symbol 'xxx'

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