原创 (翻译和注解)“El Torito”可引导CD-ROM格式规范V1.0

2010-8-17 19:40 3595 7 7 分类: 工程师职场

(翻译和注解)“El Torito”可引导CD-ROM格式规范V1.0


花了很多精力翻译。


PDF文档可免费在


http://wenku.baidu.com/view/b365060e52ea551810a6877e.html


下载


 


 


“El Torito” Bootable CD-ROM Format Specification
Version 1.0
(翻译和注解)“El Torito”可引导CD-ROM格式规范V1.0
翻译和注解:wxleasyland(wxlwww@gmail.com)
2010年8月


1.0 Overview
This specification defines how makers of CD-ROMs can package several "images" of floppy and hard disks on a single CD with the ability to catalog these images and to selectively boot from any single image.
这个规范定义了CDROM的制造商如何将一些软驱和硬盘的镜像包装到一张CD上去,并有能力列出这些镜像和从任何单个镜像选择性引导。


The possibility of booting a PC from a CD ROM has raised several possibilities, including:
从CDROM引导PC的可能性引出一些可能性,包括:
1. Self-configuring CD-ROMs that manage their own resources, including operating systems and drivers        自配置CDROM,管理它们自已的资源,包括操作系统和驱动程序。
2. The embedding of multiple operating systems and drivers on the same CD-ROM for a variety of applications, e.g., multi-language     多操作系统和驱动程序集成在同一CDROM中来用于各种应用,如多语言
3. The ability of the end user to select which operating system to boot    让用户选择引导哪一个操作系统的能力
4. Copy protection for the CD ROM software and data      CDROM软件和数据的拷贝保护


To accomplish this facility, there are currently two available technologies:
为达到这种易用性,有2种可用的技术
1. DOS-based drivers (e.g., SCSI or ATAPI)    基于DOS的驱动程序(如SCSI或ATAPI)
2. The system BIOS.            系统BIOS


Attempting to use DOS-based drivers (e.g., SCSI or ATAPI) to boot from a CD ROM creates a number of problems such as resource conflicts and inordinate use of memory.
尝试利用基于DOS的驱动程序(如SCSI或ATAPI)来从CDROM引导,会引起了许多的问题,例如资源冲突和内存使用混乱。


