bsdlabel.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #define GRUB_PC_PARTITION_BSD_TYPE_UNUSED 0
  25. #define GRUB_PC_PARTITION_BSD_TYPE_SWAP 1
  26. #define GRUB_PC_PARTITION_BSD_TYPE_V6 2
  27. #define GRUB_PC_PARTITION_BSD_TYPE_V7 3
  28. #define GRUB_PC_PARTITION_BSD_TYPE_SYSV 4
  29. #define GRUB_PC_PARTITION_BSD_TYPE_V71K 5
  30. #define GRUB_PC_PARTITION_BSD_TYPE_V8 6
  31. #define GRUB_PC_PARTITION_BSD_TYPE_BSDFFS 7
  32. #define GRUB_PC_PARTITION_BSD_TYPE_MSDOS 8
  33. #define GRUB_PC_PARTITION_BSD_TYPE_BSDLFS 9
  34. #define GRUB_PC_PARTITION_BSD_TYPE_OTHER 10
  35. #define GRUB_PC_PARTITION_BSD_TYPE_HPFS 11
  36. #define GRUB_PC_PARTITION_BSD_TYPE_ISO9660 12
  37. #define GRUB_PC_PARTITION_BSD_TYPE_BOOT 13
  38. /* FreeBSD-specific types. */
  39. #define GRUB_PC_PARTITION_FREEBSD_TYPE_VINUM 14
  40. #define GRUB_PC_PARTITION_FREEBSD_TYPE_RAID 15
  41. #define GRUB_PC_PARTITION_FREEBSD_TYPE_JFS2 21
  42. /* NetBSD-specific types. */
  43. #define GRUB_PC_PARTITION_NETBSD_TYPE_ADOS 14
  44. #define GRUB_PC_PARTITION_NETBSD_TYPE_HFS 15
  45. #define GRUB_PC_PARTITION_NETBSD_TYPE_FILECORE 16
  46. #define GRUB_PC_PARTITION_NETBSD_TYPE_EXT2FS 17
  47. #define GRUB_PC_PARTITION_NETBSD_TYPE_NTFS 18
  48. #define GRUB_PC_PARTITION_NETBSD_TYPE_RAID 19
  49. #define GRUB_PC_PARTITION_NETBSD_TYPE_CCD 20
  50. #define GRUB_PC_PARTITION_NETBSD_TYPE_JFS2 21
  51. #define GRUB_PC_PARTITION_NETBSD_TYPE_APPLEUFS 22
  52. /* OpenBSD-specific types. */
  53. #define GRUB_PC_PARTITION_OPENBSD_TYPE_ADOS 14
  54. #define GRUB_PC_PARTITION_OPENBSD_TYPE_HFS 15
  55. #define GRUB_PC_PARTITION_OPENBSD_TYPE_FILECORE 16
  56. #define GRUB_PC_PARTITION_OPENBSD_TYPE_EXT2FS 17
  57. #define GRUB_PC_PARTITION_OPENBSD_TYPE_NTFS 18
  58. #define GRUB_PC_PARTITION_OPENBSD_TYPE_RAID 19
  59. /* The BSD partition entry. */
  60. struct grub_partition_bsd_entry
  61. {
  62. grub_uint32_t size;
  63. grub_uint32_t offset;
  64. grub_uint32_t fragment_size;
  65. grub_uint8_t fs_type;
  66. grub_uint8_t fs_fragments;
  67. grub_uint16_t fs_cylinders;
  68. } __attribute__ ((packed));
  69. /* The BSD disk label. Only define members useful for GRUB. */
  70. struct grub_partition_bsd_disk_label
  71. {
  72. grub_uint32_t magic;
  73. grub_uint8_t padding[128];
  74. grub_uint32_t magic2;
  75. grub_uint16_t checksum;
  76. grub_uint16_t num_partitions;
  77. grub_uint32_t boot_size;
  78. grub_uint32_t superblock_size;
  79. } __attribute__ ((packed));
  80. #endif /* ! GRUB_PC_PARTITION_HEADER */