blob: e5a3e0220f062befd458ea89fd271089d47715d4 [file] [log] [blame]
wdenk012771d2002-03-08 21:31:05 +00001/*
2 * (C) Copyright 2001
3 * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch.
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk012771d2002-03-08 21:31:05 +00006 */
7#ifndef _PART_CD_H
8#define _PART_CD_H
9
10#define BRVD 0x11
11#define PVD_OFFSET 0x10
12
13
14typedef 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
24typedef 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 Denk53677ef2008-05-20 16:00:29 +020028 unsigned char unused;
29 char sysid[32]; /* system Identifier */
wdenk012771d2002-03-08 21:31:05 +000030 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 Denk53677ef2008-05-20 16:00:29 +020044 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 */
wdenk012771d2002-03-08 21:31:05 +000060} iso_pri_rec_t;
61
62typedef 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 Denk53677ef2008-05-20 16:00:29 +020066 unsigned char volumeflags; /* if bit 0 = 0 => all escape sequences are according ISO 2375 */
67 char sysid[32]; /* system Identifier */
wdenk012771d2002-03-08 21:31:05 +000068 char volid[32]; /* volume Identifier */
69 unsigned char zeros1[8]; /* unused */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020070 unsigned long volsiz_LE; /* volume size Little Endian */
71 unsigned long volsiz_BE; /* volume size Big Endian */
72 unsigned char escapeseq[32];/* Escape sequences */
wdenk012771d2002-03-08 21:31:05 +000073 unsigned short setsize_LE; /* volume set size LE */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020074 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 */
wdenk012771d2002-03-08 21:31:05 +000079 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 Denk53677ef2008-05-20 16:00:29 +020082 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 */
wdenk012771d2002-03-08 21:31:05 +000098}iso_sup_rec_t;
99
100typedef 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 Denk53677ef2008-05-20 16:00:29 +0200104 unsigned char unused;
105 char sysid[32]; /* system Identifier */
106 char volid[32]; /* volume partition Identifier */
wdenk012771d2002-03-08 21:31:05 +0000107 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
wdenk012771d2002-03-08 21:31:05 +0000114typedef 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 Denk53677ef2008-05-20 16:00:29 +0200118 char manu_str[0x18]; /* Ident String of manufacturer/developer */
119 unsigned char chk_sum[2]; /* Check sum (all words must be zero) */
wdenk012771d2002-03-08 21:31:05 +0000120 unsigned char key[2]; /* key[0]=55, key[1]=0xAA */
121} iso_val_entry_t;
122
123typedef 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 Denk53677ef2008-05-20 16:00:29 +0200127 char id_str[0x1C]; /* Ident String of sectionr */
wdenk012771d2002-03-08 21:31:05 +0000128} iso_header_entry_t;
129
130
131typedef 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 Denk53677ef2008-05-20 16:00:29 +0200135 unsigned char systype; /* System Type copy of byte5 of part table */
wdenk012771d2002-03-08 21:31:05 +0000136 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
142void print_partition_cd(int dev);
143
wdenk012771d2002-03-08 21:31:05 +0000144#endif /* _PART_CD_H */