boot cd_rom struct

资料:

1、introduction_to_iso9660.pdf

2、boot-cdrom.pdf

Normal ISO9600:
offset: 16*2048[0x8000]
The Primary Volume Descriptor

#pragma pack(push,1)
typedef struct _PRIMARY_VOLUME_DESCRIPTOR
{
    char                 VolDesType;                //Volume Descriptor Type[1]
    char                 StandardId[5];          //Standard Identifier[CD001]
    char                 VolDesVer;                //Volume Descriptor Version[1]
    char                Reserved1;                //[0x00]
    char                SystemId[32];            //System Identifier[a-characters allowed18]
    char                VolumeId[32];            //Volume Identifier[d-characters allowed19]
    char                Reserved2[8];            //[0x00]
    unsigned long        dwVolSpaSizeLow;        //Number of logical blocks in the Volume.
    unsigned long        dwVolSpaSizeHigh;
    char                Reserved3[32];            //[0x00]
    unsigned long        dwVolSetSize;            //The assigned Volume Set size of the Volume.
    unsigned long        dwVolSeqNum;            //The ordinal number of the volume in the Volume Set.
    unsigned long        dwLogBlockSize;            //The size in bytes of a Logical Block.
    unsigned long        dwPathTabSizeLow;        //Length in bytes of the path table.
    unsigned long        dwPathTabSizeHigh;
    unsigned long        dwLocTypeLPT;            
    unsigned long        dwLocOptionalTypeLPT;
    unsigned long        dwLocTypeMPT;    
    unsigned long        dwLocOptionalTypeMPT;
    char                 DirRecTootDir[34];
    char                VolSetId[128];            //Volume Set Identifier. d-characters allowed.
    char                PublisherId[128];        //Publisher Identifier. a-characters allowed.
    char                DataPerId[128];            //Data Perparer Identifier. a-characters allowed.
    char                AppId[128];                //Applicatoin Identifier.
    char                CopyrightFileId[37];    //Copyright File Identifier.
    char                AbbstractFileId[37];    //Abstract File Identifier.
    char                BiblioFileId[37];        //Bibliographic File Identifier.
    char                VolCreaDT[17];            //Volume Creation Date and Time.
    char                VolModifDT[17];            //Volume Modification Date and Time.
    char                VolExpirDT[17];            //Volume Expiration Date and Time.
    char                VolEffecDT[17];            //Volume Effective Data and Time.
    char                FileStrucVer;            //File Structure Version[1]
    char                Reserved4;                //Reserved for future standardization.[0x00]
    char                AppUse[512];            //Application Use.
    char                Reserved5[653];            //Reserved for future standardization.[0x00]
    }PRIMARY_VOLUME_DESCRIPTOR, *PPRIMARY_VOLUME_DESCRIPTOR;
#pragma pack(pop)
View Code

Date and Time:
Represented by seven bytes:
1: Number of years since 1900
2: Month of the year from 1 to 12
3: Day of the Month from 1 to 31
4: Hour of the day from 0 to 23
5: Minute of the hour from 0 to 59
6: second of the minute from 0 to 59
7: Offset from Greenwich Mean Time in Number of
15 minute intervals from -48(West) to +52(East)

boot CD_ROM:
offset: 16*2048[0x8000]
The Primary Volume Descriptor

offset: 17*2048[0x8800]
Boot Record Volume Descriptor

#pragma pack(push,1)
typedef struct _BOOTRECORD_VOLUME_DESCRIPTOR
{
    char                BootRecordInd;        //Boot Record Indicator, must be 0.
    char                ISO_9660Id[4];        //ISO-9660 Identifier, must be "CD001".
    char                VolVer;                //Version of this descriptor, must be 1.
    char                BootSystemId[32];    //Boot System Identifier, must be "EL TORITO SPECIFICATION" padded with 0's.
    char                Reserved1[32];        //Unused, must be 0.
    unsigned long        dwSecOfBootCatalog;    //Absolute pointer to first sector of Boot Catolog.
    char                Reserved2[1974];    //Unused, must be 0.
}BOOTRECORD_VOLUME_DESCRIPTOR, *PPBOOTRECORD_VOLUME_DESCRIPTOR;    
#pragma pack(pop)
View Code

