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