part_iso.h 6.8 KB

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