百度空间 | 百度首页 
 
查看文章
 
一个简单的 boot
2008年04月30日 星期三 17:42

   实验 环境 FC8   bochs2.1.1

boot.s 文件 代码如下:

.text
entry _start
_start:
jmpi boot1 ,#0x07c0
boot1:
mov ax,cs
mov ds,ax
mov es,ax
mov ss,ax
print_msg:
mov ah,#0x03
xor bh,bh
int 0x10
mov cx,#29
mov bx,#0x0007
mov bp,#msg
mov ax,#0x1301
int 0x10
jmp print_msg

msg:
.byte 13,10
.ascii "Aha , i am a boot process!"
.byte 13,10
.org 510
.word 0xAA55

makefile 代码如下:

#dd bs=32 if=boot of=Image skip=1
AS86 =as86 -0 -a
LD86 =ld86 -0

all:boot

boot: boot.s
$(AS86) -o boot.o boot.s
$(LD86) -s -o boot boot.o

disk:boot
dd bs=32 if=boot of=Image skip=1
dd bs=8192 if=boot of=12.img

clean:
rm -f *.o core
rm -f boot
rm -f 12.img
rm -f Image

请注意红色的部分 ^ ^ 死在他 下面一天.......   很感谢赵老师....

#******************************************
#***********************************************************************************
# ***********add by the user***************  

# file of bochsrc-hd.bxrc
# please pay attention to this
# just change bootimage-0.11-hd to your own IMG file
#   no more than that

#floppya: 1_44=/dev/fd0, status=inserted
#floppya: file=../1.44, status=inserted
#floppya: 1_44=/dev/fd0H1440, status=inserted
#floppya: 1_2=../1_2, status=inserted
#floppya: 1_44=a:, status=inserted             # for win32
floppya: 1_44="12.img", status=inserted
#bootimage-0.11-hd                             just change this to your IMG

#**********************************************
#**********************************************
#********************************************

好了   ~ ~  继续继续....


类别:linux1.0 学习笔记 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu