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., 51 Franklin Street - Fifth Floor, Boston,
24 * linux/fs/isofs/rock.[ch]
25 * mkisofs-1.11.1/diag/isoinfo.c
26 * mkisofs-1.11.1/iso9660.h
27 * (all are written by Eric Youngdale)
31 * Modified by SONE Takeshi to work with FILO
37 #define ISO_SECTOR_BITS (11)
38 #define ISO_SECTOR_SIZE (1<<ISO_SECTOR_BITS)
40 #define ISO_REGULAR 1 /* regular file */
41 #define ISO_DIRECTORY 2 /* directory */
42 #define ISO_OTHER 0 /* other file (with Rock Ridge) */
44 #define RR_FLAG_PX 0x01 /* have POSIX file attributes */
45 #define RR_FLAG_NM 0x08 /* have alternate file name */
47 /* POSIX file attributes for Rock Ridge extensions */
48 #define POSIX_S_IFMT 0xF000
49 #define POSIX_S_IFREG 0x8000
50 #define POSIX_S_IFDIR 0x4000
52 /* volume descriptor types */
53 #define ISO_VD_PRIMARY 1
54 #define ISO_VD_END 255
56 #define ISO_STANDARD_ID "CD001"
64 typedef struct __iso_16bit {
68 typedef struct __iso_32bit {
72 typedef uint8_t iso_date_t[7];
74 struct iso_directory_record {
76 iso_8bit_t ext_attr_length;
81 iso_8bit_t file_unit_size;
82 iso_8bit_t interleave;
83 iso_16bit_t volume_seq_number;
86 } __attribute__ ((packed));
88 struct iso_primary_descriptor {
93 uint8_t system_id[32];
94 uint8_t volume_id[32];
96 iso_32bit_t volume_space_size;
98 iso_16bit_t volume_set_size;
99 iso_16bit_t volume_seq_number;
100 iso_16bit_t logical_block_size;
101 iso_32bit_t path_table_size;
102 uint8_t type_l_path_table[4];
103 uint8_t opt_type_l_path_table[4];
104 uint8_t type_m_path_table[4];
105 uint8_t opt_type_m_path_table[4];
106 struct iso_directory_record root_directory_record;
107 uint8_t volume_set_id[128];
108 uint8_t publisher_id[128];
109 uint8_t preparer_id[128];
110 uint8_t application_id[128];
111 uint8_t copyright_file_id[37];
112 uint8_t abstract_file_id[37];
113 uint8_t bibliographic_file_id[37];
114 uint8_t creation_date[17];
115 uint8_t modification_date[17];
116 uint8_t expiration_date[17];
117 uint8_t effective_date[17];
118 iso_8bit_t file_structure_version;
120 uint8_t application_data[512];
121 uint8_t _unused5[653];
122 } __attribute__ ((packed));
148 } __attribute__ ((packed));
150 typedef union RR_ptr {
151 struct rock_ridge *rr;
156 #define CHECK2(ptr, c1, c2) \
157 (*(unsigned char *)(ptr) == (c1) && \
158 *((unsigned char *)(ptr) + 1) == (c2))
159 #define CHECK4(ptr, c1, c2, c3, c4) \
160 (*(unsigned char *)(ptr) == (c1) && \
161 *((unsigned char *)(ptr) + 1) == (c2) && \
162 *((unsigned char *)(ptr) + 2) == (c3) && \
163 *((unsigned char *)(ptr) + 3) == (c4))
165 #endif /* !ASM_FILE */
167 #endif /* _ISO9660_H_ */