part_iso.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * (C) Copyright 2001
  3. * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef _PART_CD_H
  8. #define _PART_CD_H
  9. #define BRVD 0x11
  10. #define PVD_OFFSET 0x10
  11. typedef struct iso_boot_rec {
  12. unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
  13. unsigned char stand_ident[5]; /* "CD001" */
  14. unsigned char vers; /* Version */
  15. char ident_str[0x20]; /* Ident String "EL TORITO SPECIFICATION" */
  16. unsigned char unused[0x20]; /* unused */
  17. unsigned char pointer[4]; /* absolute pointer to Boot Catalog */
  18. } iso_boot_rec_t;
  19. typedef struct iso_pri_rec {
  20. unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
  21. unsigned char stand_ident[5]; /* "CD001" */
  22. unsigned char vers; /* Version */
  23. unsigned char unused;
  24. char sysid[32]; /* system Identifier */
  25. char volid[32]; /* volume Identifier */
  26. unsigned char zeros1[8]; /* unused */
  27. unsigned long volsiz_LE; /* volume size Little Endian */
  28. unsigned long volsiz_BE; /* volume size Big Endian */
  29. unsigned char zeros2[32]; /* unused */
  30. unsigned short setsize_LE; /* volume set size LE */
  31. unsigned short setsize_BE; /* volume set size BE */
  32. unsigned short seqnum_LE; /* volume sequence number LE */
  33. unsigned short seqnum_BE; /* volume sequence number BE */
  34. unsigned short secsize_LE; /* sector size LE */
  35. unsigned short secsize_BE; /* sector size BE */
  36. unsigned long pathtablen_LE;/* Path Table size LE */
  37. unsigned long pathtablen_BE;/* Path Table size BE */
  38. unsigned long firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
  39. unsigned long firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
  40. unsigned long firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
  41. unsigned long firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
  42. unsigned char rootdir[34]; /* directory record for root dir */
  43. char volsetid[128];/* Volume set identifier */
  44. char pubid[128]; /* Publisher identifier */
  45. char dataprepid[128]; /* data preparer identifier */
  46. char appid[128]; /* application identifier */
  47. char copyr[37]; /* copyright string */
  48. char abstractfileid[37]; /* abstract file identifier */
  49. char bibliofileid[37]; /* bibliographic file identifier */
  50. unsigned char creationdate[17]; /* creation date */
  51. unsigned char modify[17]; /* modification date */
  52. unsigned char expire[17]; /* expiring date */
  53. unsigned char effective[17];/* effective date */
  54. unsigned char filestruc_ver; /* file structur version */
  55. } iso_pri_rec_t;
  56. typedef struct iso_sup_rec {
  57. unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
  58. unsigned char stand_ident[5]; /* "CD001" */
  59. unsigned char vers; /* Version */
  60. unsigned char volumeflags; /* if bit 0 = 0 => all escape sequences are according ISO 2375 */
  61. char sysid[32]; /* system Identifier */
  62. char volid[32]; /* volume Identifier */
  63. unsigned char zeros1[8]; /* unused */
  64. unsigned long volsiz_LE; /* volume size Little Endian */
  65. unsigned long volsiz_BE; /* volume size Big Endian */
  66. unsigned char escapeseq[32];/* Escape sequences */
  67. unsigned short setsize_LE; /* volume set size LE */
  68. unsigned short setsize_BE; /* volume set size BE */
  69. unsigned short seqnum_LE; /* volume sequence number LE */
  70. unsigned short seqnum_BE; /* volume sequence number BE */
  71. unsigned short secsize_LE; /* sector size LE */
  72. unsigned short secsize_BE; /* sector size BE */
  73. unsigned long pathtablen_LE;/* Path Table size LE */
  74. unsigned long pathtablen_BE;/* Path Table size BE */
  75. unsigned long firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
  76. unsigned long firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
  77. unsigned long firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
  78. unsigned long firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
  79. unsigned char rootdir[34]; /* directory record for root dir */
  80. char volsetid[128];/* Volume set identifier */
  81. char pubid[128]; /* Publisher identifier */
  82. char dataprepid[128]; /* data preparer identifier */
  83. char appid[128]; /* application identifier */
  84. char copyr[37]; /* copyright string */
  85. char abstractfileid[37]; /* abstract file identifier */
  86. char bibliofileid[37]; /* bibliographic file identifier */
  87. unsigned char creationdate[17]; /* creation date */
  88. unsigned char modify[17]; /* modification date */
  89. unsigned char expire[17]; /* expiring date */
  90. unsigned char effective[17];/* effective date */
  91. unsigned char filestruc_ver; /* file structur version */
  92. }iso_sup_rec_t;
  93. typedef struct iso_part_rec {
  94. unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
  95. unsigned char stand_ident[5]; /* "CD001" */
  96. unsigned char vers; /* Version */
  97. unsigned char unused;
  98. char sysid[32]; /* system Identifier */
  99. char volid[32]; /* volume partition Identifier */
  100. unsigned long partloc_LE; /* volume partition location LE */
  101. unsigned long partloc_BE; /* volume partition location BE */
  102. unsigned long partsiz_LE; /* volume partition size LE */
  103. unsigned long partsiz_BE; /* volume partition size BE */
  104. }iso_part_rec_t;
  105. typedef struct iso_val_entry {
  106. unsigned char header_id; /* Header ID must be 0x01 */
  107. unsigned char platform; /* Platform: 0=x86, 1=PowerPC, 2=MAC */
  108. unsigned char res[2]; /* reserved */
  109. char manu_str[0x18]; /* Ident String of manufacturer/developer */
  110. unsigned char chk_sum[2]; /* Check sum (all words must be zero) */
  111. unsigned char key[2]; /* key[0]=55, key[1]=0xAA */
  112. } iso_val_entry_t;
  113. typedef struct iso_header_entry {
  114. unsigned char header_id; /* Header ID must be 0x90 or 0x91 */
  115. unsigned char platform; /* Platform: 0=x86, 1=PowerPC, 2=MAC */
  116. unsigned char numentry[2]; /* number of entries */
  117. char id_str[0x1C]; /* Ident String of sectionr */
  118. } iso_header_entry_t;
  119. typedef struct iso_init_def_entry {
  120. unsigned char boot_ind; /* Boot indicator 0x88=bootable 0=not bootable */
  121. unsigned char boot_media; /* boot Media Type: 0=no Emulation, 1=1.2MB floppy, 2=1.44MB floppy, 3=2.88MB floppy 4=hd (0x80) */
  122. unsigned char ld_seg[2]; /* Load segment (flat model=addr/10) */
  123. unsigned char systype; /* System Type copy of byte5 of part table */
  124. unsigned char res; /* reserved */
  125. unsigned char sec_cnt[2]; /* sector count in VIRTUAL Blocks (0x200) */
  126. unsigned char rel_block_addr[4]; /* relative Block address */
  127. } iso_init_def_entry_t;
  128. void print_partition_cd(int dev);
  129. #endif /* _PART_CD_H */