自己动手写操作系统笔记1
来源:互联网 发布:细说php视频下载 编辑:程序博客网 时间:2024/05/21 08:57
首先做好准备
下载好nasm(编译汇编器),bochs(一个小型虚拟机)
bochs 的安装
tar vxzf bochs-x.x.x.tar.gz
cd bochs-x.x.x
./configure --enable-debugger --enable-disasm
make
sudo make install
boot.asm 的编写如下
org07c00h; 告诉编译器程序加载到7c00处movax, csmovds, axmoves, axcallDispStr; 调用显示字符串例程jmp$; 无限循环DispStr:movax, BootMessagemovbp, ax; ES:BP = 串地址movcx, 16; CX = 串长度movax, 01301h; AH = 13, AL = 01hmovbx, 000ch; 页号为0(BH = 0) 黑底红字(BL = 0Ch,高亮)movdl, 0int10h; 10h 号中断retBootMessage:db"Hello, OS world!"times 510-($-$)db0; 填充剩下的空间,使生成的二进制代码恰好为512字节dw 0xaa55; 结束标志
用nasm编译 nasm boot.asm -o boot.bin
用bochs创建一个软盘镜像 bximage 选择fd
将引导写进软盘 dd if=boot.bin of=a.img bs=512 count=1 conv=notrunc
编写bochs配置文件bochsrc
################################################################ Configuration file for Bochs################################################################ how much memory the emulated machine will havemegs: 32# filename of ROM imagesromimage: file=/usr/local/share/bochs/BIOS-bochs-latestvgaromimage: file=/usr/local/share/bochs/VGABIOS-elpin-2.40# 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 mousemouse: enabled=0# enable key mapping, using US layout as default.keyboard_mapping: enabled=1, map=/usr/local/share/bochs/keymaps/x11-pc-us.map
然后就可以运行了 bochs -f bochsrc
- 自己动手写操作系统笔记1
- 自己动手写操作系统 笔记
- 自己动手写操作系统学习笔记1
- 自己动手写操作系统1
- 自己动手写操作系统学习笔记
- 自己动手写操作系统实验1
- 自己动手写操作系统--笔记之安装DOS
- <<自己动手写操作系统>>学习笔记(一)---后记
- 自己动手写操作系统笔记之helloworld
- 《自己动手写操作系统》学习笔记(五)
- 《自己动手写操作系统》学习笔记(四)
- 《自己动手写操作系统》学习笔记(六)
- 自己动手写操作系统学习笔记(一)
- 《自己动手写嵌入式操作系统》阅读笔记之操作系统小知识
- 《自己动手写操作系统》读书笔记(1)
- 自己动手写操作系统(1)---环境搭建
- 《自己动手写一个操作系统》个人实践1
- 自己动手写操作系统
- JDBC基础之连接
- jtable checkbox render
- ASP.NET中利用Segments取得URL的文件名的一种方法
- vmware tool 的安装
- linux安装flashplayer
- 自己动手写操作系统笔记1
- 嵌入式操作系统的启动
- JDBC 通过1433端口连接 Sql Server 异常
- 转:用firebug调试网页
- 完成端口线程池及任务接口
- iptable 相关(linux, mac)
- mGstat : A Geostatistical Matlab toolbox
- 3101astronomy
- gcd&lcm模板(poj3101验证)