bsdlabel.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 1999,2000,2001,2002,2004,2007 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_BSDLABEL_PARTITION_HEADER
  19. #define GRUB_BSDLABEL_PARTITION_HEADER 1
  20. /* Constants for BSD disk label. */
  21. #define GRUB_PC_PARTITION_BSD_LABEL_SECTOR 1
  22. #define GRUB_PC_PARTITION_BSD_LABEL_MAGIC 0x82564557
  23. /* BSD partition types. */
  24. enum
  25. {
  26. GRUB_PC_PARTITION_BSD_TYPE_UNUSED = 0,
  27. GRUB_PC_PARTITION_BSD_TYPE_SWAP = 1,
  28. GRUB_PC_PARTITION_BSD_TYPE_V6 = 2,
  29. GRUB_PC_PARTITION_BSD_TYPE_V7 = 3,
  30. GRUB_PC_PARTITION_BSD_TYPE_SYSV = 4,
  31. GRUB_PC_PARTITION_BSD_TYPE_V71K = 5,
  32. GRUB_PC_PARTITION_BSD_TYPE_V8 = 6,
  33. GRUB_PC_PARTITION_BSD_TYPE_BSDFFS = 7,
  34. GRUB_PC_PARTITION_BSD_TYPE_MSDOS = 8,
  35. GRUB_PC_PARTITION_BSD_TYPE_BSDLFS = 9,
  36. GRUB_PC_PARTITION_BSD_TYPE_OTHER = 10,
  37. GRUB_PC_PARTITION_BSD_TYPE_HPFS = 11,
  38. GRUB_PC_PARTITION_BSD_TYPE_ISO9660 = 12,
  39. GRUB_PC_PARTITION_BSD_TYPE_BOOT = 13
  40. };
  41. /* FreeBSD-specific types. */
  42. enum
  43. {
  44. GRUB_PC_PARTITION_FREEBSD_TYPE_VINUM = 14,
  45. GRUB_PC_PARTITION_FREEBSD_TYPE_RAID = 15,
  46. GRUB_PC_PARTITION_FREEBSD_TYPE_JFS2 = 21
  47. };
  48. /* NetBSD-specific types. */
  49. enum
  50. {
  51. GRUB_PC_PARTITION_NETBSD_TYPE_ADOS = 14,
  52. GRUB_PC_PARTITION_NETBSD_TYPE_HFS = 15,
  53. GRUB_PC_PARTITION_NETBSD_TYPE_FILECORE = 16,
  54. GRUB_PC_PARTITION_NETBSD_TYPE_EXT2FS = 17,
  55. GRUB_PC_PARTITION_NETBSD_TYPE_NTFS = 18,
  56. GRUB_PC_PARTITION_NETBSD_TYPE_RAID = 19,
  57. GRUB_PC_PARTITION_NETBSD_TYPE_CCD = 20,
  58. GRUB_PC_PARTITION_NETBSD_TYPE_JFS2 = 21,
  59. GRUB_PC_PARTITION_NETBSD_TYPE_APPLEUFS = 22
  60. };
  61. /* OpenBSD-specific types. */
  62. enum
  63. {
  64. GRUB_PC_PARTITION_OPENBSD_TYPE_ADOS = 14,
  65. GRUB_PC_PARTITION_OPENBSD_TYPE_HFS = 15,
  66. GRUB_PC_PARTITION_OPENBSD_TYPE_FILECORE = 16,
  67. GRUB_PC_PARTITION_OPENBSD_TYPE_EXT2FS = 17,
  68. GRUB_PC_PARTITION_OPENBSD_TYPE_NTFS = 18,
  69. GRUB_PC_PARTITION_OPENBSD_TYPE_RAID = 19
  70. };
  71. #define GRUB_PC_PARTITION_BSD_LABEL_WHOLE_DISK_PARTITION 2
  72. /* The BSD partition entry. */
  73. struct grub_partition_bsd_entry
  74. {
  75. grub_uint32_t size;
  76. grub_uint32_t offset;
  77. grub_uint32_t fragment_size;
  78. grub_uint8_t fs_type;
  79. grub_uint8_t fs_fragments;
  80. grub_uint16_t fs_cylinders;
  81. } GRUB_PACKED;
  82. /* The BSD disk label. Only define members useful for GRUB. */
  83. struct grub_partition_bsd_disk_label
  84. {
  85. grub_uint32_t magic;
  86. grub_uint16_t type;
  87. grub_uint8_t unused1[18];
  88. grub_uint8_t packname[16];
  89. grub_uint8_t unused2[92];
  90. grub_uint32_t magic2;
  91. grub_uint16_t checksum;
  92. grub_uint16_t num_partitions;
  93. grub_uint32_t boot_size;
  94. grub_uint32_t superblock_size;
  95. } GRUB_PACKED;
  96. #endif /* ! GRUB_PC_PARTITION_HEADER */