Code: Select all
; haribote-ipl
; TAB=4
CYLS EQU 4
ORG 0x7c00
JMP entry
DB 0x90
DB "HARIBOTE"
DW 512
DB 1
DW 1
DB 2
DW 224
DW 2880
DB 0xf0
DW 9
DW 18
DW 2
DD 0
DD 2880
DB 0,0,0x29
DD 0xffffffff
DB "HARIBOTEOS "
DB "FAT12 "
RESB 18
entry:
MOV AX,0
MOV SS,AX
MOV SP,0x7c00
MOV DS,AX
;read disk
MOV AX,0x0820
MOV ES,AX
MOV CH,0 ; cylinder 0
MOV DH,0 ; head0
MOV CL,2 ; sect 2
readloop:
MOV SI,0
retry:
MOV AH,0x02
MOV AL,1
MOV BX,0
MOV DL,0x80
INT 0x13
JNC next
ADD SI,1
CMP SI,5
JAE error
MOV AH,0x00
MOV DL,0x80 ; C disk
INT 0x13
JMP retry
next:
MOV AX,ES ;add 0x200
ADD AX,0x0020
MOV ES,AX
ADD CL,1
CMP CL,63
JBE readloop ; CL <= 17 go to readloop
MOV CL,1
ADD DH,1
CMP DH,16
JB readloop
MOV DH,0
ADD CH,1
CMP CH,CYLS
JB readloop
; jump to sys files
MOV [0x0ff0],CH
JMP 0xc200
error:
MOV SI,msg
putloop:
MOV AL,[SI]
ADD SI,1
CMP AL,0
JE fin
MOV AH,0x0e
MOV BX,15
INT 0x10
JMP putloop
fin:
HLT
JMP fin
msg:
DB 0x0a, 0x0a
DB "load error"
DB 0x0a
DB 0
RESB 0x7dfe-$
DB 0x55, 0xaa
has an error at 'int 0x13' for hard disk,below is my bochs config for hard disk.
Code: Select all
ata0-master: type=disk, mode=flat, path=woods.img, cylinders=1024, heads=16, spt=63
ray