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