dospart.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #ifndef FS_DOSPART_H_
  2. #define FS_DOSPART_H_
  3. /*
  4. * Copyright (C) 2005 by egnite Software GmbH. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
  23. * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. */
  34. /*!
  35. * \file fs/dospart.h
  36. * \brief DOS partition table definitions.
  37. *
  38. * \verbatim
  39. *
  40. * $Log: dospart.h,v $
  41. * Revision 1.1 2006/01/05 16:32:26 haraldkipp
  42. * First check-in.
  43. *
  44. *
  45. * \endverbatim
  46. */
  47. #include <sys/types.h>
  48. /*!
  49. * \addtogroup xgPartition
  50. */
  51. /*@{*/
  52. /*!
  53. * \name Known partition types.
  54. */
  55. /*@{*/
  56. #define PTYPE_EMPTY 0x00
  57. #define PTYPE_FAT12 0x01
  58. #define PTYPE_FAT16 0x04
  59. #define PTYPE_DOS_EXT 0x05
  60. #define PTYPE_FAT16_BIG 0x06
  61. #define PTYPE_IFS 0x07
  62. #define PTYPE_OS2V1 0x08
  63. #define PTYPE_AIXDATA 0x09
  64. #define PTYPE_OS2BM 0x0A
  65. #define PTYPE_FAT32 0x0B
  66. #define PTYPE_FAT32_LBA 0x0C
  67. #define PTYPE_FAT16_LBA 0x0E
  68. #define PTYPE_EXT_LBA 0x0F
  69. #define PTYPE_OPUS 0x10
  70. #define PTYPE_FAT12_HIDDEN 0x11
  71. #define PTYPE_OEM 0x12
  72. #define PTYPE_FAT16_HIDDEN 0x14
  73. #define PTYPE_FAT16_BIGH 0x16
  74. #define PTYPE_IFS_HIDDEN 0x17
  75. #define PTYPE_AST_SLEEP 0x18
  76. #define PTYPE_FAT32_HIDDEN 0x1B
  77. #define PTYPE_FAT32_LBAH 0x1C
  78. #define PTYPE_FAT16_LBAH 0x1E
  79. #define PTYPE_DOS33_NEC 0x24
  80. #define PTYPE_JFS 0x35
  81. #define PTYPE_MINIX 0x41
  82. #define PTYPE_DYN 0x42
  83. #define PTYPE_UNIX_SYSV 0x63
  84. #define PTYPE_LINUX_SWAP 0x82
  85. #define PTYPE_LINUX 0x83
  86. #define PTYPE_PM_HIBERNATE 0x84
  87. #define PTYPE_LINUX_EXT 0x85
  88. #define PTYPE_FAT16_MULTI 0x86
  89. #define PTYPE_NTFS_MULTI 0x87
  90. #define PTYPE_LT_HIBERNATE 0xA0
  91. #define PTYPE_BSD 0xA5
  92. #define PTYPE_OPENBSD 0xA6
  93. #define PTYPE_MACOSX 0xA8
  94. #define PTYPE_NETBSD 0xA9
  95. #define PTYPE_MACOSX_BOOT 0xAB
  96. #define PTYPE_BSD_SWAP 0xB8
  97. #define PTYPE_CPM86 0xD8
  98. #define PTYPE_DATA 0xDA
  99. #define PTYPE_DRCPM 0xDB
  100. #define PTYPE_OEM_DELL 0xDE
  101. #define PTYPE_GPT 0xEE
  102. #define PTYPE_EFI 0xEF
  103. #define PTYPE_OEM_IBM 0xFE
  104. /*@}*/
  105. #define DOSPART_SECTORPOS 446
  106. /*!
  107. * \brief Partition table entry.
  108. *
  109. * Multibyte values are little endian.
  110. */
  111. typedef struct __attribute__ ((packed)) _DOSPART {
  112. /*! \brief Boot descriptor. */
  113. u_char part_state;
  114. /*! \brief Partition start. */
  115. u_char part_start[3];
  116. /*! \brief Partition type. See PTYPE_ definitions. */
  117. u_char part_type;
  118. /*! \brief Partition end. */
  119. u_char part_end[3];
  120. /*! \brief First linear block address of this partition. */
  121. u_long part_sect_offs;
  122. /*! \brief Partition size in sectors. */
  123. u_long part_sects;
  124. } DOSPART;
  125. /*@}*/
  126. #endif