BIOS INT 13H extension read
Posted: Sun Jun 06, 2010 8:52 am
i've make sure ext int 13h is supported. and i use a usb TF card with FAT32 file system as boot disk.
surely the bootsect is loaded and started up. but then i found it can't read following sectors correctly.
and these are all on real machine(very new).
first, it doesn't print message MSGDSKERR,so maybe no fault in int call.
second, i thought it should be mov si,DAP(a document metioned mostly DI,but one key place is SI)., but strange on and off on screen when i use it
third, does the SEG:OFF mean the lower 16 bits is offset and the higher segment?(i think and did so)
least possibility, BlockNum = 0 means the bootsect, and the bonduary is 64k not 32k,right?
thanks,
lemonyii
surely the bootsect is loaded and started up. but then i found it can't read following sectors correctly.
and these are all on real machine(very new).
Code: Select all
DAP:
PacketSize: db 0
Reserved: db 0
BlockCount: dw 0
BufferAddr: dd 0 ; (segment:offset)
BlockNum: dd 0
dd 0
readsectors: ;read cx sectors start at eax to edi
mov byte [PacketSize],16
mov [BlockCount],cx
mov [BufferAddr],di
shr edi,4
and di,0xf000
mov [BufferAddr+16],di
mov [BlockNum],eax
.read:
mov ah,0x42
mov dl,[BS_DrvNum]
mov di,DAP ;maybe mov si,DAP?
int 0x13
jc fail
ret
fail:
mov si,MSGDSKERR
call printf
jmp $
second, i thought it should be mov si,DAP(a document metioned mostly DI,but one key place is SI)., but strange on and off on screen when i use it
third, does the SEG:OFF mean the lower 16 bits is offset and the higher segment?(i think and did so)
least possibility, BlockNum = 0 means the bootsect, and the bonduary is 64k not 32k,right?
thanks,
lemonyii