Exception On Read Sector
Posted: Thu Mar 05, 2009 11:30 am
Ok, I don't see where an exception would occur here unless there is a divide by 0.
qemu log:
Ok, I thought there was really something stupid or inefficient in the way I store it. Or am I just not using the right int to get the right drive parameters for LBA to CHS? Checking parameters doesn't fail so, I think maybe I'm not storing it's out put correctly?
qemu log:
Here is how I store the driver parameters:IN:
0x00007c61: divw 31907
0x00007c65: inc %dx
0x00007c66: mov %dl,31911
0x00007c6a: mov 31906,%cl
0x00007c6e: div %cx
0x00007c70: mov %dl,31909
0x00007c74: mov %al,0x7ca6
0x00007c77: mov $0x2,%ah
0x00007c79: pop %cx
0x00007c7a: mov %cl,%al
0x00007c7c: mov 31909,%ch
0x00007c80: mov 31911,%cl
0x00007c84: mov 31910,%dh
0x00007c88: mov 31905,%dl
0x00007c8c: mov 31912,%bx
0x00007c90: int $0x13
Servicing hardware INT=0x08
Code: Select all
mov ah,0x08
mov dl,BYTE [drive]
int 0x13 ; get drive parameters
jc FAIL ;did this faiL?
;else store info for LBA TO CHS
mov BYTE [HPC], dh ;//store heads per cylinder
mov ax,0 ;; start counter for all the bits
testandset: ; tests and sets all the sector bits in cl
bt cx,ax ; test bit
jc set ; is the bit set? if yes set it in SPT
inc ax ; if no go to next bit and test set
test ax,6
je continue ;if we are finished, continue with the rest of the code
jmp testandset
set:
bts WORD [SPT],ax
inc ax
test ax,6
je continue ;if done setting, continue