Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > C/C++: Системное программирование и WinAPI > как узнать парметры дискеты


Автор: 31416 30.11.2006, 13:27
Как работая под ДОС узнать размер дискеты вставленной в дисковод - ее параметры количество дорожек,секторов. Подскажите какие функции.
В справке по турбо си нашел ф-ю biosdisk - типа с кодом cmd=8 возвращает информацию о диске - но  каком формате возвращаются данные ни слова! помогите!

Автор: dumb 30.11.2006, 13:39
Цитата(Interrupt List)

INT 13 - DISK - GET DRIVE PARAMETERS (PC,XT286,CONV,PS,ESDI,SCSI)
        AH = 08h
        DL = drive (bit 7 set for hard disk)
Return: CF set on error
            AH = status (07h) (see #00216)
        CF clear if successful
            AH = 00h
            AL = 00h on at least some BIOSes
            BL = drive type (AT/PS2 floppies only) (see #00224)
            CH = low eight bits of maximum cylinder number
            CL = maximum sector number (bits 5-0)
                 high two bits of maximum cylinder number (bits 7-6)
            DH = maximum head number
            DL = number of drives
            ES:DI -> drive parameter table (floppies only)
Notes:  may return successful even though specified drive is greater than the
          number of attached drives of that type (floppy/hard); check DL to
          ensure validity
        for systems predating the IBM AT, this call is only valid for hard
          disks, as it is implemented by the hard disk BIOS rather than the
          ROM BIOS
        Toshiba laptops with HardRAM return DL=02h when called with DL=80h,
          but fail on DL=81h.  The BIOS data at 40h:75h correctly reports 01h.
        may indicate only two drives present even if more are attached; to
          ensure a correct count, one can use AH=15h to scan through possible
          drives
        for BIOSes which reserve the last cylinder for testing purposes, the
          cylinder count is automatically decremented
        on PS/1s with IBM ROM DOS 4, nonexistent drives return CF clear,
          BX=CX=0000h, and ES:DI = 0000h:0000h
        the PC-Tools PCFORMAT program requires that AL=00h before it will
          proceed with the formatting
BUG:    several different Compaq BIOSes incorrectly report high-numbered
          drives (such as 90h, B0h, D0h, and F0h) as present, giving them the
          same geometry as drive 80h; as a workaround, scan through disk
          numbers, stopping as soon as the number of valid drives encountered
          equals the value in 0040h:0075h
SeeAlso: AH=06h"Adaptec",AH=13h"SyQuest",AH=48h,AH=15h,INT 1E
SeeAlso: INT 41"HARD DISK 0"

(Table 00224)
Values for diskette drive type:
 01h    360K
 02h    1.2M
 03h    720K
 04h    1.44M
 05h    ??? (reportedly an obscure drive type shipped on some IBM machines)
        2.88M on some machines (at least AMI 486 BIOS)
 06h    2.88M
 10h    ATAPI Removable Media Device

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)