阅读:1501回复:8
有谁知道8.4G以上硬盘访问接口及主分区管理办法?
LBA最多只能管理63*255*1024*512=8,422,686,720Byte大小硬盘. 硬盘主分区表也使用同样方法.
那8.4G以上硬盘是如何管理的? 谢谢! |
|
最新喜欢:aasa2
|
沙发#
发布于:2002-05-03 02:08
对于大于8。4G的硬盘用的是逻辑扇区号来计算的!在分区表的一项里面有一个代表的是当前项分区的逻辑扇区数,还有一项代表的是当前分区之前的逻辑扇区数!本站好象有文章介绍的!
|
|
板凳#
发布于:2002-05-03 14:03
那BIOS接口又用哪些参数呢?
谢谢! |
|
|
地板#
发布于:2002-05-09 21:03
C++只回答了一半所以只给5分,不要介意!
谢谢! :D :D :D |
|
|
地下室#
发布于:2002-05-09 21:15
BIOS扩展INT13可访问大于8.4G以上的硬盘。另外你的计算公式是CHS
不是LBA。LBA方式对硬盘扇区从0开始连续编号,在ATA5标准下最大可达2的28次方个扇区,在ATA6以上的标准中更多。 |
|
|
5楼#
发布于:2002-05-09 21:19
请问扩展INT13的INTERFACE如何?
AX: BX: CX: DX: 谢谢! |
|
|
6楼#
发布于:2002-05-09 21:28
很抱歉,我是爬虫,不会加附件。将扩展INT13的内容贴给你。旧版的程序员大本营光盘中有。
--------d-1341--BX55AA----------------------- INT 13 - IBM/MS INT 13 Extensions - INSTALLATION CHECK AH = 41h BX = 55AAh DL = drive (80h-FFh) Return: CF set on error (extensions not supported) AH = 01h (invalid function) CF clear if successful BX = AA55h if installed AH = major version of extensions 01h = 1.x 20h = 2.0 / EDD-1.0 21h = 2.1 / EDD-1.1 30h = EDD-3.0 AL = internal use CX = API subset support bitmap (see #00271) DH = extension version (v2.0+ ??? -- not present in 1.x) Note: the Phoenix Enhanced Disk Drive Specification v1.0 uses version 2.0 of the INT 13 Extensions API SeeAlso: AH=42h\"INT 13 Ext\",AH=48h\"INT 13 Ext\" Bitfields for IBM/MS INT 13 Extensions API support bitmap: Bit(s) Description (Table 00271) 0 extended disk access functions (AH=42h-44h,47h,48h) supported 1 removable drive controller functions (AH=45h,46h,48h,49h,INT 15/AH=52h) supported 2 enhanced disk drive (EDD) functions (AH=48h,AH=4Eh) supported extended drive parameter table is valid (see #00273,#00278) 3-15 reserved (0) --------c-1341------------------------------- INT 13 U - QUICKCACHE II v4.20 - SAVE/RESTORE ??? AH = 41h AL = direction 01h save to file else restore from file ES:DI -> 1024-byte buffer for ??? Return: AX = status (0000h successful, 8000h failed) Program: QUICKCACHE II is a shareware disk cache by P.R. Glassel and Associates, Inc. SeeAlso: AH=40h\"QUICKCACHE\" --------d-1342------------------------------- INT 13 - IBM/MS INT 13 Extensions - EXTENDED READ AH = 42h DL = drive number DS:SI -> disk address packet (see #00272) Return: CF clear if successful AH = 00h CF set on error AH = error code (see #00234) disk address packet\'s block count field set to number of blocks successfully transferred SeeAlso: AH=02h,AH=41h\"INT 13 Ext\",AH=43h\"INT 13 Ext\" Format of disk address packet: Offset Size Description (Table 00272) 00h BYTE 10h (size of packet) 01h BYTE reserved (0) 02h WORD number of blocks to transfer (max 007Fh for Phoenix EDD) 04h DWORD -> transfer buffer 08h QWORD starting absolute block number (for non-LBA devices, compute as (Cylinder*NumHeads + SelectedHead) * SectorPerTrack + SelectedSector - 1 --------N-134257DX1234----------------------- INT 13 U - Beame&Whiteside BWLPD - INSTALLATION CHECK AX = 4257h (\"BW\") DX = 1234h Return: BX = 414Ch if installed Program: BWLPD is the printer daemon from the BW-NFS package SeeAlso: INT 62/AH=00h\"ETHDEV\" --------d-1343------------------------------- INT 13 - IBM/MS INT 13 Extensions - EXTENDED WRITE AH = 43h AL = write flags ---v1.0,2.0--- bit 0: verify write bits 7-1 reserved (0) ---v2.1+ --- 00h,01h write without verify 02h write with verify DL = drive number DS:SI -> disk address packet (see #00272) Return: CF clear if successful AH = 00h CF set on error AH = error code (see #00234) disk address packet\'s block count field set to number of blocks successfully transferred Note: the BIOS returns CF set/AH=01h (invalid function) if verify is requested but not supported SeeAlso: AH=03h,AH=41h\"INT 13 Ext\",AH=42h\"INT 13 Ext\",AH=44h --------d-1344------------------------------- INT 13 - IBM/MS INT 13 Extensions - VERIFY SECTORS AH = 44h DL = drive number DS:SI -> disk address packet (see #00272) Return: CF clear if successful AH = 00h CF set on error AH = error code (see #00234) disk address packet\'s block count field set to number of blocks successfully verified SeeAlso: AH=04h,AH=41h\"INT 13 Ext\",AH=42h\"INT 13 Ext\",AH=47h --------d-1345------------------------------- INT 13 - IBM/MS INT 13 Extensions - LOCK/UNLOCK DRIVE AH = 45h AL = operation 00h lock media in drive 01h unlock media 02h check lock status DL = drive number Return: CF clear if successful AH = 00h AL = lock state (00h = unlocked) CF set on error AH = error code (see #00234) Notes: this function is required to be supported for any removable drives numbered 80h or higher up to 255 locks may be placed on a drive, and the media will not be physically unlocked until all locks have been removed SeeAlso: AH=41h\"INT 13 Ext\",AH=46h,AH=49h,INT 15/AH=52h\"INT 13 Extensions\" --------d-1346------------------------------- INT 13 - IBM/MS INT 13 Extensions - EJECT MEDIA AH = 46h AL = 00h (reserved) DL = drive number Return: CF clear if successful AH = 00h CF set on error AH = error code (see #00234) SeeAlso: AH=49h,INT 15/AH=52h\"INT 13 Extensions\" --------d-1347------------------------------- INT 13 - IBM/MS INT 13 Extensions - EXTENDED SEEK AH = 47h DL = drive number DS:SI -> disk address packet (see #00272) Return: CF clear if successful AH = 00h CF set on error AH = error code (see #00234) SeeAlso: AH=0Ch,AH=42h\"INT 13 Ext\" --------d-1348------------------------------- INT 13 - IBM/MS INT 13 Extensions - GET DRIVE PARAMETERS AH = 48h DL = drive (80h-FFh) DS:SI -> buffer for drive parameters (see #00273) Return: CF clear if successful AH = 00h DS:SI buffer filled CF set on error AH = error code (see #00234) 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=08h,AH=41h,AH=49h,MEM 0040h:0075h Format of IBM/MS INT 13 Extensions drive parameters: Offset Size Description (Table 00273) 00h WORD (call) size of buffer (001Ah for v1.x, 001Eh for v2.x, 42h for v3.0) (ret) size of returned data 02h WORD information flags (see #00274) 04h DWORD number of physical cylinders on drive 08h DWORD number of physical heads on drive 0Ch DWORD number of physical sectors per track 10h QWORD total number of sectors on drive 18h WORD bytes per sector ---v2.0+ --- 1Ah DWORD -> EDD configuration parameters (see #00278) FFFFh:FFFFh if not available ---v3.0 --- 1Eh WORD signature BEDDh to indicate presence of Device Path info 20h BYTE length of Device Path information, including signature and this byte (24h for v3.0) 21h 3 BYTEs reserved (0) 24h 4 BYTEs ASCIZ name of host bus (\"ISA\" or \"PCI\") 28h 8 BYTEs ASCIZ name of interface type \"ATA\" \"ATAPI\" \"SCSI\" \"USB\" \"1394\" IEEE 1394 (FireWire) \"FIBRE\" Fibre Channel 30h 8 BYTEs Interface Path (see #00275) 38h 8 BYTEs Device Path (see #00276) 40h BYTE reserved (0) 41h BYTE checksum of bytes 1Eh-40h (two\'s complement of sum, which makes the 8-bit sum of bytes 1Eh-41h equal 00h) Note: if the size is less than 30 on call, the final DWORD will not be returned by a v2.x implementation; similarly for the Device Path info SeeAlso: #00277,#03196 Bitfields for IBM/MS INT 13 Extensions information flags: Bit(s) Description (Table 00274) 0 DMA boundary errors handled transparently 1 cylinder/head/sectors-per-track information is valid 2 removable drive 3 write with verify supported 4 drive has change-line support (required if drive >= 80h is removable) 5 drive can be locked (required if drive >= 80h is removable) 6 CHS information set to maximum supported values, not current media 15-7 reserved (0) SeeAlso: #00273 Format of EDD v3.0 Interface Path: Offset Size Description (Table 00275) ---ISA--- 00h WORD 16-bit base address 02h 6 BYTEs reserved (0) ---PCI--- 00h BYTE PCI bus number 01h BYTE PCI device number 02h BYTE PCI function number 03h 5 BYTEs reserved (0) SeeAlso: #00273,#00276 Format of EDD v3.0 Device Path: Offset Size Description (Table 00276) ---ATA--- 00h BYTE flag: 00h = master, 01h = slave 01h 7 BYTEs reserved (0) ---ATAPI--- 00h BYTE flag: 00h = master, 01h = slave 01h BYTE logical unit number 02h 6 BYTEs reserved (0) ---SCSI--- 00h BYTE logical unit number 01h 7 BYTEs reserved (0) ---USB--- 00h BYTE to be determined 01h 7 BYTEs reserved (0) ---IEEE1394--- 00h QWORD 64-bit FireWire General Unique Identifier (GUID) ---FibreChannel--- 00h QWORD Word Wide Number (WWN) SeeAlso: #00273,#00275 Format of Phoenix Enhanced Disk Drive Spec translated drive parameter table: Offset Size Description (Table 00277) 00h WORD number of cylinders 02h BYTE number of heads 03h BYTE A0h (signature indicating translated table) 04h BYTE number of physical sectors per track 05h WORD starting write precompensation cylinder number 07h BYTE reserved 08h BYTE control byte (see #03198 at INT 41\"DISK 0\") 09h WORD number of physical cylinders 0Bh BYTE number of physical heads 0Ch WORD cylinder number of landing zone 0Eh BYTE number of logical sectors per track 0Fh BYTE checksum Program: the Phoenix Enhanced Disk Drive Specification is an addition to the IBM/MS INT 13 extensions SeeAlso: #00278,#03196 Format of Phoenix Enhanced Disk Drive Spec Fixed Disk Parameter Table: Offset Size Description (Table 00278) 00h WORD physical I/O port base address 02h WORD disk-drive control port address 04h BYTE drive flags (see #00279) 05h BYTE proprietary information bits 7-4 reserved (0) bits 3-0: Phoenix proprietary (used by BIOS) 06h BYTE IRQ for drive (bits 3-0; bits 7-4 reserved and must be 0) 07h BYTE sector count for multi-sector transfers 08h BYTE DMA control bits 7-4: DMA type (0-2) as per ATA-2 specification bits 3-0: DMA channel 09h BYTE programmed I/O control bits 7-4: reserved (0) bits 3-0: PIO type (1-4) as per ATA-2 specification 0Ah WORD drive options (see #00280) 0Ch 2 BYTEs reserved (0) 0Eh BYTE extension revision level (high nybble=major, low nybble=minor) (currently 10h for v1.0 and 11h for v1.1-3.0) 0Fh BYTE 2\'s complement checksum of bytes 00h-0Eh 8-bit sum of all bytes 00h-0Fh should equal 00h SeeAlso: #00277 Bitfields for Phoenix Enhanced Disk Drive Spec drive flags: Bit(s) Description (Table 00279) 7 reserved (1) 6 LBA enabled 5 reserved (1) 4 drive is slave 3-0 reserved (0) SeeAlso: #00278,#00280 Bitfields for Phoenix Enhanced Disk Drive Spec drive options: Bit(s) Description (Table 00280) 0 fast PIO enabled 1 fast DMA access enabled 2 block PIO (multi-sector transfers) enabled 3 CHS translation enabled 4 LBA translation enabled 5 removable media 6 ATAPI device (CD-ROM) 7 32-bit transfer mode ---v1.1+ --- 8 ATAPI device uses DRQ to signal readiness for packet command (must be 0 if bit 6 is 0) 10-9 translation type (must be 00 if bit 3 is 0) 00 Phoenix bit-shifting translation 01 LBA-assisted translation 10 reserved 11 proprietary translation ---v3.0--- 11 Ultra DMA access enabled 15-12 reserved SeeAlso: #00278,#00279 --------d-1349------------------------------- INT 13 - IBM/MS INT 13 Extensions - EXTENDED MEDIA CHANGE AH = 49h DL = drive number Return: CF clear if media has not changed AH = 00h CF set if media may have changed AH = 06h (see #00234) Note: unlike AH=16h, any drive number may be specified SeeAlso: AH=16h,AH=41h\"INT 13 Ext\",AH=46h --------d-134A------------------------------- INT 13 - Bootable CD-ROM - INITIATE DISK EMULATION AH = 4Ah AL = 00h DS:SI -> specification packet (see #00281) Return: CF clear if successful CF set on error (drive will not be in emulation mode) AX = return codes SeeAlso: AH=48h,AX=4B00h,AH=4Ch,AH=4Dh Format of Bootable CD-ROM Specification Packet: Offset Size Description (Table 00281) 00h BYTE size of packet in bytes (13h) 01h BYTE boot media type (see #00282) 02h BYTE drive number 00h floppy image 80h bootable hard disk 81h-FFh nonbootable or no emulation 03h BYTE CD-ROM controller number 04h DWORD Logical Block Address of disk image to emulate 08h WORD device specification (see also #00282) (IDE) bit 0: drive is slave instead of master (SCSI) bits 7-0: LUN and PUN bits 15-8: bus number 0Ah WORD segment of 3K buffer for caching CD-ROM reads 0Ch WORD load segment for initial boot image if 0000h, load at segment 07C0h 0Eh WORD number of 512-byte virtual sectors to load (only valid for AH=4Ch) 10h BYTE low byte of cylinder count (for INT 13/AH=08h) 11h BYTE sector count, high bits of cylinder count (for INT 13/AH=08h) 12h BYTE head count (for INT 13/AH=08h) SeeAlso: #00283,AH=08h Bitfields for Bootable CD-ROM boot media type: Bit(s) Description (Table 00282) 3-0 media type 0000 no emulation 0001 1.2M diskette 0010 1.44M diskette 0011 2.88M diskette 0100 hard disk (drive C:) other reserved 5-4 reserved (0) 6 image contains ATAPI driver 7 image contains SCSI driver(s) SeeAlso: #00281 --------d-134B00----------------------------- INT 13 - Bootable CD-ROM - TERMINATE DISK EMULATION AX = 4B00h DL = drive number or 7Fh to terminate all emulations DS:SI -> empty specification packet (see #00281) Return: CF clear if successful CF set on error (drive will still be in emulation mode) AX = return codes DS:SI specification packet filled SeeAlso: AH=48h,AH=4Ah,AX=4B00h,AH=4Ch,AH=4Dh --------d-134B01----------------------------- INT 13 - Bootable CD-ROM - GET STATUS AX = 4B01h DL = drive number DS:SI -> empty specification packet (see #00281) Return: CF clear if successful CF set on error AX = return codes DS:SI specification packet filled Note: same as AX=4B00h, but does not terminate emulation SeeAlso: AH=48h,AH=4Ah,AX=4B00h,AH=4Ch,AH=4Dh --------d-134C------------------------------- INT 13 - Bootable CD-ROM - INITIATE DISK EMULATION AND BOOT AH = 4Ch AL = 00h DS:SI -> specification packet (see #00281) Return: never, if successful CF set (error while attempting to boot) AX = error codes SeeAlso: AH=48h,AH=4Ah,AX=4B00h,AH=4Dh --------d-134D00----------------------------- INT 13 - Bootable CD-ROM - RETURN BOOT CATALOG AX = 4D00h DS:SI -> command packet (see #00283) Return: CF clear if successful CF set on error AX = return codes SeeAlso: AH=48h,AH=4Ah,AX=4B00h,AH=4Ch Format of Bootable CD-ROM \"get boot catalog\" command packet: Offset Size Description (Table 00283) 00h BYTE size of packet in bytes (08h) 01h BYTE number of sectors of boot catalog to read 02h DWORD -> buffer for boot catalog 06h WORD first sector in boot catalog to transfer SeeAlso: #00281 --------d-134E------------------------------- INT 13 - IBM/MS INT 13 Extensions v2.1 - SET HARDWARE CONFIGURATION AH = 4Eh AL = function 00h enable prefetch 01h disable prefetch 02h set maximum PIO transfer mode 03h set PIO mode 0 04h set default PIO transfer mode 05h enable INT 13 DMA maximum mode 06h disable INT 13 DMA DL = drive number Return: CF clear if successful AH = 00h AL = status 00h command was safe (only affected specified drive) 01h other devices are affected CF set on error AH = error code (see #00234) Note: DMA and PIO modes are mutually exclusive, so selecting DMA disables PIO (for either the specified device or all devices on that controller), and selecting PIO disables DMA SeeAlso: AH=41h\"INT 13 Extensions\",AX=5001h\"Enhanced Disk Drive\" |
|
|
7楼#
发布于:2002-05-09 21:44
电脑编程技巧与维护上有一篇很详细的文章 去年的:P
|
|
8楼#
发布于:2002-05-17 17:54
LBA mode方法:
中断INT 13H的扩展功能 由于旧有的INT 13H中断只能采用10位二进制来表示磁道,所以对于大于8.4G的硬盘它已不能 完全读写了。扩展INT 13H又称为INT 13 Extension APIs,它主要就是用来对超过1024个磁道 的硬盘进行读写的。 1.数据结构(Data Structure) 该数据结构是提供给扩展INT 13H使用的,它是建立在逻辑扇号之上的,具体结构如下: disk_addr_pkt struc ; 磁盘地址包 packet_size db 16 ; 磁盘参数包的尺寸,必须为10H reserved db 0 ; 保留,必须为零 block_count dw ? ; 传输的扇区数 buffer_addr dd ? ; 内存缓冲区地址(段:偏移) block_num dq ? ; 起始绝对扇区号(即起始扇区的LBA号码) disk_addr_pkt ends 结构中前两项是固定的,用到的是后三项。起始绝对扇区号即前面讲到的逻辑扇区号,从0开 始编号。 2.扩展读的功能 入口: AH=42H DL=驱动器号(硬盘是80H) DS:SI=磁盘地址包(即前面的数据结构的地址) 出口: 成功则 CF=0, AH=0 失败则 CF=1, AH=错误码 3.扩展写的功能 入口: AH=43H AL =0 (不校验) =1(校验) DL=驱动器号 DS:SI=磁盘地址包 出口: 成功则 CF=0, AH=0 失败则 CF=1, AH=错误码 注:一般取AL=0。 4.获得驱动器参数 入口: AH=48H DL=驱动器号 DS:SI=返回结果的地址 出口: 成功则 CF=0, AH=0 DS:SI指向返回数据结构的地址: Info_size dw 26 ;缓冲区的大小 Flags dw ? ;信息标志 Cylinders dd ? ;number of cylinders on disk Heads dd ? ;number of heads on disk Sec_per_track dd ? ;number of sectors per track Sectors dq ? ;number of sectors on requested disk Sector_size dw ? ;number of bytes per sector 失败则 CF=1, AH=错误码 错误码的定义与原来的相同,增加的几个在此用不到。 |
|