You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

eltorito.h 2.2KB

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