1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * (C) Copyright 2001 3*4882a593Smuzhiyun * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch. 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * SPDX-License-Identifier: GPL-2.0+ 6*4882a593Smuzhiyun */ 7*4882a593Smuzhiyun #ifndef _PART_CD_H 8*4882a593Smuzhiyun #define _PART_CD_H 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun #define BRVD 0x11 11*4882a593Smuzhiyun #define PVD_OFFSET 0x10 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun typedef struct iso_boot_rec { 15*4882a593Smuzhiyun unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */ 16*4882a593Smuzhiyun unsigned char stand_ident[5]; /* "CD001" */ 17*4882a593Smuzhiyun unsigned char vers; /* Version */ 18*4882a593Smuzhiyun char ident_str[0x20]; /* Ident String "EL TORITO SPECIFICATION" */ 19*4882a593Smuzhiyun unsigned char unused[0x20]; /* unused */ 20*4882a593Smuzhiyun unsigned char pointer[4]; /* absolute pointer to Boot Catalog */ 21*4882a593Smuzhiyun } iso_boot_rec_t; 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun typedef struct iso_pri_rec { 25*4882a593Smuzhiyun unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */ 26*4882a593Smuzhiyun unsigned char stand_ident[5]; /* "CD001" */ 27*4882a593Smuzhiyun unsigned char vers; /* Version */ 28*4882a593Smuzhiyun unsigned char unused; 29*4882a593Smuzhiyun char sysid[32]; /* system Identifier */ 30*4882a593Smuzhiyun char volid[32]; /* volume Identifier */ 31*4882a593Smuzhiyun unsigned char zeros1[8]; /* unused */ 32*4882a593Smuzhiyun unsigned int volsiz_LE; /* volume size Little Endian */ 33*4882a593Smuzhiyun unsigned int volsiz_BE; /* volume size Big Endian */ 34*4882a593Smuzhiyun unsigned char zeros2[32]; /* unused */ 35*4882a593Smuzhiyun unsigned short setsize_LE; /* volume set size LE */ 36*4882a593Smuzhiyun unsigned short setsize_BE; /* volume set size BE */ 37*4882a593Smuzhiyun unsigned short seqnum_LE; /* volume sequence number LE */ 38*4882a593Smuzhiyun unsigned short seqnum_BE; /* volume sequence number BE */ 39*4882a593Smuzhiyun unsigned short secsize_LE; /* sector size LE */ 40*4882a593Smuzhiyun unsigned short secsize_BE; /* sector size BE */ 41*4882a593Smuzhiyun unsigned int pathtablen_LE;/* Path Table size LE */ 42*4882a593Smuzhiyun unsigned int pathtablen_BE;/* Path Table size BE */ 43*4882a593Smuzhiyun unsigned int firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */ 44*4882a593Smuzhiyun unsigned int firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */ 45*4882a593Smuzhiyun unsigned int firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */ 46*4882a593Smuzhiyun unsigned int firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */ 47*4882a593Smuzhiyun unsigned char rootdir[34]; /* directory record for root dir */ 48*4882a593Smuzhiyun char volsetid[128];/* Volume set identifier */ 49*4882a593Smuzhiyun char pubid[128]; /* Publisher identifier */ 50*4882a593Smuzhiyun char dataprepid[128]; /* data preparer identifier */ 51*4882a593Smuzhiyun char appid[128]; /* application identifier */ 52*4882a593Smuzhiyun char copyr[37]; /* copyright string */ 53*4882a593Smuzhiyun char abstractfileid[37]; /* abstract file identifier */ 54*4882a593Smuzhiyun char bibliofileid[37]; /* bibliographic file identifier */ 55*4882a593Smuzhiyun unsigned char creationdate[17]; /* creation date */ 56*4882a593Smuzhiyun unsigned char modify[17]; /* modification date */ 57*4882a593Smuzhiyun unsigned char expire[17]; /* expiring date */ 58*4882a593Smuzhiyun unsigned char effective[17];/* effective date */ 59*4882a593Smuzhiyun unsigned char filestruc_ver; /* file structur version */ 60*4882a593Smuzhiyun } iso_pri_rec_t; 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun typedef struct iso_sup_rec { 63*4882a593Smuzhiyun unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */ 64*4882a593Smuzhiyun unsigned char stand_ident[5]; /* "CD001" */ 65*4882a593Smuzhiyun unsigned char vers; /* Version */ 66*4882a593Smuzhiyun unsigned char volumeflags; /* if bit 0 = 0 => all escape sequences are according ISO 2375 */ 67*4882a593Smuzhiyun char sysid[32]; /* system Identifier */ 68*4882a593Smuzhiyun char volid[32]; /* volume Identifier */ 69*4882a593Smuzhiyun unsigned char zeros1[8]; /* unused */ 70*4882a593Smuzhiyun unsigned int volsiz_LE; /* volume size Little Endian */ 71*4882a593Smuzhiyun unsigned int volsiz_BE; /* volume size Big Endian */ 72*4882a593Smuzhiyun unsigned char escapeseq[32];/* Escape sequences */ 73*4882a593Smuzhiyun unsigned short setsize_LE; /* volume set size LE */ 74*4882a593Smuzhiyun unsigned short setsize_BE; /* volume set size BE */ 75*4882a593Smuzhiyun unsigned short seqnum_LE; /* volume sequence number LE */ 76*4882a593Smuzhiyun unsigned short seqnum_BE; /* volume sequence number BE */ 77*4882a593Smuzhiyun unsigned short secsize_LE; /* sector size LE */ 78*4882a593Smuzhiyun unsigned short secsize_BE; /* sector size BE */ 79*4882a593Smuzhiyun unsigned int pathtablen_LE;/* Path Table size LE */ 80*4882a593Smuzhiyun unsigned int pathtablen_BE;/* Path Table size BE */ 81*4882a593Smuzhiyun unsigned int firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */ 82*4882a593Smuzhiyun unsigned int firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */ 83*4882a593Smuzhiyun unsigned int firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */ 84*4882a593Smuzhiyun unsigned int firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */ 85*4882a593Smuzhiyun unsigned char rootdir[34]; /* directory record for root dir */ 86*4882a593Smuzhiyun char volsetid[128];/* Volume set identifier */ 87*4882a593Smuzhiyun char pubid[128]; /* Publisher identifier */ 88*4882a593Smuzhiyun char dataprepid[128]; /* data preparer identifier */ 89*4882a593Smuzhiyun char appid[128]; /* application identifier */ 90*4882a593Smuzhiyun char copyr[37]; /* copyright string */ 91*4882a593Smuzhiyun char abstractfileid[37]; /* abstract file identifier */ 92*4882a593Smuzhiyun char bibliofileid[37]; /* bibliographic file identifier */ 93*4882a593Smuzhiyun unsigned char creationdate[17]; /* creation date */ 94*4882a593Smuzhiyun unsigned char modify[17]; /* modification date */ 95*4882a593Smuzhiyun unsigned char expire[17]; /* expiring date */ 96*4882a593Smuzhiyun unsigned char effective[17];/* effective date */ 97*4882a593Smuzhiyun unsigned char filestruc_ver; /* file structur version */ 98*4882a593Smuzhiyun }iso_sup_rec_t; 99*4882a593Smuzhiyun 100*4882a593Smuzhiyun typedef struct iso_part_rec { 101*4882a593Smuzhiyun unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */ 102*4882a593Smuzhiyun unsigned char stand_ident[5]; /* "CD001" */ 103*4882a593Smuzhiyun unsigned char vers; /* Version */ 104*4882a593Smuzhiyun unsigned char unused; 105*4882a593Smuzhiyun char sysid[32]; /* system Identifier */ 106*4882a593Smuzhiyun char volid[32]; /* volume partition Identifier */ 107*4882a593Smuzhiyun unsigned int partloc_LE; /* volume partition location LE */ 108*4882a593Smuzhiyun unsigned int partloc_BE; /* volume partition location BE */ 109*4882a593Smuzhiyun unsigned int partsiz_LE; /* volume partition size LE */ 110*4882a593Smuzhiyun unsigned int partsiz_BE; /* volume partition size BE */ 111*4882a593Smuzhiyun }iso_part_rec_t; 112*4882a593Smuzhiyun 113*4882a593Smuzhiyun 114*4882a593Smuzhiyun typedef struct iso_val_entry { 115*4882a593Smuzhiyun unsigned char header_id; /* Header ID must be 0x01 */ 116*4882a593Smuzhiyun unsigned char platform; /* Platform: 0=x86, 1=PowerPC, 2=MAC */ 117*4882a593Smuzhiyun unsigned char res[2]; /* reserved */ 118*4882a593Smuzhiyun char manu_str[0x18]; /* Ident String of manufacturer/developer */ 119*4882a593Smuzhiyun unsigned char chk_sum[2]; /* Check sum (all words must be zero) */ 120*4882a593Smuzhiyun unsigned char key[2]; /* key[0]=55, key[1]=0xAA */ 121*4882a593Smuzhiyun } iso_val_entry_t; 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun typedef struct iso_header_entry { 124*4882a593Smuzhiyun unsigned char header_id; /* Header ID must be 0x90 or 0x91 */ 125*4882a593Smuzhiyun unsigned char platform; /* Platform: 0=x86, 1=PowerPC, 2=MAC */ 126*4882a593Smuzhiyun unsigned char numentry[2]; /* number of entries */ 127*4882a593Smuzhiyun char id_str[0x1C]; /* Ident String of sectionr */ 128*4882a593Smuzhiyun } iso_header_entry_t; 129*4882a593Smuzhiyun 130*4882a593Smuzhiyun 131*4882a593Smuzhiyun typedef struct iso_init_def_entry { 132*4882a593Smuzhiyun unsigned char boot_ind; /* Boot indicator 0x88=bootable 0=not bootable */ 133*4882a593Smuzhiyun unsigned char boot_media; /* boot Media Type: 0=no Emulation, 1=1.2MB floppy, 2=1.44MB floppy, 3=2.88MB floppy 4=hd (0x80) */ 134*4882a593Smuzhiyun unsigned char ld_seg[2]; /* Load segment (flat model=addr/10) */ 135*4882a593Smuzhiyun unsigned char systype; /* System Type copy of byte5 of part table */ 136*4882a593Smuzhiyun unsigned char res; /* reserved */ 137*4882a593Smuzhiyun unsigned char sec_cnt[2]; /* sector count in VIRTUAL Blocks (0x200) */ 138*4882a593Smuzhiyun unsigned char rel_block_addr[4]; /* relative Block address */ 139*4882a593Smuzhiyun } iso_init_def_entry_t; 140*4882a593Smuzhiyun 141*4882a593Smuzhiyun 142*4882a593Smuzhiyun void print_partition_cd(int dev); 143*4882a593Smuzhiyun 144*4882a593Smuzhiyun #endif /* _PART_CD_H */ 145