From 40fafb9b19356de611642597f8279b4f2f7b997f Mon Sep 17 00:00:00 2001 From: Yourtion Date: Fri, 5 Sep 2014 17:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E8=BD=BDharibote.sys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 03_day/haribote.nas | 10 +++++++++- 03_day/ipl10.nas | 12 +++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/03_day/haribote.nas b/03_day/haribote.nas index 96ce171..9a3792c 100644 --- a/03_day/haribote.nas +++ b/03_day/haribote.nas @@ -1,3 +1,11 @@ +; haribote-os +; TAB=4 + + ORG 0xc200 ; 知道程序被装载到内存的地址 + + MOV AL,0x13 ; VGA显卡、320x200x8bit 彩色 + MOV AH,0x00 + INT 0x10 fin: HLT - JMP fin + JMP fin \ No newline at end of file diff --git a/03_day/ipl10.nas b/03_day/ipl10.nas index deb1883..b72c70b 100644 --- a/03_day/ipl10.nas +++ b/03_day/ipl10.nas @@ -77,11 +77,9 @@ next: CMP CH,CYLS JB readloop ; CH < CYLS 跳转到readloop -; 读取完毕,无其他指令进入休眠 - -fin: - HLT ; 让CPU停止,等待指令 - JMP fin ; 无限循环 +; 读取完毕,跳转到haribote.sys执行! + MOV [0x0ff0],CH ; IPLがどこまで読んだのかをメモ + JMP 0xc200 error: MOV SI,msg @@ -96,6 +94,10 @@ putloop: INT 0x10 ; 调用显卡BIOS JMP putloop +fin: + HLT ; 让CPU停止,等待指令 + JMP fin ; 无限循环 + msg: DB 0x0a, 0x0a ; 换行两次 DB "load error"