revert previous incorrect version of commit and recommit correct version to allow...
[AROS.git] / rom / partition / partition_types.c
blob543ce5b790b5ca93c96f048097d1d3983ddcbd66
1 /*
2 Copyright © 1995-2019, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <libraries/iffparse.h>
7 #include <libraries/uuid.h>
9 #include "partition_types.h"
12 * TODO: This should not be a hardcoded mapping, instead it should be loaded
13 * from some file, like DEVS:partition-types.
16 static const uuid_t GPT_Type_EFISystem = MAKE_UUID(0xC12A7328, 0xF81F, 0x11D2, 0xBA4B, 0x00A0C93EC93BULL);
17 static const uuid_t GPT_Type_HFSPlus = MAKE_UUID(0x48465300, 0x0000, 0x11AA, 0xAA11, 0x00306543ECACULL);
18 static const uuid_t GPT_Type_FreeBSD_Boot = MAKE_UUID(0x83BD6B9D, 0x7F41, 0x11DC, 0xBE0B, 0x001560B84F0FULL);
19 static const uuid_t GPT_Type_FreeBSD_Data = MAKE_UUID(0x516E7CB4, 0x6ECF, 0x11D6, 0x8FF8, 0x00022D09712BULL);
20 static const uuid_t GPT_Type_NetBSD_FFS = MAKE_UUID(0x49F48D5A, 0xB10E, 0x11DC, 0xB99B, 0x0019D1879648ULL);
22 const struct TypeMapping PartTypes[] =
24 { 0x01, MAKE_ID('F','A','T','\0'), NULL }, /* DOS 12-bit FAT */
25 { 0x04, MAKE_ID('F','A','T','\1'), NULL }, /* DOS 16-bit FAT (up to 32M) */
26 { 0x06, MAKE_ID('F','A','T','\1'), NULL }, /* DOS 16-bit FAT (over 32M) */
27 { 0x07, MAKE_ID('N','T','F','S') , NULL }, /* Windows NT NTFS */
28 { 0x0b, MAKE_ID('F','A','T','\2'), NULL }, /* W95 FAT32 */
29 { 0x0c, MAKE_ID('F','A','T','\2'), &GPT_Type_EFISystem }, /* W95 LBA FAT32 */
30 { 0x0e, MAKE_ID('F','A','T','\1'), NULL }, /* W95 16-bit LBA FAT */
31 { 0x2c, MAKE_ID('D','O','S','\0'), NULL }, /* AOS OFS */
32 { 0x2d, MAKE_ID('D','O','S','\1'), NULL }, /* AOS FFS */
33 { 0x2e, MAKE_ID('D','O','S','\3'), NULL }, /* AOS FFS-I */
34 { 0x2f, MAKE_ID('S','F','S','\0'), NULL }, /* AOS SFS */
35 { 0x80, MAKE_ID('M','N','X','\0'), NULL }, /* MINIX until 1.4a */
36 { 0x81, MAKE_ID('M','N','X','\1'), NULL }, /* MINIX since 1.4b */
37 { 0x83, MAKE_ID('E','X','T','\2'), NULL }, /* linux native partition */
38 { 0x8e, MAKE_ID('L','V','M','\0'), NULL }, /* linux LVM partition */
39 { 0x9f, MAKE_ID('B','S','D','\0'), NULL }, /* BSD/OS */
40 { 0xa5, MAKE_ID('B','S','D','\1'), &GPT_Type_FreeBSD_Boot}, /* FreeBSD */
41 { 0xa5, MAKE_ID('B','S','D','\1'), &GPT_Type_FreeBSD_Data},
42 { 0xa5, MAKE_ID('B','S','D','\1'), &GPT_Type_NetBSD_FFS }, /* NetBSD */
43 { 0xa6, MAKE_ID('B','S','D','\2'), NULL }, /* OpenBSD */
44 { 0xaf, MAKE_ID('H','F','S','+' ), &GPT_Type_HFSPlus },
45 { 0xdb, MAKE_ID('C','P','M','\2'), NULL }, /* CPM/M */
46 { 0xeb, MAKE_ID('B','E','F','S' ), NULL }, /* BeOS FS */
47 { 0xec, MAKE_ID('S','K','Y','\0'), NULL }, /* SkyOS FS */
48 { 0xfd, MAKE_ID('R','A','I','D' ), NULL }, /* linux RAID with autodetect */
49 { 0, 0, NULL }
52 ULONG MBR_FindDosType(UBYTE id)
54 const struct TypeMapping *m;
56 for (m = PartTypes; m->DOSType; m++)
58 if (m->MBRType == id)
59 return m->DOSType;
62 return 0;