1) By probing the device and asking for its supported LBA addressing modes.
2) I don't think you can. You can always create a function that translates LBA addresses to CHS and sends them to the floppy drive. You will fool yourself with it but it might make you happy.
3) What?
4) By probing the device. You can read T13.org documentations about IDE and ATA. For floppy drives, you can use the CMOS.
To detect the available floppy drivers for example, you can use the below function that I have written:
Code: Select all
; ——————————————————————————————————————————————————
__FloppyDetectAvailableDrives:
; DWORD __FloppyDetectAvailableDrives (void); StdCall;
FDAD_DRIVE0_IS_AVAILABLE EQU 0x00000001
FDAD_DRIVE1_IS_AVAILABLE EQU 0x00000002
PUSH EDX
INVOKE __CMOSRead, CMOS_INDEX_FLOPPYDISKDRIVETYPES
TEST EAX , 0x000000F0 ; Drive 0
SETNZ DL
TEST EAX , 0x0000000F ; Drive 1
SETNZ DH
; DL = Drive0
; DH = Drive1
MOV EAX , EDX
SHR EAX , 0x00000007
AND EDX , 0x00000001
OR EAX , EDX
POP EDX
RET
The __CMOSRead is defined in this way:
Code: Select all
__CMOSRead:
; DWORD __CMOSRead (DWORD CMOSIndex); StdCall;
PUSHFD
CLI
MOV EAX , DWORD PTR [ESP + 0x08] ; CMOSIndex
OUT CMOS_PORT_WRITE , AL
TIMES 0x04 NOP
XOR EAX , EAX
IN AL , CMOS_PORT_READ
POPFD
RET 0x04
You can find more information by searching in Google.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.