make os for fun:hello,my first os!

    郑重声明:此系列是本人阅读《Orange's System:一个操作系统的实现》(作者是于渊先生)的同时所作,本人是初学者,对于本书作者于渊先生十分的敬仰,文章只是涉及到一些书中以及自己做的实验同时附上自己的感悟,关于实验中的原理系统知识等,强烈建议购买原书进行进一步的研究学习!

  My input program failed,i think my computer will follow it away,so before they make an appointment i will write in english.because i couldn't write my blog in "da jia hao,ni men kan de ming bai ma,zhe yang gan jue guai guai de?"

OK,joking is over.

  Recently,i read one book called "orange's system:do it youself",i think it's a good translation, is it?

  All i want to say is:''i love it as my grilfriend,e,actually second"',let's try it.

View Code
 1     org    07c00h            ; 告诉编译器程序加载到7c00处
2
3 mov ax, cs
4
5 mov ds, ax
6
7 mov es, ax
8
9 call DispStr ; 调用显示字符串例程
10
11 jmp $ ; 无限循环
12
13 DispStr:
14
15
16 mov ax, BootMessage
17
18 mov bp, ax ; ES:BP = 串地址
19
20 mov cx, 16 ; CX = 串长度
21
22 mov ax, 01301h ; AH = 13, AL = 01h
23
24 mov bx, 000ch ; 页号为0(BH = 0) 黑底红字(BL = 0Ch,高亮)
25
26 mov dl, 0
27
28 int 10h ; 10h 号中断
29
30 ret
31
32 BootMessage: db "Hello, my first os!"
33
34 times 510-($-$$) db 0 ; 填充剩下的空间,使生成的二进制代码恰好为512字节
35
36 dw 0xaa55 ; 结束标志

 oh,some chars looked really shy……

now view this

View Code
    org    07c00h            ; 告诉编译器程序加载到7c00处

mov ax, cs

mov ds, ax

mov es, ax

call DispStr ; 调用显示字符串例程

jmp $ ; 无限循环

DispStr:


mov ax, BootMessage

mov bp, ax ; ES:BP = 串地址

mov cx, 19 ; CX = 串长度

mov ax, 01301h ; AH = 13, AL = 01h

mov bx, 000ch ; 页号为0(BH = 0) 黑底红字(BL = 0Ch,高亮)

mov dl, 0

int 10h ; 10h 号中断

ret

BootMessage: db "Hello, my first os~"

times 510-($-$$) db 0 ; 填充剩下的空间,使生成的二进制代码恰好为512字节

dw 0xaa55 ; 结束标志

good job.





 

posted @ 2012-06-04 15:20  SimArchitect  阅读(199)  评论(0编辑  收藏  举报