Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!hplabs!hp-pcd!hpcvlx!bill From: bill@hpcvlx.HP.COM (Bill Frolik) Newsgroups: comp.sys.ibm.pc Subject: Re: What is the fastest disk access method on AT? Message-ID: <101000015@hpcvlx.HP.COM> Date: 26 Oct 88 14:52:45 GMT References: <211@focsys.UUCP> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 80 The simplest thing to do is replace your Int 25h and Int 26h calls with calls to BIOS Int 13h functions 2 and 3, which is basically what DOS does with your 25h/26h requests after adding a layer of buffering and converting your absolute sector request into an equivalent cylinder, head, and sector number. So you don't have to look it up in your tech ref manual, the following four Int 13h functions are probably all you need. Remember that the first hard disk in your system is drive number 80h, and that sector numbers start at 1, not 0. Also, be sure to check error status after each function; as long as AH keeps coming back zero, you're okay. RESET DISK Resets the controller and recalibrate to track 0. Specify: AH = 0 DL = Drive unit number Returns: AH = Error status GET PARAMETERS Get information about the drive specified in DL. Specify: AH = 8 DL = Drive unit number Returns: AH = Error status CH = Max cylinder number CL = Sectors per track DH = Max head number ES:DI = Pointer to disk parameter table (I don't have the table in front of me, but I think it contains somewhere the number of bytes per sector in addition to all this other information. Normal DOS disk sectors are 512 bytes long, but sometimes folks use larger values on hard disks to "break" the 32M limit.) READ SECTOR(S) Read one or more sectors from the disk. Specify: AH = 2 AL = Number of sectors to read CH = Cylinder number (0-n) CL = Sector number (1-n) DH = Head number (0-n) DL = Drive unit number ES:BX = Address of data buffer Returns: AH = Error status AL = Number of sectors actually read WRITE SECTOR(S) Write one or more sectors to the disk. Specify: AH = 3 AL = Number of sectors to write CH = Cylinder number (0-n) CL = Sector number (1-n) DH = Head number (0-n) DL = Drive unit number ES:BX = Address of data buffer Returns: AH = Error status AL = Number of sectors actually written Error codes: 00 - No error 01 - Bad command or drive number 02 - Address mark not found 03 - Write protect violation 04 - Sector not found 05 - Reset failed 06 - Disk change error (floppies only) 08 - DMA overrun on last operation 09 - DMA overrun 0C - Track/sector combination not supported 10 - Bad CRC on floppy read 20 - Controller failure 40 - Seek failure 80 - Timeout ----------------------------------- Bill Frolik / hp-pcd!bill Hewlett-Packard / Corvallis, Oregon