boot.asm
org 0x7c00
BaseOfStack equ 0x7c00
StartBootMessage: db "start boot"
label_start:
mov ax,cs
mov ds,ax
mov es,ax
mov ss,ax
mov sp,BaseOfStack
;====== clear screen
mov ax,0600h
mov bx,0700h
mov cx,0
mov dx,0184fh
int 10h
;====== set focus
mov ax,0200h
mov bx,0000h
mov dx,0000h
int 10h
;====== display in screen:start booting
mov ax,1301h
mov bx,000fh
mov dx,0000h
mov cx,10
push ax
mov ax,ds
mov es,ax
pop ax
mov bp,StartBootMessage
int 10h
;====== reset flopy
xor ah,ah
xor dl,dl
int 13h
jmp $
;====== fill zero until whole sector
times 510 - ($ - $$) db 0
dw 0xaa55
bochsrc
floppya: 1_44="boot.img", status=inserted
boot: floppy
命令
bximage
1
fd
1.44MB
boot.img
nasm boot.asm -o boot.bin
dd if=boot.bin of=boot.img bs=512 count=1 conv=notrunc
bochs -f ./bochsrc
c
结果:
为什么?