aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2013-03-18 15:05:43 +0000
committerMichael Brown <mcb30@ipxe.org>2013-03-19 23:21:15 +0000
commit2ec0c1ea48fa0244599c6b87da7838730dde585b (patch)
tree690011e51d9ef4d61eed1f7a5e59a7bbf0ec496b /src
parent6b9b44319fa1c50d9c91c80cd266b15cbd173ada (diff)
downloadipxe-2ec0c1ea48fa0244599c6b87da7838730dde585b.tar.gz
[int13] Split out ISO9660 and El Torito definitions to separate header files
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/include/int13.h116
-rw-r--r--src/arch/i386/interface/pcbios/int13.c2
-rw-r--r--src/include/ipxe/eltorito.h103
-rw-r--r--src/include/ipxe/iso9660.h44
4 files changed, 149 insertions, 116 deletions
diff --git a/src/arch/i386/include/int13.h b/src/arch/i386/include/int13.h
index 5d36b6378..e337ca1d1 100644
--- a/src/arch/i386/include/int13.h
+++ b/src/arch/i386/include/int13.h
@@ -291,122 +291,6 @@ struct master_boot_record {
/** MBR magic signature */
#define INT13_MBR_MAGIC 0xaa55
-/** ISO9660 block size */
-#define ISO9660_BLKSIZE 2048
-
-/** An ISO9660 Primary Volume Descriptor (fixed portion) */
-struct iso9660_primary_descriptor_fixed {
- /** Descriptor type */
- uint8_t type;
- /** Identifier ("CD001") */
- uint8_t id[5];
-} __attribute__ (( packed ));
-
-/** An ISO9660 Primary Volume Descriptor */
-struct iso9660_primary_descriptor {
- /** Fixed portion */
- struct iso9660_primary_descriptor_fixed fixed;
-} __attribute__ (( packed ));
-
-/** ISO9660 Primary Volume Descriptor type */
-#define ISO9660_TYPE_PRIMARY 0x01
-
-/** ISO9660 identifier */
-#define ISO9660_ID "CD001"
-
-/** ISO9660 Primary Volume Descriptor block address */
-#define ISO9660_PRIMARY_LBA 16
-
-/** An El Torito Boot Record Volume Descriptor (fixed portion) */
-struct eltorito_descriptor_fixed {
- /** Descriptor type */
- uint8_t type;
- /** Identifier ("CD001") */
- uint8_t id[5];
- /** Version, must be 1 */
- uint8_t version;
- /** Boot system indicator; must be "EL TORITO SPECIFICATION" */
- uint8_t system_id[32];
-} __attribute__ (( packed ));
-
-/** An El Torito Boot Record Volume Descriptor */
-struct eltorito_descriptor {
- /** Fixed portion */
- struct eltorito_descriptor_fixed fixed;
- /** Unused */
- uint8_t unused[32];
- /** Boot catalog sector */
- uint32_t sector;
-} __attribute__ (( packed ));
-
-/** ISO9660 Boot Volume Descriptor type */
-#define ISO9660_TYPE_BOOT 0x00
-
-/** El Torito Boot Record Volume Descriptor block address */
-#define ELTORITO_LBA 17
-
-/** An El Torito Boot Catalog Validation Entry */
-struct eltorito_validation_entry {
- /** Header ID; must be 1 */
- uint8_t header_id;
- /** Platform ID
- *
- * 0 = 80x86
- * 1 = PowerPC
- * 2 = Mac
- */
- uint8_t platform_id;
- /** Reserved */
- uint16_t reserved;
- /** ID string */
- uint8_t id_string[24];
- /** Checksum word */
- uint16_t checksum;
- /** Signature; must be 0xaa55 */
- uint16_t signature;
-} __attribute__ (( packed ));
-
-/** El Torito platform IDs */
-enum eltorito_platform_id {
- ELTORITO_PLATFORM_X86 = 0x00,
- ELTORITO_PLATFORM_POWERPC = 0x01,
- ELTORITO_PLATFORM_MAC = 0x02,
-};
-
-/** A bootable entry in the El Torito Boot Catalog */
-struct eltorito_boot_entry {
- /** Boot indicator
- *
- * Must be @c ELTORITO_BOOTABLE for a bootable ISO image
- */
- uint8_t indicator;
- /** Media type
- *
- */
- uint8_t media_type;
- /** Load segment */
- uint16_t load_segment;
- /** System type */
- uint8_t filesystem;
- /** Unused */
- uint8_t reserved_a;
- /** Sector count */
- uint16_t length;
- /** Starting sector */
- uint32_t start;
- /** Unused */
- uint8_t reserved_b[20];
-} __attribute__ (( packed ));
-
-/** Boot indicator for a bootable ISO image */
-#define ELTORITO_BOOTABLE 0x88
-
-/** El Torito media types */
-enum eltorito_media_type {
- /** No emulation */
- ELTORITO_NO_EMULATION = 0,
-};
-
/** A floppy disk geometry */
struct int13_fdd_geometry {
/** Number of tracks */
diff --git a/src/arch/i386/interface/pcbios/int13.c b/src/arch/i386/interface/pcbios/int13.c
index 263f861e4..1c7a8128f 100644
--- a/src/arch/i386/interface/pcbios/int13.c
+++ b/src/arch/i386/interface/pcbios/int13.c
@@ -38,6 +38,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/sanboot.h>
#include <ipxe/device.h>
#include <ipxe/pci.h>
+#include <ipxe/iso9660.h>
+#include <ipxe/eltorito.h>
#include <realmode.h>
#include <bios.h>
#include <biosint.h>
diff --git a/src/include/ipxe/eltorito.h b/src/include/ipxe/eltorito.h
new file mode 100644
index 000000000..3302b38b6
--- /dev/null
+++ b/src/include/ipxe/eltorito.h
@@ -0,0 +1,103 @@
+#ifndef _IPXE_ELTORITO_H
+#define _IPXE_ELTORITO_H
+
+/**
+ * @file
+ *
+ * El Torito bootable CD-ROM specification
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include <stdint.h>
+#include <ipxe/iso9660.h>
+
+/** An El Torito Boot Record Volume Descriptor (fixed portion) */
+struct eltorito_descriptor_fixed {
+ /** Descriptor type */
+ uint8_t type;
+ /** Identifier ("CD001") */
+ uint8_t id[5];
+ /** Version, must be 1 */
+ uint8_t version;
+ /** Boot system indicator; must be "EL TORITO SPECIFICATION" */
+ uint8_t system_id[32];
+} __attribute__ (( packed ));
+
+/** An El Torito Boot Record Volume Descriptor */
+struct eltorito_descriptor {
+ /** Fixed portion */
+ struct eltorito_descriptor_fixed fixed;
+ /** Unused */
+ uint8_t unused[32];
+ /** Boot catalog sector */
+ uint32_t sector;
+} __attribute__ (( packed ));
+
+/** El Torito Boot Record Volume Descriptor block address */
+#define ELTORITO_LBA 17
+
+/** An El Torito Boot Catalog Validation Entry */
+struct eltorito_validation_entry {
+ /** Header ID; must be 1 */
+ uint8_t header_id;
+ /** Platform ID
+ *
+ * 0 = 80x86
+ * 1 = PowerPC
+ * 2 = Mac
+ */
+ uint8_t platform_id;
+ /** Reserved */
+ uint16_t reserved;
+ /** ID string */
+ uint8_t id_string[24];
+ /** Checksum word */
+ uint16_t checksum;
+ /** Signature; must be 0xaa55 */
+ uint16_t signature;
+} __attribute__ (( packed ));
+
+/** El Torito platform IDs */
+enum eltorito_platform_id {
+ ELTORITO_PLATFORM_X86 = 0x00,
+ ELTORITO_PLATFORM_POWERPC = 0x01,
+ ELTORITO_PLATFORM_MAC = 0x02,
+};
+
+/** A bootable entry in the El Torito Boot Catalog */
+struct eltorito_boot_entry {
+ /** Boot indicator
+ *
+ * Must be @c ELTORITO_BOOTABLE for a bootable ISO image
+ */
+ uint8_t indicator;
+ /** Media type
+ *
+ */
+ uint8_t media_type;
+ /** Load segment */
+ uint16_t load_segment;
+ /** System type */
+ uint8_t filesystem;
+ /** Unused */
+ uint8_t reserved_a;
+ /** Sector count */
+ uint16_t length;
+ /** Starting sector */
+ uint32_t start;
+ /** Unused */
+ uint8_t reserved_b[20];
+} __attribute__ (( packed ));
+
+/** Boot indicator for a bootable ISO image */
+#define ELTORITO_BOOTABLE 0x88
+
+/** El Torito media types */
+enum eltorito_media_type {
+ /** No emulation */
+ ELTORITO_NO_EMULATION = 0,
+};
+
+#endif /* _IPXE_ELTORITO_H */
diff --git a/src/include/ipxe/iso9660.h b/src/include/ipxe/iso9660.h
new file mode 100644
index 000000000..02c2ae377
--- /dev/null
+++ b/src/include/ipxe/iso9660.h
@@ -0,0 +1,44 @@
+#ifndef _IPXE_ISO9660_H
+#define _IPXE_ISO9660_H
+
+/**
+ * @file
+ *
+ * ISO9660 CD-ROM specification
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include <stdint.h>
+
+/** ISO9660 block size */
+#define ISO9660_BLKSIZE 2048
+
+/** An ISO9660 Primary Volume Descriptor (fixed portion) */
+struct iso9660_primary_descriptor_fixed {
+ /** Descriptor type */
+ uint8_t type;
+ /** Identifier ("CD001") */
+ uint8_t id[5];
+} __attribute__ (( packed ));
+
+/** An ISO9660 Primary Volume Descriptor */
+struct iso9660_primary_descriptor {
+ /** Fixed portion */
+ struct iso9660_primary_descriptor_fixed fixed;
+} __attribute__ (( packed ));
+
+/** ISO9660 Primary Volume Descriptor type */
+#define ISO9660_TYPE_PRIMARY 0x01
+
+/** ISO9660 Primary Volume Descriptor block address */
+#define ISO9660_PRIMARY_LBA 16
+
+/** ISO9660 Boot Volume Descriptor type */
+#define ISO9660_TYPE_BOOT 0x00
+
+/** ISO9660 identifier */
+#define ISO9660_ID "CD001"
+
+#endif /* _IPXE_ISO9660_H */