Booting Catalog:
1. Validation Entry

#pragma pack(push,1)
typedef struct _BC_VALIDATION_ENTRY
{
    char                HeaderID;            //Header ID, must be 01.
    char                PlatformID;            //Platform ID. 0=80x86, 1=Power PC, 2=Mac
    unsigned short        wReserved;            //Reserved, must be 0.
    char                DeveloperID[24];    //ID string. to identify the developer of the CD_ROM
    unsigned short        wChecksum;            //Chaecksum Word. This sum of all the words in this record should be 0.
    char                kb55;                //Key byte,must be 0x55
    char                 kbAA;                //key byte,must be 0xAA
} BC_VALIDATION_ENTRY, *PBC_VALIDATION_ENTRY;
#pragma pack(pop)
View Code

2. Initial.Default Entry

#pragma pack(push,1)
typedef struct _BC_VALIDATION_ENTRY
{
    char                HeaderID;            //Header ID, must be 01.
    char                PlatformID;            //Platform ID. 0=80x86, 1=Power PC, 2=Mac
    unsigned short        wReserved;            //Reserved, must be 0.
    char                DeveloperID[24];    //ID string. to identify the developer of the CD_ROM
    unsigned short        wChecksum;            //Chaecksum Word. This sum of all the words in this record should be 0.
    char                kb55;                //Key byte,must be 0x55
    char                 kbAA;                //key byte,must be 0xAA
} BC_VALIDATION_ENTRY, *PBC_VALIDATION_ENTRY;
#pragma pack(pop)
View Code

2.1 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

3. Section Header

#pragma pack(push,1)
typedef struct _BC_SECTION_HEADER_ENTRY
{
    char                HeaderInd;            //Header Indicator as follows: 90-Header more headers follow, 91-Final Header
    char                PlatformID;            //Platform ID. 0=80x86, 1=Power PC, 2=Mac
    unsigned short        wNumber;            //Number of section entries following this header
    char                ID[28];                //ID string
} BC_SECTION_HEADER_ENTRY, *PBC_SECTION_HEADER_ENTRY;
#pragma pack(pop)
View Code

4. Section Entry

#pragma pack(push,1)
typedef struct _BC_SECTION_ENTRY
{
    char                BootInd;            //Boot Indicator. 88=Bootable, 00=Not Bootable
    char                BootMediaType;        //Boot media type.
    unsigned short        wLoadSegment;        //Load Segment. 0 use 0x7C0, non-zero use the specified segment.
    char                SystemType;            //System Type. 
    char                Reserved1;            //Unused, must be 0
    unsigned short        wSectorCount;        //Sector Count.
    unsigned long        dwLoadRBA;            //Load RBA. CD's use Relative/Logical block addressing.
    char                CriteriaType;        //Selection criteria type.
    char                UniqueCriteria[19];    //Vendor unique selection criteria.
} BC_SECTION_ENTRY, *PBC_SECTION_ENTRY;
#pragma pack(pop)
View Code

4.1 Boot media type.
This specifies what media the boot image emulates in bits 0-32.
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

4.2 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

5. Section Entry Extension

#pragma pack(push,1)
typedef struct _BC_SECTION_ENTRY_EXT
{
    char                ExtInd;                //Extension Indicator. must be 0x44
    char                Follow;                //Bits 1-4:Unused, 5:1=Extension Record follows, 0=This is final Extension, 6-7:Unused
    char                UniqueCriteria[30];    //Vendow unique selection criteria
} BC_SECTION_ENTRY_EXT, *PBC_SECTION_ENTRY_EXT;
#pragma pack(pop)
View Code
原文地址:https://www.cnblogs.com/qintangtao/p/3372635.html