Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/modules/Disk/include/GUIDPartition.hpp

Source at commit 1406 created 12 years 10 months ago.
By meklort, Revert drivers.c so that kexts are only loaded when OSBundleRequired is set and that value is not safe mode. Added some comments about it too.
1/*
2 * Copyright (c) 2011 Evan Lojewski. All rights reserved.
3 *
4 */
5#ifndef GUID_PARTITION_H
6#define GUID_PARTITION_H
7
8#include <IOKit/IOTypes.h>
9#include <Partition.hpp>
10#include <IOKit/storage/IOGUIDPartitionScheme.h>
11
12#pragma pack(push, 1) /* (enable 8-bit struct packing) */
13
14typedef struct
15{
16 UInt8 hdr_sig[8];
17 UInt32 hdr_revision;
18 UInt32 hdr_size;
19 UInt32 hdr_crc_self;
20 UInt32 __reserved;
21 UInt64 hdr_lba_self;
22 UInt64 hdr_lba_alt;
23 UInt64 hdr_lba_start;
24 UInt64 hdr_lba_end;
25 UInt8 hdr_uuid[16];
26 UInt64 hdr_lba_table;
27 UInt32 hdr_entries;
28 UInt32 hdr_entsz;
29 UInt32 hdr_crc_table;
30 UInt32 padding;
31} GPTHeader;
32
33/* Partition map entry. */
34
35typedef struct
36{
37 UInt8 ent_type[16];
38 UInt8 ent_uuid[16];
39 UInt64 ent_lba_start;
40 UInt64 ent_lba_end;
41 UInt64 ent_attr;
42 UInt16 ent_name[36];
43} GPTEntry;
44
45#pragma pack(pop)
46
47class GUIDPartition : public Partition
48{
49public:
50 GUIDPartition(Disk* disk, UInt8 partitionNumber);
51 ~GUIDPartition();
52
53protected:
54 bool isGPTDisk();
55
56private:
57 UInt8 mLBABUffer[512*4 ]; // TODO: don't assume 512
58 GPTHeader* mGPTHeader;
59 GPTEntry* mGPTEntry;
60};
61
62#endif /* GUID_PARTITION_H */
63

Archive Download this file

Revision: 1406