iPXE
eltorito.h
Go to the documentation of this file.
00001 #ifndef _IPXE_ELTORITO_H
00002 #define _IPXE_ELTORITO_H
00003 
00004 /**
00005  * @file
00006  *
00007  * El Torito bootable CD-ROM specification
00008  *
00009  */
00010 
00011 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00012 
00013 #include <stdint.h>
00014 #include <ipxe/iso9660.h>
00015 
00016 /** An El Torito Boot Record Volume Descriptor (fixed portion) */
00017 struct eltorito_descriptor_fixed {
00018         /** Descriptor type */
00019         uint8_t type;
00020         /** Identifier ("CD001") */
00021         uint8_t id[5];
00022         /** Version, must be 1 */
00023         uint8_t version;
00024         /** Boot system indicator; must be "EL TORITO SPECIFICATION" */
00025         uint8_t system_id[32];
00026 } __attribute__ (( packed ));
00027 
00028 /** An El Torito Boot Record Volume Descriptor */
00029 struct eltorito_descriptor {
00030         /** Fixed portion */
00031         struct eltorito_descriptor_fixed fixed;
00032         /** Unused */
00033         uint8_t unused[32];
00034         /** Boot catalog sector */
00035         uint32_t sector;
00036 } __attribute__ (( packed ));
00037 
00038 /** El Torito Boot Record Volume Descriptor block address */
00039 #define ELTORITO_LBA 17
00040 
00041 /** An El Torito Boot Catalog Validation Entry */
00042 struct eltorito_validation_entry {
00043         /** Header ID; must be 1 */
00044         uint8_t header_id;
00045         /** Platform ID
00046          *
00047          * 0 = 80x86
00048          * 1 = PowerPC
00049          * 2 = Mac
00050          */
00051         uint8_t platform_id;
00052         /** Reserved */
00053         uint16_t reserved;
00054         /** ID string */
00055         uint8_t id_string[24];
00056         /** Checksum word */
00057         uint16_t checksum;
00058         /** Signature; must be 0xaa55 */
00059         uint16_t signature;
00060 } __attribute__ (( packed ));
00061 
00062 /** El Torito platform IDs */
00063 enum eltorito_platform_id {
00064         ELTORITO_PLATFORM_X86 = 0x00,
00065         ELTORITO_PLATFORM_POWERPC = 0x01,
00066         ELTORITO_PLATFORM_MAC = 0x02,
00067 };
00068 
00069 /** A bootable entry in the El Torito Boot Catalog */
00070 struct eltorito_boot_entry {
00071         /** Boot indicator
00072          *
00073          * Must be @c ELTORITO_BOOTABLE for a bootable ISO image
00074          */
00075         uint8_t indicator;
00076         /** Media type
00077          *
00078          */
00079         uint8_t media_type;
00080         /** Load segment */
00081         uint16_t load_segment;
00082         /** System type */
00083         uint8_t filesystem;
00084         /** Unused */
00085         uint8_t reserved_a;
00086         /** Sector count */
00087         uint16_t length;
00088         /** Starting sector */
00089         uint32_t start;
00090         /** Unused */
00091         uint8_t reserved_b[20];
00092 } __attribute__ (( packed ));
00093 
00094 /** Boot indicator for a bootable ISO image */
00095 #define ELTORITO_BOOTABLE 0x88
00096 
00097 /** El Torito media types */
00098 enum eltorito_media_type {
00099         /** No emulation */
00100         ELTORITO_NO_EMULATION = 0,
00101 };
00102 
00103 #endif /* _IPXE_ELTORITO_H */