part_iso.h 6.83 KB
Newer Older
wdenk's avatar
wdenk committed
1 2 3 4
/*
 * (C) Copyright 2001
 * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch.
 *
5
 * SPDX-License-Identifier:	GPL-2.0+
wdenk's avatar
wdenk committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
 */
#ifndef _PART_CD_H
#define _PART_CD_H

#define BRVD	0x11
#define PVD_OFFSET 0x10


typedef struct iso_boot_rec {
	unsigned char desctype;			/* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
	unsigned char stand_ident[5]; /* "CD001" */
	unsigned char vers;					/* Version */
	char					ident_str[0x20]; /* Ident String "EL TORITO SPECIFICATION" */
	unsigned char unused[0x20];		/* unused */
	unsigned char pointer[4];		/* absolute pointer to Boot Catalog */
} iso_boot_rec_t;


typedef struct iso_pri_rec {
	unsigned char desctype;			/* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
	unsigned char stand_ident[5]; /* "CD001" */
	unsigned char vers;					/* Version */
Wolfgang Denk's avatar
Wolfgang Denk committed
28 29
	unsigned char unused;
	char					sysid[32];		/* system Identifier */
wdenk's avatar
wdenk committed
30 31
	char					volid[32];		/* volume Identifier */
	unsigned char zeros1[8];		/* unused */
32 33
	unsigned int volsiz_LE;		/* volume size Little Endian */
	unsigned int volsiz_BE;		/* volume size Big Endian */
wdenk's avatar
wdenk committed
34 35 36 37 38 39 40
	unsigned char zeros2[32];		/* unused */
	unsigned short setsize_LE;	/* volume set size LE */
	unsigned short setsize_BE;	/* volume set size BE */
	unsigned short seqnum_LE;		/* volume sequence number LE */
	unsigned short seqnum_BE;		/* volume sequence number BE */
	unsigned short secsize_LE;	/* sector size LE */
	unsigned short secsize_BE;	/* sector size BE */
41 42 43 44 45 46
	unsigned int pathtablen_LE;/* Path Table size LE */
	unsigned int pathtablen_BE;/* Path Table size BE */
	unsigned int firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
	unsigned int firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
	unsigned int firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
	unsigned int firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
Wolfgang Denk's avatar
Wolfgang Denk committed
47 48 49 50 51 52 53 54 55 56 57 58 59
	unsigned char rootdir[34];	/* directory record for root dir */
	char					volsetid[128];/* Volume set identifier */
	char					pubid[128];		/* Publisher identifier */
	char					dataprepid[128]; /* data preparer identifier */
	char					appid[128];		/* application identifier */
	char					copyr[37];		/* copyright string */
	char					abstractfileid[37]; /* abstract file identifier */
	char					bibliofileid[37]; /* bibliographic file identifier */
	unsigned char creationdate[17]; /* creation date */
	unsigned char modify[17];		/* modification date */
	unsigned char expire[17];		/* expiring date */
	unsigned char effective[17];/* effective date */
	unsigned char filestruc_ver;	/* file structur version */
wdenk's avatar
wdenk committed
60 61 62 63 64 65
} iso_pri_rec_t;

