Int 13h 42h error
Posted: Sat Mar 07, 2015 8:48 am
Decided to rewrite my bootsector for many reasons (loss of source code for bootloaders were one of them)
However, I ran into an issue I can't seem to understand why, there is no further explanation of the problem and it works on all emulators, this error only occurs on real hardware:
Error code 02 -> Address mark not found
My readsector function:
And this is my Disk Package:
However, I ran into an issue I can't seem to understand why, there is no further explanation of the problem and it works on all emulators, this error only occurs on real hardware:
Error code 02 -> Address mark not found
My readsector function:
Code: Select all
ReadSector2:
; Error Counter
.Start:
mov di, 5
.sLoop:
; Save states
push ax
push bx
push cx
mov word [DiskPackage.Segment], es
mov word [DiskPackage.Offset], bx
mov word [DiskPackage.Sector], ax
mov word [DiskPackage.SectorsToRead], 1
mov ax, 0x4200
mov dl, byte [bPhysicalDriveNum]
mov si, DiskPackage
int 0x13
jnc .Success
.Fail:
xor ax, ax
int 0x13
dec di
pop cx
pop bx
pop ax
jnz .sLoop
; Give control to next OS, we failed
int 0x18
.Success:
; Next sector
pop cx
pop bx
pop ax
add bx, word [wBytesPerSector]
jno .SkipEs
mov dx, es
add dh, 0x10
mov es, dx
.SkipEs:
inc ax
loop .Start
; Done
ret
Code: Select all
; This is used for the extended read function (int 0x13)
DiskPackage: db 0x10
db 0
.SectorsToRead dw 1
.Offset dw 0x0500
.Segment dw 0x0000
.Sector dq 0