part_iso.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*
  2. * (C) Copyright 2001
  3. * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef _PART_CD_H
  24. #define _PART_CD_H
  25. #define BRVD 0x11
  26. #define PVD_OFFSET 0x10
  27. typedef struct iso_boot_rec {
  28. unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
  29. unsigned char stand_ident[5]; /* "CD001" */
  30. unsigned char vers; /* Version */
  31. char ident_str[0x20]; /* Ident String "EL TORITO SPECIFICATION" */
  32. unsigned char unused[0x20]; /* unused */
  33. unsigned char pointer[4]; /* absolute pointer to Boot Catalog */
  34. } iso_boot_rec_t;
  35. typedef struct iso_pri_rec {
  36. unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
  37. unsigned char stand_ident[5]; /* "CD001" */
  38. unsigned char vers; /* Version */
  39. unsigned char unused;
  40. char sysid[32]; /* system Identifier */
  41. char volid[32]; /* volume Identifier */
  42. unsigned char zeros1[8]; /* unused */
  43. unsigned long volsiz_LE; /* volume size Little Endian */
  44. unsigned long volsiz_BE; /* volume size Big Endian */
  45. unsigned char zeros2[32]; /* unused */
  46. unsigned short setsize_LE; /* volume set size LE */
  47. unsigned short setsize_BE; /* volume set size BE */
  48. unsigned short seqnum_LE; /* volume sequence number LE */
  49. unsigned short seqnum_BE; /* volume sequence number BE */
  50. unsigned short secsize_LE; /* sector size LE */
  51. unsigned short secsize_BE; /* sector size BE */
  52. unsigned long pathtablen_LE;/* Path Table size LE */
  53. unsigned long pathtablen_BE;/* Path Table size BE */
  54. unsigned long firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
  55. unsigned long firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
  56. unsigned long firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
  57. unsigned long firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
  58. unsigned char rootdir[34]; /* directory record for root dir */
  59. char volsetid[128];/* Volume set identifier */
  60. char pubid[128]; /* Publisher identifier */
  61. char dataprepid[128]; /* data preparer identifier */
  62. char appid[128]; /* application identifier */
  63. char copyr[37]; /* copyright string */
  64. char abstractfileid[37]; /* abstract file identifier */
  65. char bibliofileid[37]; /* bibliographic file identifier */
  66. unsigned char creationdate[17]; /* creation date */
  67. unsigned char modify[17]; /* modification date */
  68. unsigned char expire[17]; /* expiring date */
  69. unsigned char effective[17];/* effective date */
  70. unsigned char filestruc_ver; /* file structur version */
  71. } iso_pri_rec_t;
  72. typedef struct iso_sup_rec {
  73. unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
  74. unsigned char stand_ident[5]; /* "CD001" */
  75. unsigned char vers; /* Version */
  76. unsigned char volumeflags; /* if bit 0 = 0 => all escape sequences are according ISO 2375 */
  77. char sysid[32]; /* system Identifier */
  78. char volid[32]; /* volume Identifier */
  79. unsigned char zeros1[8]; /* unused */
  80. unsigned long volsiz_LE; /* volume size Little Endian */
  81. unsigned long volsiz_BE; /* volume size Big Endian */
  82. unsigned char escapeseq[32];/* Escape sequences */
  83. unsigned short setsize_LE; /* volume set size LE */
  84. unsigned short setsize_BE; /* volume set size BE */
  85. unsigned short seqnum_LE; /* volume sequence number LE */
  86. unsigned short seqnum_BE; /* volume sequence number BE */
  87. unsigned short secsize_LE; /* sector size LE */
  88. unsigned short secsize_BE; /* sector size BE */
  89. unsigned long pathtablen_LE;/* Path Table size LE */
  90. unsigned long pathtablen_BE;/* Path Table size BE */
  91. unsigned long firstsek_LEpathtab1_LE; /* location of first occurrence of little endian type path table */
  92. unsigned long firstsek_LEpathtab2_LE; /* location of optional occurrence of little endian type path table */
  93. unsigned long firstsek_BEpathtab1_BE; /* location of first occurrence of big endian type path table */
  94. unsigned long firstsek_BEpathtab2_BE; /* location of optional occurrence of big endian type path table */
  95. unsigned char rootdir[34]; /* directory record for root dir */
  96. char volsetid[128];/* Volume set identifier */
  97. char pubid[128]; /* Publisher identifier */
  98. char dataprepid[128]; /* data preparer identifier */
  99. char appid[128]; /* application identifier */
  100. char copyr[37]; /* copyright string */
  101. char abstractfileid[37]; /* abstract file identifier */
  102. char bibliofileid[37]; /* bibliographic file identifier */
  103. unsigned char creationdate[17]; /* creation date */
  104. unsigned char modify[17]; /* modification date */
  105. unsigned char expire[17]; /* expiring date */
  106. unsigned char effective[17];/* effective date */
  107. unsigned char filestruc_ver; /* file structur version */
  108. }iso_sup_rec_t;
  109. typedef struct iso_part_rec {
  110. unsigned char desctype; /* type of Volume descriptor: 0 = boot record, 1 = primary, 2 = Supplement, 3 = volume part 0xff trminator */
  111. unsigned char stand_ident[5]; /* "CD001" */
  112. unsigned char vers; /* Version */
  113. unsigned char unused;
  114. char sysid[32]; /* system Identifier */
  115. char volid[32]; /* volume partition Identifier */
  116. unsigned long partloc_LE; /* volume partition location LE */
  117. unsigned long partloc_BE; /* volume partition location BE */
  118. unsigned long partsiz_LE; /* volume partition size LE */
  119. unsigned long partsiz_BE; /* volume partition size BE */
  120. }iso_part_rec_t;
  121. typedef struct iso_val_entry {
  122. unsigned char header_id; /* Header ID must be 0x01 */
  123. unsigned char platform; /* Platform: 0=x86, 1=PowerPC, 2=MAC */
  124. unsigned char res[2]; /* reserved */
  125. char manu_str[0x18]; /* Ident String of manufacturer/developer */
  126. unsigned char chk_sum[2]; /* Check sum (all words must be zero) */
  127. unsigned char key[2]; /* key[0]=55, key[1]=0xAA */
  128. } iso_val_entry_t;
  129. typedef struct iso_header_entry {
  130. unsigned char header_id; /* Header ID must be 0x90 or 0x91 */
  131. unsigned char platform; /* Platform: 0=x86, 1=PowerPC, 2=MAC */
  132. unsigned char numentry[2]; /* number of entries */
  133. char id_str[0x1C]; /* Ident String of sectionr */
  134. } iso_header_entry_t;
  135. typedef struct iso_init_def_entry {
  136. unsigned char boot_ind; /* Boot indicator 0x88=bootable 0=not bootable */
  137. 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) */
  138. unsigned char ld_seg[2]; /* Load segment (flat model=addr/10) */
  139. unsigned char systype; /* System Type copy of byte5 of part table */
  140. unsigned char res; /* reserved */
  141. unsigned char sec_cnt[2]; /* sector count in VIRTUAL Blocks (0x200) */
  142. unsigned char rel_block_addr[4]; /* relative Block address */
  143. } iso_init_def_entry_t;
  144. void print_partition_cd(int dev);
  145. #endif /* _PART_CD_H */