typedef struct iso_sup_rec {
	unsigned char desctype;			/* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
	unsigned char stand_ident[5]; /* "CD001" */
	unsigned char vers;					/* Version */
Wolfgang Denk's avatar
Wolfgang Denk committed
66 67
	unsigned char volumeflags;	/* if bit 0 = 0 => all escape sequences are according ISO 2375 */
	char					sysid[32];		/* system Identifier */
wdenk's avatar
wdenk committed
68 69
	char					volid[32];		/* volume Identifier */
	unsigned char zeros1[8];		/* unused */
70 71
	unsigned int volsiz_LE;		/* volume size Little Endian */
	unsigned int volsiz_BE;		/* volume size Big Endian */
Wolfgang Denk's avatar
Wolfgang Denk committed
72
	unsigned char escapeseq[32];/* Escape sequences */
wdenk's avatar
wdenk committed
73
	unsigned short setsize_LE;	/* volume set size LE */
Wolfgang Denk's avatar
Wolfgang Denk committed
74 75 76 77 78
	unsigned short setsize_BE;	/* volume set size BE */
	unsigned short seqnum_LE;		/* volume sequence number LE */
	unsigned short seqnum_BE;		/* volume sequence number BE */
	unsigned short secsize_LE;	/* sector size LE */
	unsigned short secsize_BE;	/* sector size BE */
79 80 81 82 83 84
	unsigned int pathtablen_LE;/* Path Table size LE */
	unsigned int pathtablen_BE;/* Path Table size BE */
	unsigned int firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
	unsigned int firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
	unsigned int firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
	unsigned int firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
Wolfgang Denk's avatar
Wolfgang Denk committed
85 86 87 88 89 90 91 92 93 94 95 96 97
	unsigned char rootdir[34];	/* directory record for root dir */
	char					volsetid[128];/* Volume set identifier */
	char					pubid[128];		/* Publisher identifier */
	char					dataprepid[128]; /* data preparer identifier */
	char					appid[128];		/* application identifier */
	char					copyr[37];		/* copyright string */
	char					abstractfileid[37]; /* abstract file identifier */
	char					bibliofileid[37]; /* bibliographic file identifier */
	unsigned char creationdate[17]; /* creation date */
	unsigned char modify[17];		/* modification date */
	unsigned char expire[17];		/* expiring date */
	unsigned char effective[17];/* effective date */
	unsigned char filestruc_ver;	/* file structur version */
wdenk's avatar
wdenk committed
98 99 100 101 102 103
}iso_sup_rec_t;

typedef struct iso_part_rec {
	unsigned char desctype;			/* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
	unsigned char stand_ident[5]; /* "CD001" */
	unsigned char vers;					/* Version */
Wolfgang Denk's avatar
Wolfgang Denk committed
104 105 106
	unsigned char unused;
	char					sysid[32];		 /* system Identifier */
	char					volid[32];		/* volume partition Identifier */
107 108 109 110
	unsigned int partloc_LE;		/* volume partition location LE */
	unsigned int partloc_BE;		/* volume partition location BE */
	unsigned int partsiz_LE;		/* volume partition size LE */
	unsigned int partsiz_BE;		/* volume partition size BE */
wdenk's avatar
wdenk committed
111 112 113 114 115 116 117
}iso_part_rec_t;


typedef struct iso_val_entry {
	unsigned char	header_id;		/* Header ID must be 0x01 */
	unsigned char	platform;			/* Platform: 0=x86, 1=PowerPC, 2=MAC */
	unsigned char res[2];				/* reserved */
Wolfgang Denk's avatar
Wolfgang Denk committed
118 119
	char					manu_str[0x18]; /* Ident String of manufacturer/developer */
	unsigned char chk_sum[2];	/* Check sum (all words must be zero)  */
wdenk's avatar
wdenk committed
120 121 122 123 124 125 126
	unsigned char key[2];				/* key[0]=55, key[1]=0xAA */
} iso_val_entry_t;

typedef struct iso_header_entry {
	unsigned char	header_id;		/* Header ID must be 0x90 or 0x91 */
	unsigned char	platform;			/* Platform: 0=x86, 1=PowerPC, 2=MAC */
	unsigned char numentry[2];	/* number of entries */
Wolfgang Denk's avatar
Wolfgang Denk committed
127
	char					id_str[0x1C]; /* Ident String of sectionr */
wdenk's avatar
wdenk committed
128 129 130 131 132 133 134
} iso_header_entry_t;


typedef struct iso_init_def_entry {
	unsigned char	boot_ind;			/* Boot indicator 0x88=bootable 0=not bootable */
	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) */
	unsigned char ld_seg[2];		/* Load segment (flat model=addr/10) */
Wolfgang Denk's avatar
Wolfgang Denk committed
135
	unsigned char systype;			/* System Type copy of byte5 of part table */
wdenk's avatar
wdenk committed
136 137 138 139 140 141 142 143 144
	unsigned char res;					/* reserved */
	unsigned char sec_cnt[2];		/* sector count in VIRTUAL Blocks (0x200) */
	unsigned char rel_block_addr[4];	/* relative Block address */
} iso_init_def_entry_t;


void print_partition_cd(int dev);

#endif /* _PART_CD_H */