hfs.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2005,2006,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_HFS_HEADER
  19. #define GRUB_HFS_HEADER 1
  20. #include <grub/types.h>
  21. #define GRUB_HFS_MAGIC 0x4244
  22. /* A single extent. A file consists of one or more extents. */
  23. struct grub_hfs_extent
  24. {
  25. /* The first physical block. */
  26. grub_uint16_t first_block;
  27. grub_uint16_t count;
  28. };
  29. /* HFS stores extents in groups of 3. */
  30. typedef struct grub_hfs_extent grub_hfs_datarecord_t[3];
  31. /* The HFS superblock (The official name is `Master Directory
  32. Block'). */
  33. struct grub_hfs_sblock
  34. {
  35. grub_uint16_t magic;
  36. grub_uint8_t unused[18];
  37. grub_uint32_t blksz;
  38. grub_uint8_t unused2[4];
  39. grub_uint16_t first_block;
  40. grub_uint8_t unused4[6];
  41. /* A pascal style string that holds the volumename. */
  42. grub_uint8_t volname[28];
  43. grub_uint8_t unused5[52];
  44. grub_uint64_t num_serial;
  45. grub_uint16_t embed_sig;
  46. struct grub_hfs_extent embed_extent;
  47. grub_uint8_t unused6[4];
  48. grub_hfs_datarecord_t extent_recs;
  49. grub_uint32_t catalog_size;
  50. grub_hfs_datarecord_t catalog_recs;
  51. } __attribute__ ((packed));
  52. #endif /* ! GRUB_HFS_HEADER */