第一天与第二天
看完第一天与第二天的内容,感觉这两天的内容不难
下面是系统的运行截图:
下面是系统的源文件:ucan23ipl.nas
; ucan23-os
; TAB-4
ORG 0x7c00 ;指明程序的装载地址
; 以下这段是标准FAT12格式软盘专用的代码
JMP entry
DB 0x90
DB "UCAN23LD" ;启动区的名称可以是任意的字符串(8字节)
DW 512 ;每个扇区的大小
DB 1 ;簇的大小
DW 1
DB 2
DW 224
DW 2880
DB 0xf0
DW 9
DW 18
DW 2
DD 0
DD 2880
DB 0,0,0x29
DD 0xffffffff
DB "UCAN23-OS "
DB "FAT12 "
RESB 18
;程序主体
entry:
MOV AX, 0 ;初始化寄存器
MOV SS, AX
MOV SP, 0x7c00
MOV DS, AX
MOV ES, AX
MOV SI, msg
putloop:
MOV AL, [SI]
ADD SI, 1
CMP AL, 0
JE fin
MOV AH, 0x0e
MOV BX, 15
INT 0x10
JMP putloop
fin:
HLT
JMP fin
;信息显示部分
msg:
DB 0x0a, 0x0a ;2个换行
DB "Hello, world(ucan23)"
DB 0x0a
DB "This is my first OS"
DB 0x0a
DB "Copyright GPL"
DB 0x0a
DB "Author: ucan23(Howard)"
DB 0x0a
DB "Blog:http://blog.sina.com/rjxx007"
DB 0x0a
DB "Blog:http://blog.csdn.net/ucan23"
DB 0x0a
DB 0
RESB 0x7dfe-$
DB 0x55, 0xaa
下面是所用到的Makefile文件:
ucan23ipl.bin: ucan23ipl.nas Makefile
../tolset/z_tools/nask.exe ucan23ipl.nas ucan23ipl.bin ucan23ipl.lst
ucan23.img: ucan23ipl.bin Makefile
../tolset/z_tools/edimg.exe imgin:../tolset/z_tools/fdimg0at.tek \
wbinimg src:ucan23ipl.bin len:512 from:0 to:0 imgout:ucan23.img
asm:
../tolset/z_tools/make.exe -r ucan23ipl.bin
img:
../tolset/z_tools/make.exe -r ucan23.img
run:
../tolset/z_tools/make.exe img
copy ucan23.img ..\tolset\z_tools\qemu\fdimage0.bin
../tolset/z_tools/make.exe -C ../tolset/z_tools/qemu
install:
../tolset/z_tools/make.exe img
../tolset/z_tools/imgtol.com w a: ucan23.img
clean:
-del ucan23ipl.bin
-del ucan23ipl.lst
src_only:
../tolset/z_tools/make.exe clean
-del ucan23.img