2 * ISO 9660 filesystem backend for GRUB (GRand Unified Bootloader)
3 * including Rock Ridge Extensions support
5 * Copyright (C) 1998, 1999 Kousuke Takai <tak@kmc.kyoto-u.ac.jp>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * linux/fs/isofs/rock.[ch]
24 * mkisofs-1.11.1/diag/isoinfo.c
25 * mkisofs-1.11.1/iso9660.h
26 * (all are written by Eric Youngdale)
32 #define ISO_SECTOR_BITS (11)
33 #define ISO_SECTOR_SIZE (1<<ISO_SECTOR_BITS)
35 #define ISO_REGULAR 1 /* regular file */
36 #define ISO_DIRECTORY 2 /* directory */
37 #define ISO_OTHER 0 /* other file (with Rock Ridge) */
39 #define RR_FLAG_PX 0x01 /* have POSIX file attributes */
40 #define RR_FLAG_PN 0x02 /* POSIX devices */
41 #define RR_FLAG_SL 0x04 /* Symbolic link */
42 #define RR_FLAG_NM 0x08 /* have alternate file name */
43 #define RR_FLAG_CL 0x10 /* Child link */
44 #define RR_FLAG_PL 0x20 /* Parent link */
45 #define RR_FLAG_RE 0x40 /* Relocation directory */
46 #define RR_FLAG_TF 0x80 /* Timestamps */
48 /* POSIX file attributes for Rock Ridge extensions */
49 #define POSIX_S_IFMT 0xF000
50 #define POSIX_S_IFREG 0x8000
51 #define POSIX_S_IFDIR 0x4000
53 /* volume descriptor types */
54 #define ISO_VD_PRIMARY 1
55 #define ISO_VD_END 255
57 #define ISO_STANDARD_ID "CD001"
62 #ifndef __BIT_TYPES_DEFINED__
63 typedef int int8_t __attribute__((mode(QI
)));
64 typedef unsigned int u_int8_t
__attribute__((mode(QI
)));
65 typedef int int16_t __attribute__((mode(HI
)));
66 typedef unsigned int u_int16_t
__attribute__((mode(HI
)));
67 typedef int int32_t __attribute__((mode(SI
)));
68 typedef unsigned int u_int32_t
__attribute__((mode(SI
)));
73 typedef short int16_t;
75 #endif /* ! GRUB_UTIL */
76 typedef unsigned char u_int8_t
;
77 typedef unsigned short u_int16_t
;
78 typedef unsigned int u_int32_t
;
87 } __attribute__ ((packed
));
88 typedef struct __iso_16bit iso_16bit_t
;
92 } __attribute__ ((packed
));
93 typedef struct __iso_32bit iso_32bit_t
;
95 typedef u_int8_t iso_date_t
[7];
97 struct iso_directory_record
{
99 iso_8bit_t ext_attr_length
;
104 iso_8bit_t file_unit_size
;
105 iso_8bit_t interleave
;
106 iso_16bit_t volume_seq_number
;
109 } __attribute__ ((packed
));
111 struct iso_primary_descriptor
{
115 u_int8_t _unused1
[1];
116 u_int8_t system_id
[32];
117 u_int8_t volume_id
[32];
118 u_int8_t _unused2
[8];
119 iso_32bit_t volume_space_size
;
120 u_int8_t _unused3
[32];
121 iso_16bit_t volume_set_size
;
122 iso_16bit_t volume_seq_number
;
123 iso_16bit_t logical_block_size
;
124 iso_32bit_t path_table_size
;
125 u_int8_t type_l_path_table
[4];
126 u_int8_t opt_type_l_path_table
[4];
127 u_int8_t type_m_path_table
[4];
128 u_int8_t opt_type_m_path_table
[4];
129 struct iso_directory_record root_directory_record
;
130 u_int8_t volume_set_id
[128];
131 u_int8_t publisher_id
[128];
132 u_int8_t preparer_id
[128];
133 u_int8_t application_id
[128];
134 u_int8_t copyright_file_id
[37];
135 u_int8_t abstract_file_id
[37];
136 u_int8_t bibliographic_file_id
[37];
137 u_int8_t creation_date
[17];
138 u_int8_t modification_date
[17];
139 u_int8_t expiration_date
[17];
140 u_int8_t effective_date
[17];
141 iso_8bit_t file_structure_version
;
142 u_int8_t _unused4
[1];
143 u_int8_t application_data
[512];
144 u_int8_t _unused5
[653];
145 } __attribute__ ((packed
));
178 iso_32bit_t dev_high
;
183 struct SL_component
{
194 iso_32bit_t location
;
197 iso_32bit_t location
;
204 } __attribute__ ((packed
));
206 typedef union RR_ptr
{
207 struct rock_ridge
*rr
;
212 #define RRMAGIC(c1, c2) ((c1)|(c2) << 8)
214 #define CHECK2(ptr, c1, c2) \
215 (*(unsigned short *)(ptr) == (((c1) | (c2) << 8) & 0xFFFF))
217 #endif /* !ASM_FILE */
219 #endif /* _ISO9660_H_ */