diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a5ca103 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.bin diff --git a/boot.asm b/boot.asm new file mode 100644 index 0000000..9f16e25 --- /dev/null +++ b/boot.asm @@ -0,0 +1,18 @@ + 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, 16 ; 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, OS world!" +times 510-($-$$) db 0 ; 填充剩下的空间,使生成的二进制代码恰好为512字节 +dw 0x55aa ; 结束标志 diff --git a/test b/test deleted file mode 100644 index e69de29..0000000