Problem reading from USB
Posted: Thu Oct 11, 2012 6:59 am
Im working on my own operating system and have a problem with loading files from a USB flash drive. I am using int13h and ah 42h to read data from the USB, but I can't get it to work.I am trying to read the sector, right after the boot sector. You can see in the code, that I have put the ascii code for the W exactly one byte after the bootsector. I have implemented a jump in case int13h raises the carry flag and have found out that it always does so.Consequently I suspect the problem to be in the formating of my DAP. If someone could help with this problem, I would be very grateful.
Code: Select all
mov ax, 0x000e
mov si, ax
mov ax, 0x07C0
mov ds, ax
mov dl, 0x01
jmp 1
db 0x10
db 0x00
dw 0x0100
dw 0x7D00
dw 0x0000
dw 0x0000
dw 0x0000
dw 0x0000
dw 0x0001
1:
clc
mov ah,0x42
int 0x13
jc fail
mov ah, 0xe
mov al, [0x7D00]
int 0x10
fail:
mov ah,0xe
mov al,"f"
int 0x10
loop:
jmp loop
times 510-($-$$) db 0
db 0x55
db 0xAA
db "W"