forked from yourtion/30dayMakeOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cmd.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
# デフォルト動作 | ||
|
||
default : | ||
../z_tools/make.exe img | ||
|
||
# ファイル生成規則 | ||
|
||
ipl.bin : ipl.nas Makefile | ||
../z_tools/nask.exe ipl.nas ipl.bin ipl.lst | ||
|
||
helloos.img : ipl.bin Makefile | ||
../z_tools/edimg.exe imgin:../z_tools/fdimg0at.tek \ | ||
wbinimg src:ipl.bin len:512 from:0 to:0 imgout:helloos.img | ||
|
||
# コマンド | ||
|
||
asm : | ||
../z_tools/make.exe -r ipl.bin | ||
|
||
img : | ||
../z_tools/make.exe -r helloos.img | ||
|
||
run : | ||
../z_tools/make.exe img | ||
copy helloos.img ..\z_tools\qemu\fdimage0.bin | ||
../z_tools/make.exe -C ../z_tools/qemu | ||
|
||
install : | ||
../z_tools/make.exe img | ||
../z_tools/imgtol.com w a: helloos.img | ||
|
||
clean : | ||
-del ipl.bin | ||
-del ipl.lst | ||
|
||
src_only : | ||
../z_tools/make.exe clean | ||
-del helloos.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
; hello-os | ||
; TAB=4 | ||
|
||
ORG 0x7c00 ; このプログラムがどこに読み込まれるのか | ||
|
||
; 以下は標準的なFAT12フォーマットフロッピーディスクのための記述 | ||
|
||
JMP entry | ||
DB 0x90 | ||
DB "HELLOIPL" ; ブートセクタの名前を自由に書いてよい(8バイト) | ||
DW 512 ; 1セクタの大きさ(512にしなければいけない) | ||
DB 1 ; クラスタの大きさ(1セクタにしなければいけない) | ||
DW 1 ; FATがどこから始まるか(普通は1セクタ目からにする) | ||
DB 2 ; FATの個数(2にしなければいけない) | ||
DW 224 ; ルートディレクトリ領域の大きさ(普通は224エントリにする) | ||
DW 2880 ; このドライブの大きさ(2880セクタにしなければいけない) | ||
DB 0xf0 ; メディアのタイプ(0xf0にしなければいけない) | ||
DW 9 ; FAT領域の長さ(9セクタにしなければいけない) | ||
DW 18 ; 1トラックにいくつのセクタがあるか(18にしなければいけない) | ||
DW 2 ; ヘッドの数(2にしなければいけない) | ||
DD 0 ; パーティションを使ってないのでここは必ず0 | ||
DD 2880 ; このドライブ大きさをもう一度書く | ||
DB 0,0,0x29 ; よくわからないけどこの値にしておくといいらしい | ||
DD 0xffffffff ; たぶんボリュームシリアル番号 | ||
DB "HELLO-OS " ; ディスクの名前(11バイト) | ||
DB "FAT12 " ; フォーマットの名前(8バイト) | ||
RESB 18 ; とりあえず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 ; SIに1を足す | ||
CMP AL,0 | ||
JE fin | ||
MOV AH,0x0e ; 一文字表示ファンクション | ||
MOV BX,15 ; カラーコード | ||
INT 0x10 ; ビデオBIOS呼び出し | ||
JMP putloop | ||
fin: | ||
HLT ; 何かあるまでCPUを停止させる | ||
JMP fin ; 無限ループ | ||
|
||
msg: | ||
DB 0x0a, 0x0a ; 改行を2つ | ||
DB "hello, world" | ||
DB 0x0a ; 改行 | ||
DB 0 | ||
|
||
RESB 0x7dfe-$ ; 0x7dfeまでを0x00で埋める命令 | ||
|
||
DB 0x55, 0xaa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 |