;----------------显示字符串----------------------
pntchr2:
lodsb ; 从ds:si装载一个字符到al
or al,al ;
jz endpntchr2 ; 如果 al = 0, 返回
;
mov ah,0x0e ;
mov bx,0x0007 ;
int 0x10 ; 调用bios中断显示字符
jmp pntchr2 ;
;
endpntchr2: ;
ret ; 返回
pntchr2:
lodsb ; 从ds:si装载一个字符到al
or al,al ;
jz endpntchr2 ; 如果 al = 0, 返回
;
mov ah,0x0e ;
mov bx,0x0007 ;
int 0x10 ; 调用bios中断显示字符
jmp pntchr2 ;
;
endpntchr2: ;
ret ; 返回
start2msg db 13,10, 'init system...',0
;times 1474560 - ($ - $$) db 0 ; 1.44m 编译成镜像文件可以在viturlpc /vmware中使用
用命令行方式:
nasm boot.asm -o boot.img
nasm other.asm -o other.img
partcopy other.img 0 200 boot.img 200
nasm boot.asm -o boot.img
nasm other.asm -o other.img
partcopy other.img 0 200 boot.img 200
把boot.img和other.img合并成一个文件