搜尋此網誌

2012年9月25日 星期二

Int13h AH=05h(格式化磁軌) -- BIOS Int13h

[FLOPPY - FORMAT TRACK]

Input:
AH = 05h
AL = number of sectors to format
CH = track number
DH = head number
DL = drive number
ES:BX -> address field buffer (see Format of floppy format address field buffer entry)

Return:
CF set on error
CF clear if successful
AH = status  (see Values for disk operation status)

Notes:
on AT or higher, call AH=17h first the number of sectors per track is read from the diskette parameter table pointed at by INT 1E.
BUG:
some old Compaq BIOSes have a bug when attempting to call this function from Windows Standard Mode with EMM386 loaded.  A possible workaround is to call this function from Real Mode e.g. through DPMI function "Call Real Mode function with FAR return" (see INT 31/AX=0301h).




[FIXED DISK - FORMAT TRACK]


Input:
AH = 05h
AL = interleave value (XT-type controllers only)
ES:BX -> 512-byte format buffer
the first 2*(sectors/track) bytes contain F,N for each sector
  F = sector type
00h for good sector
20h to unassign from alternate location
40h to assign to alternate location
80h for bad sector
  N = sector number
CH = cylinder number (bits 8,9 in high bits of CL)
CL = high bits of cylinder number (bits 7,6)
DH = head
DL = drive

Return: 
CF set on error
CF clear if successful
AH = status code (see Values for disk operation status)

Notes:
AWARD AT BIOS and AMI 386sx BIOS have been extended to handle more than 1024 cylinders by placing bits 10 and 11 of the cylinder number into bits 6 and 7 of DH 
for XT-type controllers on an AT or higher, AH=0Fh should be called first 
the IBM AT BIOS and many other BIOSes use only the low four bits of DH (head number) since the WD-1003 controller which is the standard AT controller (and the controller that IDE emulates) only supports 16 heads 
not all controller support sector types 20h and 40h
under Windows95, an application must issue a physical volume lock on the drive via INT 21/AX=440Dh before it can successfully write to the disk with this function

沒有留言:

張貼留言