ISO 9660 read error
Posted: Wed Jul 07, 2010 9:50 am
For some reason, whenever I try to parse a directory entry for ISO 9660, I get 0 for LBA address, and length. I load in the PVD with this code:
and read with this:
All I get is carry set. I'm at a complete loss and I have literally tried everything. It used to work as far as the PVD is concerned, but recently I noticed that cx was used as a loop counter in ReadSectors, and upon fixing that the PVD was not loading.
Code: Select all
LoadPVD:
push cx ; store registers
push bx
push es
mov cx, 4 ; We want one sector
mov eax, 0x10 ; At block 10 - 0-F are reserved
mov bx, PVD_SEG ; Reading to segment 50
mov es, bx
xor bx, bx ; Offset 0
.loop:
inc eax
call ReadSectors
jc .done
mov bx, 0x50
mov es, bx
xor bx, bx
cmp byte [es:bx], 1
jne .loop
.done:
pop es
pop bx ; restore registers and return
pop cx
ret
Code: Select all
ReadSectors:
.MAIN:
push edx
mov di, 5
.SECTORLOOP:
push ds
push dword 0 ;Block number
push eax
push bx ; Read to es:bx
push es
push word cx ; Read in 1 block
push word 10h ; Size: 10h
mov ah, 42h
mov dl, [bsDriveNumber]
push ss
pop ds
mov si, sp
push cx
int 13h ; IBM/MS INT 13 Extensions - EXTENDED READ
pop cx
pop edx
pop bx
pop dx
pop edx
pop edx
pop ds
jc .CONTINUE ; test for read error
cmp ax, 0
je .SUCCESS
.CONTINUE:
dec di ; decrement error counter
jnz .SECTORLOOP ; attempt to read again
.SUCCESS:
pop edx
ret