The BIOS, however, avoids these problems and offers other advantages, including:
而BIOS,则避免了这些问题并且提供了其它的优点,包括:
1. Can boot from a variety of operating systems by accessing a Boot Catalog on the CD-ROM.可以从一系列操作系统中引导,通过访问CDROM上的“引导目录”
2. Offers the choice of configuring the CD ROM as a hard disk (C: or D or floppy (A.  提供将CDROM配置为一个硬盘(C: or D或软盘(A的选择
3. Renames existing drives when necessary.  当有需要时,重命名已经存在的驱动器
4. Uses existing BIOS technology (Logical Block Access) to access code and data. 使用已存在的BIOS技术(LBA)来访问代码和数据
5. Compatible with all DOS and Windows applications using INT 13 functions.  和所有使用INT13功能的DOS和WINDOWS应用程序相兼容


Using the BIOS to boot from the CD ROM requires using the available system header on the CD ROM
使用BIOS来从CDROM引导,需要使用CDROM上的可用的系统头。


1.1 Scope
This document describes in detail how to format a CD-ROM from which you can boot a suitably-equipped computer system.    It assumes you are familiar with standard BIOS INT 13 functions, ISO document number 9660,IBM/Microsoft INT 13 Extensions Dated 9/92, Version 1.0 of the Enhanced Disk Drive Specification (authored by Phoenix), and ATAPI.


1.2 Notation and Conventions
All numbers in this document are hexadecimal unless otherwise specified.   All reserved or unused bytes are assumed to be zero.   All character strings are padded to their full length with hex zeros.  All word, double word and quad word values listed in this spec are in “Little Indian” (Intel) format.
本文档中所有的数字都是十六进制的,除非另外说明。 所有保留和未用的字节都认为是0。所有字符串都用0填充到它们的全长。这个规范中列出的所有字,双字和四字的值都是LITTLE-ENDIAN格式(我注:低地址存放最低有效字节LSB,即低位在先,高位在后,即低位字节排放在内存的低端,高位字节排放在内存的高端)


1.3 Introduction
ATAPI-compliant IDE as well as SCSI CD-ROM drives can optionally provide new boot capabilities for personal computer manufacturers and users.  In the past IBM and compatible personal computers would first attempt to boot from the floppy drive and if no floppy was present, from the hard disk.
ATAPI兼容的IDE,以及SCSI CDROM驱动器,都可以可选地提供新的引导能力给PC制造商和用户。 以前IBM和兼容PC机将先尝试引导软驱,如果没有软驱,则再引导硬盘。


This specification explains how the BIOS boot procedure can be enhanced to support a new medium, the CD-ROM.    The CD-ROM is a removable media type, much like a floppy, but with the capacity of a hard disk.
这个规范解释了BIOS引导过程如何增强支持一个新的媒介CDROM。  CDROM是一个可移除的媒介类型,很像软驱,但具有硬盘的能力。
Maintaining compatibility with current software requires using INT 13 calling conventions but providing an entirely new device interface.     INT 13 places some restrictions on the information which a CD-ROM contains and also provides several new options for booting a system.  The following is a list of new system capabilities and constraints:
保持与当前的软件相兼容需要使用INT13调用惯例,但是提供一个全新的驱动器接口界面。  INT13在一个CDROM包含的信息上放置了一些限制,并且也提供了一些新的用于引导一个系统的可选功能。  下面是新系统能力和约束:


1. The CD-ROM may boot as the A drive or the C drive.    CDROM可能作为A盘或者C盘引导
2. If the CD-ROM boots as the A, drive it will contain a 1.2M, 1.4M or 2.88M floppy image. 如果CDROM作为A盘引导,它将包含一个1.2M, 1.4M 或 2.88M软盘镜像。
3. If the CD-ROM boots as the A drive the systems normal A drive will become the B drive. If the system has a B drive it will become inaccessible.     如果CDROM作为A盘引导,系统中原有的A驱动器将变成B驱动器,如果系统有B驱动器,则它将变成不可见。
4. If the CD-ROM boots as the C drive, it replaces the C drive.     如果CDROM作为C盘引导,它将替代C驱动器。
5. No device drivers are necessary for applications which use the INT 13 interface. This means that normal MS- DOS compatible software can access the CD-ROM without a device driver. Some OS software, such as Windows, can be configured to use INT 13 giving the user immediate benefits from his CD.     那些使用INT13接口界面的应用程序不需要设备驱动程序。 这意味着,普通的MSDOS兼容的软件可以访问CDROM而不需要设备驱动程序。 一些操作系统软件,像WINDOWS,可以被配置来使用INT13,立即就使用户从他的CD得到的好处。
6. Formatting a portion of the CD ROM as a “write protected” hard disk is an easy method of copy-protecting off-the-shelf software as well as allowing MS-DOS to function normally.     格式化CDROM的一部分成为“写保护”硬盘是防拷贝现成软件的一个简单的方法,同时允许MSDOS正常地发挥功能。
7. You can also copy-protect the non-disk-formatted portions of the CD ROM by embedding special CD-ROM drivers on the CD.     你也可以防拷贝CDROM的非盘格式部分,通过集成特别的CDROM驱动程序在CD上。


1.4 Implementation Options
Adding CD-ROM booting to a system will also require changes to the “SETUP” user interface.  Many systems allow the following boot options. 
加入CDROM引导到系统中也需要在SETUP用户界面中做改变。一些系统允许以下的引导选择:
A:  then  C:
C:  then  A:
C:  only
CD-ROM booting now adds several new possibilities.  The table below is a complete list:
CDROM引导现在加入了一些新的可选项。 下面是完整的列表:
A:  then  CD  ROM  then  C:
CD  ROM  then  A:  then  C:
CD  ROM  then  C:  then  A:
C:  then  A:  then  CD  ROM
CD  ROM  only
Many systems will not require all of these options, but it is necessary to give the user a CD-ROM boot disable capability.  The ability to disable CD-ROM booting is required because there has been no standard for using the first few sectors of the CD.  In the event that random data causes the system to find a valid “Validation Entry” on a non- compliant CD the user must have the recourse of disabling the boot capability.
许多系统不需要所有的这些选项,但需要给用户取消CDROM引导的能力。 这是需要的,因为使用CD上的前面几个扇区还没有标准。  如果随机的数据导致系统发现一个非应允的CD上有一个有效的“合法入口”,用户必须有办法取消引导能力。
If the end-user selects one of the Boot CD-ROM options on the Setup Menu, and if during POST the BIOS detects the presence of a CD-ROM drive, INT 19 at the end of POST will then attempt to load the operating system using the boot sequence specified in Setup.
如果终端用户选择SETUP菜单中的引导CDROM选项中的一个,并且如果在POST时BIOS检测到CDROM驱动器存在,在POST最后,INT19将尝试使用SETUP中指定的引导顺序加载操作系统。
To accomplish this, the installable Boot CD ROM feature makes available one of two INT 19 functions:
为完成这个,可安装的引导CDROM特性提供了二个INT19功能中的一个:
1. Single-Image INT 19. This feature, if instructed to boot from the CD ROM, does the following:     单镜像INT19。这个特性如果用来从CDROM引导,则做以下工作:
a. Accesses the Booting Catalog in the CD-ROM header (See below).     访问在CDROM头的“引导目录Booting Catalog”。
b. Verifies the existence of a boot image on the CD ROM.    核实CDROM上引导镜像的存在。
c. Reads the Initial/Default Entry (See below) and boots from the disk image specified in this entry.     读出 “初始/默认入口”,并且从这个入口指定的镜像引导。
Single-Image INT 19 knows nothing about multiple-images, nor does it know about their possible entries listed in the Booting Catalog.  单镜像INT19不知道多镜像的任何东西,它也不知道在引导目录中列出的它们的可能的入口。
2. Multiple-Image INT 19. This feature, if instructed to boot from the CD ROM, does the following:      多镜像INT19。这个特性如果用来从CDROM引导,则做以下工作:
a. Accesses the Booting Catalog in the CD-ROM header. 访问在CDROM头的“引导目录”。
b. Verifies the existence of a boot image on the CD ROM      核实CDROM上引导镜像的存在。
c. Boots from either the image specified in the Initial/Default Entry or from one of the other images listed in Section Headers and Section Entries  (See below) that follow the Initial/Default entry.    The selection of which image to boot from depends on Selection Criteria determined by the OEM (See below).      从在“初始/默认入口”中指定的镜像引导,或者从排列在“初始/默认入口之后”的“section头”和“section入口”中列出的其它镜像中的一个引导。  选择从哪个镜像引导,取决于OEM决定的“选择判别式Selection Criteria”。



 
Figure 1. Three types of CD-ROM configuration:      3种类型的CDROM格局
3种类型的CDROM格局
1. The Normal CD-ROM configuration is not bootable, uses Root Directory and CD-ROM drivers to access CD-ROM images.   
正常的CDROM格局是不可引导,使用Root Directory和CDROM驱动程序来访问CDROM镜像。(我注:对正常的光盘,需要光驱驱动程序)
2. A BIOS with Single Boot-Image capability accesses the Initial/Default Entry to access a single bootable disk image. After loading the operating system, the system can revert to standard CD-ROM drivers and the Root Directory to access CD-ROM images.     
一个带有单引导镜像能力的BIOS 访问 “初始/默认入口”来访问一个单个可引导磁盘镜像。  在加载了操作系统之后,系统可以还原成用标准CDROM驱动程序和Root Directory来访问CDROM镜像。
3. A BIOS with Multiple Boot-Image capability can access any one of a number of Bootable Disk Images listed in the Booting Catalog.     After loading the operating system, the system can access other items in the disk image with standard INT 13 calls or return to normal access of CD-ROM images using CD-ROM drivers and the Root Directory.       
一个带有多引导镜像能力的BIOS 会访问 “引导目录Booting Catalog”中列出的许多可引导盘镜像的中的任一个。 在加载了操作系统后,系统会用标准的INT13调用来访问光盘镜像中的其它项目,或者返回成使用CDROM驱动程序和Root Directory的标准CDROM镜像访问方式。


1.5 Definition of Terms
For the remainder of this document the following definitions apply:
Sector - Is a sector of data on a CD.  This is in all cases 800 bytes.
扇区-一个CD中的数据扇区。在所有情况下都是800H字节(我注:即2048BYTE)。
Virtual Sector - Is a sector of data on an emulated device.  This document only addresses 200 byte device (for emulation)。 
虚拟扇区-在一个仿真设备上的数据扇区。 这个文档只专注于200H字节(我注:即512BYTE)设备(用于仿真)
Virtual Disk - A series of sectors on the CD which INT 13 presents to the system as a drive with 200 byte virtual sectors.  There are 4 virtual sectors found in each “sector” on a CD.  
虚拟盘-CD上的一系列扇区,INT13将它作为一个带有200H字节虚拟扇区的驱动器体现给系统。


 


2.0 ISO-9660 and the Booting Catalog
One goal of this specification is to maintain ISO-9660 compatibility while providing system BIOSs with a simple way of getting to the location on the CD that contains the material to be booted.    ISO-9660 defines that a “Primary Volume Descriptor” must reside at sector 10 (16 decimal), relative to the start of the session,  followed by any number of other Volume Descriptors,  followed by a “Volume Descriptor Set Terminator.” 
这个规范的一个目标是,在提供给系统BIOS一个访问 包含需要被引导的信息的 CD上的位置的简单方法的同时,保留ISO9660兼容性。
ISO9660中定义:一个“主卷描述符”必须存放在扇区10H(即十进制的16)(我注:第一个扇区是扇区0),相对于session的起点,后面跟着任何数量的其它卷描述符,最后面跟着一个“卷描述符集结束符”。
The El Torito Bootable CD Specification builds on this format by requiring a “Boot Record” Volume Descriptor as defined in section 8.2 of ISO-9660.  See figure 7 for a description of the Boot Record.  This “Boot Record” must reside at sector 11 (17 decimal) in the last session on the CD.  The Boot Record contains an absolute pointer to the Boot Catalog.  The Boot Catalog is a collection of 20 byte entries (as described below), packed 40 entries to the sector. 
El Torito可引导CD规范建立在这个格式之上,通过需要一个在ISO9660的8.2节中定义的“引导记录”卷描述符。 参见图7.
这个“引导记录Boot Record”必须存放在CD上的最后一个session中的扇区11H(即十进制的17)中。(我注:因为主卷描述符在扇区10H,它的长度是一个扇区2048字节,故引导记录卷描述符是在下一个扇区,即扇区11H)
这个“引导记录”包含了一个指向“引导目录Boot Catalog”的绝对指针。  “引导目录Boot Catalog”是一个入口的集合,每个入口长20H字节(我注:即每个入口32BYTE),一个扇区中包装40H个入口(即每个扇区64个入口)。
There is no limit to the number of sectors the Boot Catalog uses.  This catalog allows the system to pick a proper boot image and then to boot from the selected image.  The image may be virtualized into INT 13 drive number 00 or 80 for bootable disk emulation, or n+1 for a “non-bootable” emulation, where n is the number of the last hard drive initialized by the BIOS. 
“引导目录Boot Catalog”使用的扇区的数量是没有限制的。   “引导目录”允许系统去选择一个合适的引导镜像然后从选择的镜像引导。 这个镜像可能会被虚拟到INT13驱动器号00H或80H,用于可引导磁盘的仿真,或者n+1用于一个“不可引导”的磁盘的仿真,这里n是BIOS初始化过的最后一个硬盘的号。
(我注:“不可引导”的磁盘的仿真,这是什么意思?是仿真状态,但是是不可引导。从光盘引导成软盘或硬盘,则肯定是仿真和可引导;从软盘或硬盘引导,肯定是没有在仿真状态。
经VIRTUAL PC实验,可能是这个功能没有被BIOS实现。
初衷可能是做一张“不可引导”的数据CD(见后述),在BIOS进行光盘引导时,发现光盘上有“引导记录卷描述符”和“引导目录”,但是它又是“不可引导”的(即入口的Boot Indicator不是88H,而是00H),于是这时BIOS能将光盘仿真成驱动器号为n+1的磁盘,而原硬盘仍是编号n,这时BIOS再转成用软盘或硬盘引导,引导成功后,软件可以通过INT13H访问驱动器号为n+1的磁盘,即实际上的光盘,从而达到INT13H访问光盘的目的!但是这一功能可能受微软控制而没有被BIOS实现,只能在DOS下加载光驱驱动程序来访问光盘了。
网上摘录:
再来谈一下有关于启动盘号的问题,我曾经也测试过一些启动光盘的盘号(可以用grub中的"geometry (cd)"来获得),发现不同主板(或者虚拟机)的无模拟方式启动盘号不同。归根结底,是因为各个主板生产商的光盘启动标准不统一,各管各的。这就是至今为止,grub或者其它软件很难直接引导光驱的原因。至于规格为何不统一,据说是这样的:
微软在1994年以前就推出了dos下的cd驱动程序mscdex.exe,并成为了标准。而那个可启动cd标准是1995年才制定的,受微软的打压,启动cd标准里的一个关键函数Int 13 function 4C在实际主板生产中并未加入(如果加入的话,dos下cd也和软盘硬盘一样不需要驱动了,微软94年前就白忙了),同时启动cd标准的一些参数据说也由于微软的缘故没有统一(无模拟方式启动盘号就是其中之一)。
总而言之,在当时启动cd标准如果很完美就会威胁微软的mscdex程序。
这个 INT 13 EXT 的众多扩展中,被众多 BIOS 厂商实现地最好地莫过于EX_Read(),EX_Write(), 和 EX_GetDrvParam() 两个功能了。
修改盘号的这个功能,用起来可能有很大地兼容性问题,我私下认为。


还可以参考网上的《关于CD-ROM标准,太神奇了~~~》


The image may also simply be some code which will be loaded at boot time (no emulation).  The BIOS will choose a drive number between 81 and FF when “no emulation” is specified.  There are 5 types of entries diagrammed in figures 2-6.   These entries define a validation procedure for the bootable CD, an Initial/Default entry, a section header, a section entry, and a Section Entry Extension.
这个镜像也可能简单地是一些代码,在(非仿真)引导时被加载。  当指定“非仿真”时,BIOS将选择81H和FFH之间的一个驱动器号。 
(我注:就是说,引导型光盘有二种:一种是仿真模式,光盘引导时能仿真出A盘或者C盘;一种是非仿真模式,光盘引导时不仿真出磁盘,只是执行一些光盘上的代码)


有5种类型的入口,在图2-图6中图示。  这些入口定义了一个用于验证可引导CD的“验证入口”,一个“初始/默认入口”,一个“section头入口”,一个“section入口”,和一个“section入口扩展”。



2.1 Validation Entry 验证入口
This must be the first entry in the boot catalog.  The Validation entry validates that a booting catalog is present on the disk and identifies the manufacturer of the CD.  If this entry is valid, it is assumed that the rest of the entries are valid. See figure 2 for a description of the Validation Entry.
它必须是“引导目录booting catalog”中的第一个入口。   “验证入口”证实了在光盘上存在一个“引导目录booting catalog”并且鉴别出CD的制造商。 如果这个入口有效,就假设剩下的入口都有效。 见图2。


2.2 Initial/Default Entry  初始/默认入口
The initial entry must contain a boot image which consists of generic programs/drivers that use only the BIOS provided INT 13 interface.   The BIOS INT 13 interface consists of functions 0-19 and may optionally include functions 40-48. This entry will always be used by a BIOS that does not use any of the provided section headers.  See figure 3 for a description of the Initial/Default Entry.
初始入口必须包含一个引导镜像,这个镜像中包含 只使用BIOS的INT13接口界面的 普通的程序/驱动程序。    BIOS INT13接口包含功能0-19并且可选地包含功能40-48。  这个入口总是被一个不使用任何 已有的“section头入口”的 BIOS使用。  见图3。


2.3 Section Header    SECTION头入口
If the CD was created for a machine with a BIOS incorporating this specification, the Section Header precedes a group of entries from which the BIOS may boot the computer.  The section header has an identification string. If the BIOS understands the ID, string it may choose to boot the system using one of these entries in place of the INITIAL/DEFAULT entry. A good example would be a BIOS that supports multi-language capability.  The BIOS manufacturer defines a header string and selection criteria.  When CD’s have a section that incorporates the header string and section entries, the BIOS automatically boots software in the native language of the BIOS.  See Figure 4 for a description of the Section Header.
如果创建的CD用于带有与这个规范相合作的BIOS的机器上,section头入口的位置处于 一组BIOS可以用来引导计算机的入口 的前面。 SECTION头有一个识别字串。 如果BIOS了解这个ID,它会选择使用这个入口中的其中一个来引导系统,而不是使用初始/默认入口。  一个好的例子是,一个支持多语言能力的BIOS。  BIOS制造商定义一个头字串和“选择标准selection criteria”。   当CD中有一个section中合并入了头字串和section入口,BIOS自动用BIOS的母语来引导软件。见图4。


2.4 Section Entry    SECTION入口
Section Entries must follow a Section Header.  The Section Entry looks a lot like the Initial/Default Entry except the unused bytes contain selection criteria.  The format of the selection criteria is a function of the BIOS vendor, the other fields are standardized for compatibility reasons.  In the case of a foreign language BIOS three bytes would be used to identify the language.  If the BIOS does not support languages, the Default entry determines the appropriate language and reinitiates the boot procedure using the proper boot image.  If the 13 bytes provided for selection criteria are insufficient, a Section Entry Extension can be added by setting bit 5 of byte 1.  See “Section Entry Extension” for details.  See Figure 5 for a description of the Section Entry.
SECTIOIN入口必须跟在一个SECTION头之后。  SECTION入口看上去非常像初始/默认入口,除了后面几个没有使用的字节中包含了“选择标准selection criteria”。  “选择标准”的格式随BIOS制造商而变, 其它的区域被标准化因为兼容性原因。  在一个外国语言BIOS的场合,默认入口决定了合适的语言和使用合适的引导镜像来发起引导过程。 如果用于“选择标准”的13字节不够,一个“SECTION入口扩展”可以被添加,通过设置字节1的BIT5。  见“SECTION入口扩展”。见图5。


2.5 Section Entry Extension     SECTION入口扩展
Section Entry Extension must follow a Section Entry.  This Extension defines additional selection criteria.  When the 13 bytes provided by the Section entry are insufficient for representing the selection criteria a Section Entry Extension should immediately follow the Section  Entry.  Several Section Entry Extensions may be chained together by setting bit 5 of byte 1 for as many Extensions as necessary.  The final extension should have bit 5 clear (set to 0) to indicate that no more Extensions follow.  See Figure 6 for a description of the Section Entry Extension
“SECTION入口扩展”必须跟在一个SECTION入口之后。  这个扩展定义了额外的“选择标准”。  当SECTION入口提供的13H字节不够用于表达“选择标准”,一个“SECTION入口扩展”应立即跟随在SECTION入口之后。  多个SECTION入口扩展应被链接在一起,通过设置第1个字节的BIT5,需要多少就用多少。  最后一个扩展必须将BIT5设置为0来表示后面再也没有跟着扩展了。 见图6。


Offset Type Description
0 Byte Header ID, must be 01
1 Byte Platform ID
0 = 80x86
1=Power PC
2=Mac
2-3 Word Reserved, must be 0
4-1B Character ID string.  This is intended to identify the manufacturer/developer of the CD-ROM.
1C-1D Integer Checksum Word.  This sum of all the words in this record should be 0.
1E Byte Key byte, must be 55.  This  value is included in the checksum.
1F Byte Key byte, must be AA.  This value is included in the checksum.
Figure 2 - Validation Entry  验证入口(32字节)


 


Offset Type Description
0 Byte Boot Indicator. 
88 = Bootable, 00 = Not Bootable
88H=可引导, 00H=不可引导!!!
1 Byte Boot media type.  This specifies what  media the boot image is intended to emulate in bits 0-3 as follows, bits 4-7 are reserved and must be  0.
Bits 0-3 count as follows:
0 No Emulation
1 1.2 meg diskette
2 1.44 meg diskette
3 2.88 meg diskette
4 Hard Disk (drive 80)
5-F   Reserved, invalid at this time
2-3 Word Load Segment. 段地址(高字节在后,低字节在前,如盘上的数据是C0H,07H)
This is the load segment for the initial boot image. 
If this value is 0 the system will use the traditional segment of 7C0. 
If this value is non-zero the system will use the specified segment.   This applies to x86 architectures only.   
For “flat” model architectures (such as Motorola) this  is the address divided by 10.
4 Byte System Type. 
This must be a copy of byte 5 (System Type) from the Partition Table found in the boot image.
5 Byte Unused, must be 0
6-7 Word Sector Count.  加载到内存的虚扇区的数量(高字节在后,低字节在前)
This is the number of virtual/emulated sectors the system will store at Load Segment during the initial boot procedure.
我注:
虚扇区是每扇区512字节。
例如,如果值为1,则启动时从光盘加载1个虚扇区即512字节到内存中执行,虽然光盘扇区是2048字节,但只有前面的512字节被加载到内存中。
如果值为2,则启动时从光盘加载2个虚扇区即1024字节到内存中执行。
如果值为4,则启动时从光盘加载4个虚扇区即2048字节到内存中执行,即一个光盘扇区的内容。
如果值为FFFFH,则是从光盘加载FFFFH个虚扇区到内存中。但计算机的常规内存只有640KB。
没有加载到内存的代码仍在光盘上,当然无法执行了,只有内存中的代码才能执行。
这个值就是NERO刻录软件中的“number of loaded sectors”
8-0B D Word Load RBA.   虚拟磁盘在光盘上的起始扇区地址(高字节在后,低字节在前)
This is the start address of the virtual disk.  CD’s use Relative/Logical block addressing.
0C-1F Byte Unused, must be 0.
Figure 3 - Initial/Default Entry  初始/默认入口(32字节)


 


Offset Type Description
0 Byte Header Indicator as follows:
90 -Header, more headers follow
91 – Final Header
1 Byte Platform ID:
0 = 80x86
1=Power PC
2=Mac
2-3 Word Number of  section entries following this header
4-1F Character ID string. 
This identifies a section.  This string will be checked by BIOS and BOOT software.  If the string matches, the section should be scanned for boot images.
Figure 4 - Section Header Entry   SECTION头入口(32字节)


 


 


Offset Type Description
0 Byte Boot Indicator.  引导指示符
88 = Bootable, 00 = Not Bootable
88H=可引导, 00H=不可引导!!!
1 Byte Boot media type.  媒介类型
This specifies what media the boot image emulates in bits 0-3.
Bits 6 and 7 are specific to the type of system.


Bits 0-3 count as follows
0   No Emulation
1   1.2 meg diskette
2   1.44 meg diskette
3   2.88 meg diskette
4   Hard Disk (drive 80)
5-F   Reserved, invalid at this time
bit 4 - Reserved, must be 0
bit 5 - Continuation Entry Follows
bit 6 - Image contains an ATAPI driver
bit 7 - Image contains SCSI drivers
2-3 Word Load Segment. 段地址(高字节在后,低字节在前,如盘上的数据是C0H,07H)
This is the load segment for the initial boot image. 
If this value is 0 the system will use the traditional segment of 7C0. 
If this value is non-zero the system will use the specified segment.  This applies to x86 architectures only.
For “flat” model architectures (such as Motorola) this is the address divided by 10.
4 Byte System Type.  系统类型
This must be a copy of byte 5 (System Type) from the Partition Table found in the boot image.
5 Byte Unused, must be 0
6-7 Word Sector Count. 加载到内存的虚扇区的数量(高字节在后,低字节在前)
This is the number of virtual/emulated sectors the system will
store at Load Segment during the initial boot procedure.


8-0B D Word Load RBA. 
This is the start address of the virtual disk.  CD’s use Relative/Logical block addressing.
0C Byte Selection criteria type.  “选择标准”的类型
This defines a vendor unique format for bytes 0D-1F. The following formats have currently been assigned:
0 - No selection criteria
1- Language and Version Information (IBM)
2-FF – Reserved
0D-1F Byte Vendor unique selection criteria.  (13H个字节的“选择标准”)
Figure 5 - Section Entry   SECTION入口(32字节)


 



Offset Type Description
0 Byte Extension Indicator.  Must be 44
1 Byte Bits 1-4: Unused
5 :
1 = Extension Record follows,
0 = This is final Extension
6-7: Unused
2-1F Byte Vendor unique selection criteria
Figure 6 - Section Entry Extension    SECTION入口扩展(32字节)


 



Offset Type Description
0 Byte Boot Record Indicator, must be 0
1-5 Byte ISO-9660 Identifier, must be “CD001”
6 Byte Version of this descriptor, must be 1
7-26H Byte Boot System Identifier, must be “EL TORITO SPECIFICATION” padded with 0’s.
27-46H Byte Unused, must be 0.
47-4A Dword Absolute pointer to first sector of Boot Catalog.
4A-7FF(74-2047) Byte Unused, must be 0.
Figure 7 - Boot Record Volume Descriptor  引导记录卷描述符  (2048字节)


 


3.0 The INT 13 Accessible Image
The boot image is an exact replica of the floppy or hard disk the system is intended to emulate. You can create this image by reading from the source media as if it were a Logical-Block Addressable (LBA) device and incrementing the logical-block value until all sectors have been read. Concatenate all blocks in a single file.  X3T9.2 (ATA 4.0) defines the LBA translation as follows:
引导镜像是一个系统有意仿制的软盘或硬盘的原样的复制品。你可以创建这个镜像,通过从原始媒介上读取,就像它是一个LBA设备,并且增加逻辑块值直到所有的扇区被读取完。  连接所有的块在单一的文件里面。  X3T9.2(ATA4.0)定义了LBA转换如下:
LBA 0 = Cylinder 0, Head 0, Sector 1
LBA X = ((Cylinder * Maximum Heads + Head) * Sectors per Track ) + Sector -1



Place the resulting file on the CD in ISO-9660 format, and make a catalog entry in sector 0 of the CD-ROM.  It is the responsibility of the INT 13 interface to recreate the disk geometry and to properly access the information.
将生成的文件放在ISO-9660格式的CD上,并且在CDROM的扇区0生成一个目录入口。  INT13界面的责任是 去重新创建磁盘几何结构并且完全地访问信息。


 


4.0 INT 13 and CD-ROMs
Once the system has selected the proper boot image, the INT 13 interface must recreate the Floppy/Hard disk. It is the responsibility of the BIOS to create a valid geometry for the virtual disk and then present this geometry in function 08. The INT 41 pointer is not valid at this time which means that software that uses INT 41 is not valid on a CD-ROM.
一旦系统已经选择好合适的引导镜像后,INT13界面必须重新创建软盘/硬盘。  BIOS的责任是去创建一个有效的几何结构用于虚拟磁盘,然后将这个几何结构呈现在功能号08里。  这时INT41指针是无效的,这意味着那些使用INT41的软件在CD-ROM上是无效的。
When the boot code is loaded, INT 13 must reverse the CHS addresses it receives creating a valid LBA address which is then offset by the Load LBA.  This procedure can emulate all standard Floppy/Hard disk transactions.  The remainder of this section assumes that the system is using the Initial/Default Entry, or has chosen a Section Entry.
当引导代码被加载后,INT13必须倒转它接收到的CHS地址,创建一个有效的LBA地址,然后这个LBA地址被“LOAD LBA”偏移。  这个过程可以仿真所有的标准软盘/硬盘的转换。  这个SECTION的剩余部分假设系统正在使用初始/默认入口,或者已经选择了一个SECTION入口。


4.1 INT 13 Function 08
This function normally gets the geometry information directly from the selected catalog entry.  In the case of a floppy simulation the geometry is well known and defined as follows:
这个功能正常从已选的目录入口中得到几何信息。 在一个软盘仿真的场合中,几何结构很好地被了解并且定义如下:
Size Tracks x Heads x Sectors
1.44 Meg 50H x 2H x 12H
2.88 Meg 50H x 2H x 24H
1.2 Meg 50H x 2H x 0FH


When the simulated device is a Hard Disk, the BIOS should use a geometry which fits the partition table located in the Load LBA sector.  Hard Disk images may only have 1 partition in the partition table and it must be the first entry.
当仿真的设备是一个硬盘时,BIOS应使用与  位于LOAD LBA扇区中的分区表 相一致的几何结构。  硬盘镜像只能在分区表中有一个分区并且它必须是第一个入口。


4.2 INT 13 Function 48
The IBM/Microsoft INT 13 extensions use function 48 for returning drive capability information.  The Phoenix Enhanced Disk Drive Specification adds to this information  by providing a pointer to a table which contains extended drive information.  Byte 10, bit 6 of this table is set to 1 if the attached device is a CD-ROM.  This function gives software residing on a CD the ability to determine that it is running from a CD-ROM.
IBM/Microsoft  INT13H扩展使用功能号48H用于返回设备的能力信息。 Phoenix Enhanced Disk Drive(EDD)规范增添了这个信息,通过提供一个指向一张包含了扩展驱动器信息的表格的指针。如果挂载的驱动器是一个CDROM,这张表的字节10H中的BIT6被设置成1(我注:参见BIOS Enhanced Disk Drive Specification_V3.pdf的page12, Device Parameter Table Extension (DPTE)  )。  这个功能给了存在于CD上的软件判断它正在从CDROM运行的能力。


4.3 INT 13 and Booting
The selected image is only a boot image if the Boot Indicator in byte 0 of the section entry is an 88.  Any other value flags the image as not bootable, requiring the system to check the next boot device, in most cases the floppy drive.
如果SECTION入口的字节0中的Boot Indicator是88H,则选中的镜像是仅仅是一个引导镜像。  任何其它值都表示镜像是不可引导,需要系统去检查下一个引导驱动器,在大多数情况下是软盘。


When the boot image is in a floppy format, the CD becomes drive 00, the former drive 00 moves to 01 and all other drive identifiers remain intact.  This means that the system always has a usable floppy drives as well as maintaining all hard disk drive letters so that a CD can boot and then install software on the user’s hard disk.  The floppy remains accessible as drive 01 to allow the software vendor to update the CD with a supplemental floppy if necessary.
当引导镜像是一个软盘格式,CD变成驱动器号00,以前的驱动器00移到01,其它驱动器标识符保留不动。 这意味着系统总是有一个可以使用的软盘,并且系统保持着所有的硬盘盘符,这样一个CD引导后可以安装软件到用户的硬盘上。  软盘仍可作为驱动器01访问,允许软件制造商在需要的情况下用辅助的软盘去更新CD。


When the boot image is a  hard disk, all drives numbered 80 and above are incremented by 1, becoming 81 and up, and, the CD will become drive 80.  This allows software vendors to create stand-alone CD’s that normally run under MS-DOS and use the standard INT 13 interface to place their software on the CD without regard to the media.  The system’s hard drive remains accessible because the stand alone CD may need some temporary disk storage.
当引导镜像是一个硬盘,所有的驱动器号80和更高的号都被增加1,变成81及更高,CD将成为驱动器80。 这允许软件制造商创建那些正常在MSDOS下运行的孤立的CD,并使用INT13界面去将他们的软件放在CD上,而不用考虑到媒介。  系统的硬盘仍可访问,因为孤立的CD可能需要一些临时的磁盘存贮。


When the boot image is simply a “loader” or stand alone program, and NO EMULATION is desired, the drive numbers will be unaffected after the boot image is loaded.  The specified number of sectors are loaded at the specified segment (usually 7C0), and then the BIOS jumps to the load address.  The software can retrieve a pointer to its boot information by issuing INT 13, Function 4B,  AL=1.
当引导镜像只是简单的一个“加载器”或孤立的程序,并且不需要任何模拟仿真,在引导镜像被加载后,驱动器号将不受影响。  特定数量的扇区被加载到特定的段(通常是7C0段),然后BIOS跳转到这个加载地址。  软件可以得到一个指向它的引导信息的指针,通过触发INT13,功能号4B,AL=1。(我注:通过这个中断功能号,可得到光驱的驱动器号,这个很重要!知道了驱动器号,才能用INT13H来访问光驱)


If the Boot Indicator in Byte 0 is not an 88, the system accesses the next boot device, and the CD will now become the last drive in the user’s drive sequence regardless of the image type.    This allows software vendors to distribute data CD’s which do not require device drivers for MS-DOS style accessing.
如果第0字节的Boot Indicator不是88H,系统将访问下一个引导设备(我注:即不从光盘引导了,转成从别的设备引导,如软盘或硬盘),并且CD将变成用户驱动器顺序里的最后一个驱动器,不考虑镜像类型是什么。  这允许软件制造商去发布数据CD,这些数据CD对于MS-DOS类型的访问来说不需要设备驱动程序。(我注:这是什么意思?见前面第2章中我的分析。)


4.4 Boot Entry Selection
If the CD has several boot entries, a default entry which boots a selection program may be provided as the Default/Initial catalog entry.  This image will usually be a floppy image which loads a program that selects the proper boot image by examining the system configuration or questioning the user.
如果CD有几个引导入口,一个引导一个选择程序的缺省的入口可被提供作为初始/默认目录入口。 这个镜像通常将成为一个软盘镜像,它加载一个程序,这个程序通过检查系统配置或询问用户以选择合适的引导镜像。
 


5.0 CD Boot Procedures
This purpose of this section is to describe the intended sequence of events for booting from the various CD formats described above.  These procedures should guarantee that software can boot and operate as the software vendor intends.  The BIOS provides three INT 13 functions for assigning and deassigning the CD.  These functions are documented in the next section and referenced in the paragraphs below.
这节的目的是描述用于从以上描述的各种CD格式来引导的事件的预期的顺序。 这些过程应保证软件可以引导和像软件制造者预期的那样操作。  BIOS提供3个INT13功能号用于分配CD和取消分配CD。  这些功能在下一节描述。


5.1 Floppy Booting 仿真软盘引导
The total capacity of a CD is 600+ meg (decimal), give or take a little compression.  The purpose of using a floppy emulation is to get the system booted under a specific operating system, load a device driver which understands the true format of the CD, usually ISO-9660, and then put the system back in its normal operating configuration. 
CD的总容量是600MB左右。 使用软盘仿真的目的是将系统引导到一个特定的操作系统中,加载知道真实CD格式(通常是ISO9660)的设备驱动程序,然后将系统弄回到它的正常操作配置。
(我注:即先仿真成软盘,就能引导到DOS中,DOS中加载光驱驱动程序,再停止仿真软盘。这时的DOS有光驱驱动程序,可以正常访问光盘上的内容)


This sequence of events gives the software on the CD the “normal” configuration of the system and makes the CD available as the same drive letter the user would normally have assigned.  Only a small portion of the CD is wasted on the boot image.  Another advantage of the floppy image is that you can place several of them on a single CD, each with a customized system configuration.  Several entries can be made in the catalog, each with different booting criteria.
这种操作次序给CD上的软件“正常”的系统配置,并使 CD拥有与用户正常要分配的驱动器号 相同的驱动器号。  只有CD的一小部分被需要用于引导镜像。 软盘镜像的其它优点是你可以在一张CD上放置好几个它们,每个带有一个定制的系统配置。  在目录中可以建立几个入口,每个入口带有不同的“引导标准booting criteria”。


5.2 Hard Disk Booting 仿真硬盘引导
The purpose of booting as a hard disk is to provide a large MS-DOS compatible CD-ROM storage space on which programs may reside and/or access data.  This lends itself well to stand alone/protected applications which do not use full system resources.  Booting the CD as a hard disk normally requires that all applications on the CD are INT 13/MS-DOS based. 
作为一个硬盘引导的目的是提供一个与MSDOS兼容的很大的CDROM存贮空间,程序会存贮在这个空间中并且/或者可以访问这个空间中数据。  这有助于孤立/写保护应用程序,它们不使用全部的系统资源。 作为一个硬盘引导型的CD,通常需要CD上所有的程序是基于INT13/MSDOS的。
The system is not returned to its “normal” operating configuration and software is not intended for installation.  This is for applications that run directly from the CD.  This does not restrict an application from installing a device driver and using it. 
系统并不返回到它的“正常”操作配置,并且软件不预期用于安装。  这是用于那些直接从CD运行的程序。  这并不限制一个应用软件安装驱动器程序并且使用它。
In fact, this is encouraged for those applications which require encryption or copy protection.  What must be kept in mind is that the CD is a “slow” device, the INT 13 interface can access the data at about the same speed as any driver in this environment.
事实上,对于那些需要加密或防拷贝保护的应用程序来说是鼓舞的。  需要记住的是,CD是一个“慢”的设备,INT13可以以同这个环境中的任何驱动程序大约相同的速度访问数据。


5.3 No Emulation Booting  “非仿真”引导
When the Media Type is set to zero the BIOS does not use the CD to emulate a disk.  The boot operation loads the requested number of sectors directly to the specified segment.  When loading is complete the BIOS will jump to segment:0.  The associated piece of software can be a “loader” (which provides its own CD interface), or it can be a stand alone program. 
当媒介类型被设成0时,BIOS不使用CD来仿真磁盘。  引导操作直接加载被请求数量的扇区到指定段中。 当加载结束,BIOS将跳转至段:0。  相关的软件片断可以成为一个“加载器”(它自已提供给自已CD界面),或者它可以成为一个标准的孤立程序。
The El Torito specification allows for the loading of FFFF sectors (This would allow the BIOS to fill the entire low 640k memory area with data).  Once the system jumps to segment:0, the program can retrieve its boot information by issuing INT 13, Function 4B, AL=01. 
El Torito规范允许加载FFFF个扇区(这将允许BIOS用数据填充整个低640K内存区域)(我注:最多FFFFH个,即初始/默认入口或SECTION入口中的字节6、7,Sector Count加载到内存的虚扇区的数量)。
一旦系统跳转到段:0,程序可以通过触发INT13,功能号4B,AL=01 来获得它的引导信息。
After the boot process has been initiated the INT 13 Extensions (functions 41-48) will access the CD using 800 byte sectors and the LBA address provided to INT 13 is an absolute sector number.  This gives any program running in no emulation mode the ability to locate the boot catalog, and any other information on the CD, without providing a device driver.
在引导过程已经被初始化完了后,INT13扩展(功能号41H-48H)将访问CD,使用800H字节(2048BYTE)扇区,并且提供给INT13的LBA地址是一个绝对扇区号。  这给了任何运行在非仿真模式下的程序去定位引导目录和任何其它CD上的信息的能力,不需要提供设备驱动程序。


5.4 System Optimization 系统优化
The Default/Initial Catalog Entry  may contain a floppy image which can examine the system and/or query the user about his system configuration, select a proper Section Entry, and then reboot the system using this Section Entry. This program on its first invocation may write configuration information to the users Hard Disk and then not question the user on subsequent booting operations. 
默认/初始目录入口可以包含一个软盘镜像,这个软盘镜像检查系统或者询问用户关于他的系统的配置,选择一个合适的SECTION入口,然后重新使用这个SECTION入口引导系统。  这个程序在它第一次启用时将写配置信息到用户的硬盘,然后在以后的引导操作时不询问用户。
This is particularly useful when a CD has multiple uses or the user purchases several CD’s from the same software vendor.  The selection program will already have configuration information available.
这非常有用,当一个CD有多个用途或者用户从同一个软件制造商买了多个CD。  选择程序将已经有了有效的配置信息。
 


6.0 New INT 13 Functions
Transparent system operation is not always desirable because software installation usually requires the system to be in its “normal” configuration.  For this reason 3 new INT 13 functions are provided.  These functions allow the system to return to its normal state or to enter the “boot” state a second time after the boot process has already been initiated.
透明的系统操作不总是令人想要的,因为软件安装通常需要系统处于它的“正常”配置。  由于这个原因,3个新的INT13功能被提供了。  这些功能允许系统返回到它的正常状态,或者在引导过程已经初始化完成之后的一段时间后再进入“引导”状态。


6.1 INT 13 Function 4A - Initiate Disk Emulation 初始化磁盘仿真
This function takes a pointer to the Specification Packet and uses it to make the specified drive letter available, using the Image LBA “pointer” in the supplied packet.
这个功能拿一个指向“特定包”的指针,使用这个指针去使特定的驱动器盘符有效,在提供的包中使用镜像的LBA“指针”。
Registers at call:
AH = 4A
AL = 00
DS:SI - Specification Packet as defined in figure 9(见表9)
Registers on return
AX - Return Codes
CF - Clear if selected drive is emulating
CF - Set if system not in emulation mode


(我注:没有软驱时,经VIRTUAL PC实验,光盘中有模拟软盘A:的可启动光盘,但机子从硬盘C盘启动,这时A:无法访问,调用这个中断后,出现了软盘A:,A:就是光盘中的软盘镜像的内容,可以正常访问。DS:SI指向的空间的内容是十六进制的:
13 82 00 01 1B 00 00 00 - 00 00 00 00 C0 07 01 00 - 4F 12 01
   软 号 控  扇区地址      驱规   缓冲  段    扇数    柱 扇 头


如果驱动器号不是设成00H,是其它任何数,则中断调用失败。
如果扇区地址与镜像所在的实际扇区地址不符,或者柱、扇、头与软盘镜像的实际参数不符,则中断也都能调用成功,但是进入A:后,DIR显示的数据乱七八糟,不对了。


(我注:没有软驱时,经VIRTUAL PC实验,光盘中有任何形式的光盘,机子从硬盘C盘启动,让DS:SI指向的空间的内容是十六进制的:
13 82 00 01 1B 00 00 00 - 00 00 00 00 C0 07 01 00 - 4F 12 01
   软 号 控  扇区地址      驱规   缓冲  段    扇数    柱 扇 头
调用中断成功,但DIR A:内容不对。
如果:
13 84 80 01 1B 00 00 00 - 00 00 00 00 C0 07 01 00 - 4F 12 01
硬 号 控  扇区地址      驱规   缓冲  段    扇数    柱 扇 头
调用成功!但DIR出现问题,C盘访问出现问题。但换成驱动器号为其它的,如81H,AAH,EFH等,都调用失败。
如果:
13 80 00 01 1B 00 00 00 - 00 00 00 00 C0 07 01 00 -4F 12 01
非 号 控  扇区地址      驱规   缓冲  段    扇数   柱 扇 头
调用失败。换成驱动器号为其它的,如80H,9FH,AAH,EFH等,也都调用失败。第2字节改成00H,也没有用,还是调用失败。说明,不支持“非仿真”模拟。


(我注:经实验,光盘中有“非仿真”的可启动光盘,光盘启动后,得到的DS:SI信息:
13 00 EF 01 1B 00 00 00 - 00 00 00 00 C0 07 04 00 -00 00 00
   非 号 控  扇区地址      驱规   缓冲  段    扇数   柱 扇 头

(我注:经VIRTUAL PC实验,非启动的数据光盘也可以用这个中断模拟成软盘00H,或硬盘80H,也就是说,这样就可以间接访问光盘的数据了。未深入试验。)


(我注:经不同主板引导到DOS下DEBUG试验,VIRTUAL PC和SOLTEK主板支持INT13H的4A,4C号功能,而ASUS和DELL不支持INT13H的4A,4C号功能,当然都是可以从光盘引导的。与主板的型号应也有关系,未深入试验。4A号功能模拟成“非仿真”模式,都不支持。)



6.2 INT 13 Function 4B - Terminate Disk Emulation停止磁盘仿真
This function returns the system to a configuration that matches a normal floppy or hard disk boot.  If the CD booted as a floppy, the “A” drive returns and the CD becomes driver addressed.  If the CD booted as a hard disk, the drive numbers are all decremented by 1, this returns all hard disks to their standard/normal device numbers.
这个功能使系统返回到一个配置状态,这个配置状态符合正常的软件或硬盘引导。 如果CD作为软盘引导,则(停止磁盘仿真后)"A"驱动器返回并且CD变成通过驱动程序访问。  如果CD作为硬盘引导,则(停止磁盘仿真后)所有驱动器号减1,这使得所有的硬盘返回到它们的标准/正常的设备编号。
Registers at call:
AH = 4B
AL = 00, Return Status and Terminate Emulation(停止磁盘仿真)
AL = 01, Return Status only, Do Not Terminate Emulation(不停止磁盘仿真)(我注:这时可以不管DL的值)
DL = Drive number to terminate,  7F = Terminate all
DS:SI - Empty Specification Packet, See figure 9(见表9)
(我注:这个地址指向的空间是用来存放中断返回时的“规格包”数据用的,不作为中断调用时的数据用,即中断调用时不需要“规格包”数据,调用前有乱七八糟的数据也没关系。)
Registers on return:
DS:SI - Completed Specification Packet, See Figure 9(见表9)
AX - Return Codes
CF - Clear if system released
CF - Set if system not in emulation mode,如果系统不在仿真模式中,则失败。(我注:经实验,就是说,要从光盘启动,这个中断功能才能用,如果从硬盘启动,那就不是仿真启动了,这个功能号调用就失败)
(我注:经实验,光盘仿真启动A:后,如果执行这个中断来停止仿真,则A:就没有了,访问不了了,“NOT READY READING DRIVE A”,但仍可以转到C:访问)
(我注:以“非仿真”光盘引导,经自编程序实验,4B功能的AL=01时返回的DS:SI数据表明,不同主板的返回的驱动器号不同,VIRTUAL PC返回的驱动器号是EFH,ASUS主板是EFH,DELL机是82H。)



6.3 INT 13 Function 4C - Initiate Disk Emulation & Boot初始化磁盘仿真和引导
This function takes a pointer to the Specification Packet and uses it to reboot the system from scratch.     This function only returns if the supplied packet does not contain a pointer to a bootable disk image.
这个功能拿一个指向“特定包”的指针,使用它去重新引导系统。 这个功能只返回,如果提供的包不包含一个指向一个可引导的磁盘镜像的指针。
Registers at call:
AH = 4C
AL = 00
DS:SI - Specification Packet as defined in figure 9(见表9)
Registers on return
AX - Return Codes
CF - Set if system failed to boot
CF Clear will not occur because when this function succeeds no return is generated.
(我注:这个功能在4AH功能的基础上,还能够进行引导)


6.4 INT 13 Function 4D - Return Boot Catalog返回引导目录内容
This function takes a drive number in DL, a command packet in DS:SI, and returns the requested number of sectors from the boot catalog.
这个功能拿DL中的驱动器号,一个DS:SI中的普通包,并且返回来自于引导目录的被请求数量的扇区。
Registers at call:
AH = 4D
AL = 00
DS:SI - Pointer to command packet as defined in figure 8(见表8)
DL(我注:DL值要设成驱动器号,可以用INT13H的4B功能号得到驱。如果驱动器号不对,则调用会失败。)
Registers on return:
AX - Return Codes
CF - Clear if successful
CF - Set if device is not an emulated CD, or command packet is out of bounds。如果不是一张仿真光盘,则失败。(我注:经实验,从光盘启动,这个中断功能能用,如果从硬盘启动,就不是仿真启动了,这个功能号调用会失败)



Offset Type Description
0 Byte Packet Size in bytes, currently 8H
1 Byte Sector count.  扇区数量
Number of sectors in the boot catalog to transfer
2-5 Dword Pointer to the buffer where the boot catalog will be moved
6-7 Word Beginning sector to transfer. 
This number is relative to the start of the boot catalog. 
The initial call to INT 13 Function 4D should always set this value to 0.
Figure 8 - Command Packet 命令包


 


Offset Type Description
0 Byte Packet Size, currently 13H
1 Byte Boot media type. 
This specifies what  media the boot image is intended to emulate in bits 0-3. 
Bits 6 and 7 are specific to the type of system.
Bits 0-3 count as follows:
0 - No Emulation
1 - 1.2 meg diskette
2 -1.44 meg diskette
3 -2.88 meg diskette
4 -Hard Disk (drive C)
5-F-Reserved, invalid at this time
bits 4-5 - Reserved, must be 0
bit 6 - Image contains an ATAPI driver, bytes 8 & 9 refer to IDE interface
bit 7 - Image contains SCSI drivers, bytes 8 & 9 refer to SCSI interface
2 Byte Drive Number. 
This is the drive number on which emulation is being initiated or terminated.  This must be 0 for a floppy image, 80 for a bootable hard disk, and 81-FF for a “non-bootable” or “no emulation” drive.
3 Byte Controller Index. 
This specifies the controller number of the specified CD drive.
(我注:光驱可能有多个,这个值应该是表示光盘在哪个光驱中)
4-7 Dword Logical Block Address for the disk image to be emulated.
(我注:即镜像在光盘中的扇区地址,第一个扇区是扇区0)
8-9 Word Device Specification.
For SCSI controllers, byte 8 is the LUN and PUN of the CD Drive, byte 9 is the Bus number. 
For IDE controllers, the low order bit of byte 8 specifies master/slave device, 0 = master.
A-B Word User Buffer Segment. 
If this field is non-zero, it specifies the segment of a user supplied 3k buffer for caching CD reads.  This buffer will begin at Segment:0.
C-D Word Load Segment. 
This is the load address for the initial boot image. 
If this value is 0 the system will use the traditional segment of 7C0. 
If this value is non-zero the system will use the specified address. 
This field is only valid for function 4C
E-F Word Sector Count. 
This is the number of virtual sectors the system will store at Load Segment during the initial boot procedure. 
This field is only valid for function 4C
10H Byte Bits 0-7 of the cylinder count.  柱
This should match the value returned in CH when INT 13 function 08 is invoked.
(我注:是最大柱号,不是总柱数,柱号从0开始)
11H Byte This is the value returned in the CL register when INT 13 function 08 is invoked.  柱-扇
Bits 0-5 are the sector count.  Bits 6 and 7 are the high order 2 bits of the cylinder count.
(我注:是最大扇号,也是总扇数,扇号从1开始)
12H Byte This is the head count, it should match the value in DH when INT 13 Function 08 is invoked. 头
(我注:是最大头号,不是总头数,头号从0开始)
Figure 9. - Specification Packet

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
7
关闭 站长推荐上一条 /3 下一条