blob: 6973a2943e17c1d2d20eb754ae4c3941395a7b16 [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
wdenk012771d2002-03-08 21:31:05 +000012typedef struct iso_boot_rec {
13 unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
14 unsigned char stand_ident[5]; /* "CD001" */
15 unsigned char vers; /* Version */
16 char ident_str[0x20]; /* Ident String "EL TORITO SPECIFICATION" */
17 unsigned char unused[0x20]; /* unused */
18 unsigned char pointer[4]; /* absolute pointer to Boot Catalog */
19} iso_boot_rec_t;
20
wdenk012771d2002-03-08 21:31:05 +000021typedef struct iso_pri_rec {
22 unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
23 unsigned char stand_ident[5]; /* "CD001" */
24 unsigned char vers; /* Version */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020025 unsigned char unused;
26 char sysid[32]; /* system Identifier */
wdenk012771d2002-03-08 21:31:05 +000027 char volid[32]; /* volume Identifier */
28 unsigned char zeros1[8]; /* unused */
Alexander Grafef9e6de2016-04-11 16:16:14 +020029 unsigned int volsiz_LE; /* volume size Little Endian */
30 unsigned int volsiz_BE; /* volume size Big Endian */
wdenk012771d2002-03-08 21:31:05 +000031 unsigned char zeros2[32]; /* unused */
32 unsigned short setsize_LE; /* volume set size LE */
33 unsigned short setsize_BE; /* volume set size BE */
34 unsigned short seqnum_LE; /* volume sequence number LE */
35 unsigned short seqnum_BE; /* volume sequence number BE */
36 unsigned short secsize_LE; /* sector size LE */
37 unsigned short secsize_BE; /* sector size BE */
Alexander Grafef9e6de2016-04-11 16:16:14 +020038 unsigned int pathtablen_LE;/* Path Table size LE */
39 unsigned int pathtablen_BE;/* Path Table size BE */
40 unsigned int firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
41 unsigned int firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
42 unsigned int firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
43 unsigned int firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020044 unsigned char rootdir[34]; /* directory record for root dir */
45 char volsetid[128];/* Volume set identifier */
46 char pubid[128]; /* Publisher identifier */
47 char dataprepid[128]; /* data preparer identifier */
48 char appid[128]; /* application identifier */
49 char copyr[37]; /* copyright string */
50 char abstractfileid[37]; /* abstract file identifier */
51 char bibliofileid[37]; /* bibliographic file identifier */
52 unsigned char creationdate[17]; /* creation date */
53 unsigned char modify[17]; /* modification date */
54 unsigned char expire[17]; /* expiring date */
55 unsigned char effective[17];/* effective date */
56 unsigned char filestruc_ver; /* file structur version */
wdenk012771d2002-03-08 21:31:05 +000057} iso_pri_rec_t;
58
59typedef struct iso_sup_rec {
60 unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
61 unsigned char stand_ident[5]; /* "CD001" */
62 unsigned char vers; /* Version */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020063 unsigned char volumeflags; /* if bit 0 = 0 => all escape sequences are according ISO 2375 */
64 char sysid[32]; /* system Identifier */
wdenk012771d2002-03-08 21:31:05 +000065 char volid[32]; /* volume Identifier */
66 unsigned char zeros1[8]; /* unused */
Alexander Grafef9e6de2016-04-11 16:16:14 +020067 unsigned int volsiz_LE; /* volume size Little Endian */
68 unsigned int volsiz_BE; /* volume size Big Endian */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020069 unsigned char escapeseq[32];/* Escape sequences */
wdenk012771d2002-03-08 21:31:05 +000070 unsigned short setsize_LE; /* volume set size LE */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020071 unsigned short setsize_BE; /* volume set size BE */
72 unsigned short seqnum_LE; /* volume sequence number LE */
73 unsigned short seqnum_BE; /* volume sequence number BE */
74 unsigned short secsize_LE; /* sector size LE */
75 unsigned short secsize_BE; /* sector size BE */
Alexander Grafef9e6de2016-04-11 16:16:14 +020076 unsigned int pathtablen_LE;/* Path Table size LE */
77 unsigned int pathtablen_BE;/* Path Table size BE */
78 unsigned int firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
79 unsigned int firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
80 unsigned int firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
81 unsigned int firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020082 unsigned char rootdir[34]; /* directory record for root dir */
83 char volsetid[128];/* Volume set identifier */
84 char pubid[128]; /* Publisher identifier */
85 char dataprepid[128]; /* data preparer identifier */
86 char appid[128]; /* application identifier */
87 char copyr[37]; /* copyright string */
88 char abstractfileid[37]; /* abstract file identifier */
89 char bibliofileid[37]; /* bibliographic file identifier */
90 unsigned char creationdate[17]; /* creation date */
91 unsigned char modify[17]; /* modification date */
92 unsigned char expire[17]; /* expiring date */
93 unsigned char effective[17];/* effective date */
94 unsigned char filestruc_ver; /* file structur version */
wdenk012771d2002-03-08 21:31:05 +000095}iso_sup_rec_t;
96
97typedef struct iso_part_rec {
98 unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
99 unsigned char stand_ident[5]; /* "CD001" */
100 unsigned char vers; /* Version */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200101 unsigned char unused;
102 char sysid[32]; /* system Identifier */
103 char volid[32]; /* volume partition Identifier */
Alexander Grafef9e6de2016-04-11 16:16:14 +0200104 unsigned int partloc_LE; /* volume partition location LE */
105 unsigned int partloc_BE; /* volume partition location BE */
106 unsigned int partsiz_LE; /* volume partition size LE */
107 unsigned int partsiz_BE; /* volume partition size BE */
wdenk012771d2002-03-08 21:31:05 +0000108}iso_part_rec_t;
109
wdenk012771d2002-03-08 21:31:05 +0000110typedef struct iso_val_entry {
111 unsigned char header_id; /* Header ID must be 0x01 */
112 unsigned char platform; /* Platform: 0=x86, 1=PowerPC, 2=MAC */
113 unsigned char res[2]; /* reserved */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200114 char manu_str[0x18]; /* Ident String of manufacturer/developer */
115 unsigned char chk_sum[2]; /* Check sum (all words must be zero) */
wdenk012771d2002-03-08 21:31:05 +0000116 unsigned char key[2]; /* key[0]=55, key[1]=0xAA */
117} iso_val_entry_t;
118
119typedef struct iso_header_entry {
120 unsigned char header_id; /* Header ID must be 0x90 or 0x91 */
121 unsigned char platform; /* Platform: 0=x86, 1=PowerPC, 2=MAC */
122 unsigned char numentry[2]; /* number of entries */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200123 char id_str[0x1C]; /* Ident String of sectionr */
wdenk012771d2002-03-08 21:31:05 +0000124} iso_header_entry_t;
125
wdenk012771d2002-03-08 21:31:05 +0000126typedef struct iso_init_def_entry {
127 unsigned char boot_ind; /* Boot indicator 0x88=bootable 0=not bootable */
128 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) */
129 unsigned char ld_seg[2]; /* Load segment (flat model=addr/10) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200130 unsigned char systype; /* System Type copy of byte5 of part table */
wdenk012771d2002-03-08 21:31:05 +0000131 unsigned char res; /* reserved */
132 unsigned char sec_cnt[2]; /* sector count in VIRTUAL Blocks (0x200) */
133 unsigned char rel_block_addr[4]; /* relative Block address */
134} iso_init_def_entry_t;
135
wdenk012771d2002-03-08 21:31:05 +0000136void print_partition_cd(int dev);
137
wdenk012771d2002-03-08 21:31:05 +0000138#endif /* _PART_CD_H */