Browse Source

[int13] Split out ISO9660 and El Torito definitions to separate header files

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
2ec0c1ea48

+ 0
- 116
src/arch/i386/include/int13.h View File

@@ -291,122 +291,6 @@ struct master_boot_record {
291 291
 /** MBR magic signature */
292 292
 #define INT13_MBR_MAGIC 0xaa55
293 293
 
294
-/** ISO9660 block size */
295
-#define ISO9660_BLKSIZE 2048
296
-
297
-/** An ISO9660 Primary Volume Descriptor (fixed portion) */
298
-struct iso9660_primary_descriptor_fixed {
299
-	/** Descriptor type */
300
-	uint8_t type;
301
-	/** Identifier ("CD001") */
302
-	uint8_t id[5];
303
-} __attribute__ (( packed ));
304
-
305
-/** An ISO9660 Primary Volume Descriptor */
306
-struct iso9660_primary_descriptor {
307
-	/** Fixed portion */
308
-	struct iso9660_primary_descriptor_fixed fixed;
309
-} __attribute__ (( packed ));
310
-
311
-/** ISO9660 Primary Volume Descriptor type */
312
-#define ISO9660_TYPE_PRIMARY 0x01
313
-
314
-/** ISO9660 identifier */
315
-#define ISO9660_ID "CD001"
316
-
317
-/** ISO9660 Primary Volume Descriptor block address */
318
-#define ISO9660_PRIMARY_LBA 16
319
-
320
-/** An El Torito Boot Record Volume Descriptor (fixed portion) */
321
-struct eltorito_descriptor_fixed {
322
-	/** Descriptor type */
323
-	uint8_t type;
324
-	/** Identifier ("CD001") */
325
-	uint8_t id[5];
326
-	/** Version, must be 1 */
327
-	uint8_t version;
328
-	/** Boot system indicator; must be "EL TORITO SPECIFICATION" */
329
-	uint8_t system_id[32];
330
-} __attribute__ (( packed ));
331
-
332
-/** An El Torito Boot Record Volume Descriptor */
333
-struct eltorito_descriptor {
334
-	/** Fixed portion */
335
-	struct eltorito_descriptor_fixed fixed;
336
-	/** Unused */
337
-	uint8_t unused[32];
338
-	/** Boot catalog sector */
339
-	uint32_t sector;
340
-} __attribute__ (( packed ));
341
-
342
-/** ISO9660 Boot Volume Descriptor type */
343
-#define ISO9660_TYPE_BOOT 0x00
344
-
345
-/** El Torito Boot Record Volume Descriptor block address */
346
-#define ELTORITO_LBA 17
347
-
348
-/** An El Torito Boot Catalog Validation Entry */
349
-struct eltorito_validation_entry {
350
-	/** Header ID; must be 1 */
351
-	uint8_t header_id;
352
-	/** Platform ID
353
-	 *
354
-	 * 0 = 80x86
355
-	 * 1 = PowerPC
356
-	 * 2 = Mac
357
-	 */
358
-	uint8_t platform_id;
359
-	/** Reserved */
360
-	uint16_t reserved;
361
-	/** ID string */
362
-	uint8_t id_string[24];
363
-	/** Checksum word */
364
-	uint16_t checksum;
365
-	/** Signature; must be 0xaa55 */
366
-	uint16_t signature;
367
-} __attribute__ (( packed ));
368
-
369
-/** El Torito platform IDs */
370
-enum eltorito_platform_id {
371
-	ELTORITO_PLATFORM_X86 = 0x00,
372
-	ELTORITO_PLATFORM_POWERPC = 0x01,
373
-	ELTORITO_PLATFORM_MAC = 0x02,
374
-};
375
-
376
-/** A bootable entry in the El Torito Boot Catalog */
377
-struct eltorito_boot_entry {
378
-	/** Boot indicator
379
-	 *
380
-	 * Must be @c ELTORITO_BOOTABLE for a bootable ISO image
381
-	 */
382
-	uint8_t indicator;
383
-	/** Media type
384
-	 *
385
-	 */
386
-	uint8_t media_type;
387
-	/** Load segment */
388
-	uint16_t load_segment;
389
-	/** System type */
390
-	uint8_t filesystem;
391
-	/** Unused */
392
-	uint8_t reserved_a;
393
-	/** Sector count */
394
-	uint16_t length;
395
-	/** Starting sector */
396
-	uint32_t start;
397
-	/** Unused */
398
-	uint8_t reserved_b[20];
399
-} __attribute__ (( packed ));
400
-
401
-/** Boot indicator for a bootable ISO image */
402
-#define ELTORITO_BOOTABLE 0x88
403
-
404
-/** El Torito media types */
405
-enum eltorito_media_type {
406
-	/** No emulation */
407
-	ELTORITO_NO_EMULATION = 0,
408
-};
409
-
410 294
 /** A floppy disk geometry */
411 295
 struct int13_fdd_geometry {
412 296
 	/** Number of tracks */

+ 2
- 0
src/arch/i386/interface/pcbios/int13.c View File

@@ -38,6 +38,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
38 38
 #include <ipxe/sanboot.h>
39 39
 #include <ipxe/device.h>
40 40
 #include <ipxe/pci.h>
41
+#include <ipxe/iso9660.h>
42
+#include <ipxe/eltorito.h>
41 43
 #include <realmode.h>
42 44
 #include <bios.h>
43 45
 #include <biosint.h>

+ 103
- 0
src/include/ipxe/eltorito.h View File

@@ -0,0 +1,103 @@
1
+#ifndef _IPXE_ELTORITO_H
2
+#define _IPXE_ELTORITO_H
3
+
4
+/**
5
+ * @file
6
+ *
7
+ * El Torito bootable CD-ROM specification
8
+ *
9
+ */
10
+
11
+FILE_LICENCE ( GPL2_OR_LATER );
12
+
13
+#include <stdint.h>
14
+#include <ipxe/iso9660.h>
15
+
16
+/** An El Torito Boot Record Volume Descriptor (fixed portion) */
17
+struct eltorito_descriptor_fixed {
18
+	/** Descriptor type */
19
+	uint8_t type;
20
+	/** Identifier ("CD001") */
21
+	uint8_t id[5];
22
+	/** Version, must be 1 */
23
+	uint8_t version;
24
+	/** Boot system indicator; must be "EL TORITO SPECIFICATION" */
25
+	uint8_t system_id[32];
26
+} __attribute__ (( packed ));
27
+
28
+/** An El Torito Boot Record Volume Descriptor */
29
+struct eltorito_descriptor {
30
+	/** Fixed portion */
31
+	struct eltorito_descriptor_fixed fixed;
32
+	/** Unused */
33
+	uint8_t unused[32];
34
+	/** Boot catalog sector */
35
+	uint32_t sector;
36
+} __attribute__ (( packed ));
37
+
38
+/** El Torito Boot Record Volume Descriptor block address */
39
+#define ELTORITO_LBA 17
40
+
41
+/** An El Torito Boot Catalog Validation Entry */
42
+struct eltorito_validation_entry {
43
+	/** Header ID; must be 1 */
44
+	uint8_t header_id;
45
+	/** Platform ID
46
+	 *
47
+	 * 0 = 80x86
48
+	 * 1 = PowerPC
49
+	 * 2 = Mac
50
+	 */
51
+	uint8_t platform_id;
52
+	/** Reserved */
53
+	uint16_t reserved;
54
+	/** ID string */
55
+	uint8_t id_string[24];
56
+	/** Checksum word */
57
+	uint16_t checksum;
58
+	/** Signature; must be 0xaa55 */
59
+	uint16_t signature;
60
+} __attribute__ (( packed ));
61
+
62
+/** El Torito platform IDs */
63
+enum eltorito_platform_id {
64
+	ELTORITO_PLATFORM_X86 = 0x00,
65
+	ELTORITO_PLATFORM_POWERPC = 0x01,
66
+	ELTORITO_PLATFORM_MAC = 0x02,
67
+};
68
+
69
+/** A bootable entry in the El Torito Boot Catalog */
70
+struct eltorito_boot_entry {
71
+	/** Boot indicator
72
+	 *
73
+	 * Must be @c ELTORITO_BOOTABLE for a bootable ISO image
74
+	 */
75
+	uint8_t indicator;
76
+	/** Media type
77
+	 *
78
+	 */
79
+	uint8_t media_type;
80
+	/** Load segment */
81
+	uint16_t load_segment;
82
+	/** System type */
83
+	uint8_t filesystem;
84
+	/** Unused */
85
+	uint8_t reserved_a;
86
+	/** Sector count */
87
+	uint16_t length;
88
+	/** Starting sector */
89
+	uint32_t start;
90
+	/** Unused */
91
+	uint8_t reserved_b[20];
92
+} __attribute__ (( packed ));
93
+
94
+/** Boot indicator for a bootable ISO image */
95
+#define ELTORITO_BOOTABLE 0x88
96
+
97
+/** El Torito media types */
98
+enum eltorito_media_type {
99
+	/** No emulation */
100
+	ELTORITO_NO_EMULATION = 0,
101
+};
102
+
103
+#endif /* _IPXE_ELTORITO_H */

+ 44
- 0
src/include/ipxe/iso9660.h View File

@@ -0,0 +1,44 @@
1
+#ifndef _IPXE_ISO9660_H
2
+#define _IPXE_ISO9660_H
3
+
4
+/**
5
+ * @file
6
+ *
7
+ * ISO9660 CD-ROM specification
8
+ *
9
+ */
10
+
11
+FILE_LICENCE ( GPL2_OR_LATER );
12
+
13
+#include <stdint.h>
14
+
15
+/** ISO9660 block size */
16
+#define ISO9660_BLKSIZE 2048
17
+
18
+/** An ISO9660 Primary Volume Descriptor (fixed portion) */
19
+struct iso9660_primary_descriptor_fixed {
20
+	/** Descriptor type */
21
+	uint8_t type;
22
+	/** Identifier ("CD001") */
23
+	uint8_t id[5];
24
+} __attribute__ (( packed ));
25
+
26
+/** An ISO9660 Primary Volume Descriptor */
27
+struct iso9660_primary_descriptor {
28
+	/** Fixed portion */
29
+	struct iso9660_primary_descriptor_fixed fixed;
30
+} __attribute__ (( packed ));
31
+
32
+/** ISO9660 Primary Volume Descriptor type */
33
+#define ISO9660_TYPE_PRIMARY 0x01
34
+
35
+/** ISO9660 Primary Volume Descriptor block address */
36
+#define ISO9660_PRIMARY_LBA 16
37
+
38
+/** ISO9660 Boot Volume Descriptor type */
39
+#define ISO9660_TYPE_BOOT 0x00
40
+
41
+/** ISO9660 identifier */
42
+#define ISO9660_ID "CD001"
43
+
44
+#endif /* _IPXE_ISO9660_H */

Loading…
Cancel
Save