roy@gitpyr.UUCP (Roy Mongiovi) (09/05/85)
The following is a (relatively) complete description of an undocumented DOS function which may be used to write programs which intelligently access disks. With this function programs may be written which operate correctly on diskettes, fixed disks, and ram drives. Four bytes of the table are unidentified for DOS 3, if anyone is running DOS 3.x and can figure out what they represent, please let me (us) know. Thanks. ;;; DOS INTERRUPT 21H, FUNCTION 1FH. GET DEFAULT DRIVE PARAMETER BLOCK. ; ; EXIT (DS:BX) = ADDRESS OF DRIVE PARAMETER BLOCK. ; (THIS JUST INVOKES FUNCTION 32H WITH DL = 0) ;;; DOS INTERRUPT 21H, FUNCTION 32H. GET DRIVE PARAMETER BLOCK. ; ; ENTRY (DL) = DRIVE NUMBER, 0 = DEFAULT, 1 = A, ETC. ; ; EXIT (AL) = 0FFH IF INVALID DRIVE NUMBER, ELSE ; (DS:BX) = ADDRESS OF DRIVE PARAMETER BLOCK. ; STRUCTURE OF DOS DRIVE PARAMETER BLOCK: DPBLOCK STRUCT ;OFFSET DISK_OFFSET DB ? ; 0. DRIVE NUMBER (0 = A, ETC.) UNIT_OFFSET DB ? ; 1. UNIT NUMBER WITHIN DEVICE DRIVER SECTOR_SIZE DW ? ; 2. NUMBER OF BYTES PER SECTOR MAX_CLUSTER DB ? ; 4. LARGEST SECTOR NUMBER IN CLUSTER ; ADD ONE FOR NUMBER OF SECTORS/CLUSTER LOG2_SECTORS DB ? ; 5. LOG BASE TWO OF THE CLUSTER SIZE RESERVED DW ? ; 6. NUMBER OF RESERVED (BOOT) SECTORS FAT_COUNT DB ? ; 8. NUMBER OF COPIES OF THE FAT ROOT_COUNT DW ? ; 9. NUMBER OF ROOT DIRECTORY ENTRIES DATA_START DW ? ; 11. FIRST SECTOR OF DATA ON MEDIUM MAX_NUMBER DW ? ; 13. LARGEST POSSIBLE CLUSTER NUMBER ; SUBTRACT ONE FOR NUMBER OF CLUSTERS FAT_SECTORS DB ? ; 15. NUMBER OF SECTORS IN ONE FAT COPY ROOT_START DW ? ; 16. FIRST SECTOR OF ROOT DIRECTORY DEVICE_ADDR DD ? ; 18. CORRESPONDING DEVICE DRIVER ADDRESS DESCRIPTOR DB ? ; 22. MEDIA DESCRIPTOR BYTE FOR MEDIUM VALID_BYTE DB ? ; 23. 0FFH INDICATES BLOCK MUST BE REBUILT NEXT_BLOCK DD ? ; 24. ADDRESS OF NEXT DEVICE BLOCK IN LIST ; FROM THIS POINT ON, DOS 3 DIFFERS FROM 2: IF DOS2 DIR_START DW ? ; 28. STARTING CLUSTER OF CURRENT DIRECTORY ; ZERO INDICATES THE ROOT DIRECTORY PATH_NAME DB 64 DUP (?) ; 30. ASCIIZ CURRENT DIRECTORY PATH STRING ELSE DOS3 ; ON MY XT, THIS WAS ALWAYS: DW 0 DW 0FFFFH ENDIF DPBLOCK ENDS -- Roy J. Mongiovi. Office of Computing Services. User Services. Georgia Institute of Technology. Atlanta GA 30332. (404) 894-6163 ...!{akgua, allegra, amd, hplabs, ihnp4, masscomp, ut-ngp}!gatech!gitpyr!roy exp(sqrt(-1.0) * 4.0 * atan(1.0)) == -1