IOFDiskPartitionScheme.h [plain text]
#ifndef _IOFDISKPARTITIONSCHEME_H
#define _IOFDISKPARTITIONSCHEME_H
#include <IOKit/IOTypes.h>
#define kIOFDiskPartitionSchemeClass "IOFDiskPartitionScheme"
#pragma pack(push, 1)
#define DISK_BLK0SZ sizeof(struct disk_blk0)
#define DISK_BOOTSZ 446
#define DISK_NPART 4
struct fdisk_part
{
UInt8 bootid;
UInt8 beghead;
UInt8 begsect;
UInt8 begcyl;
UInt8 systid;
UInt8 endhead;
UInt8 endsect;
UInt8 endcyl;
UInt32 relsect;
UInt32 numsect;
};
struct disk_blk0
{
UInt8 bootcode[DISK_BOOTSZ];
struct fdisk_part parts[DISK_NPART];
UInt16 signature;
};
#define DISK_SIGNATURE 0xAA55
#define FDISK_PARTITION_TYPE_01 "DOS_FAT_12"
#define FDISK_PARTITION_TYPE_04 "DOS_FAT_16_S"
#define FDISK_PARTITION_TYPE_06 "DOS_FAT_16"
#define FDISK_PARTITION_TYPE_07 "Windows_NTFS"
#define FDISK_PARTITION_TYPE_0B "DOS_FAT_32"
#define FDISK_PARTITION_TYPE_0C "Windows_FAT_32"
#define FDISK_PARTITION_TYPE_0E "Windows_FAT_16"
#define FDISK_PARTITION_TYPE_42 "Windows_LDM"
#define FDISK_PARTITION_TYPE_82 "Linux_Swap"
#define FDISK_PARTITION_TYPE_83 "Linux"
#define FDISK_PARTITION_TYPE_8E "Linux_LVM"
#define FDISK_PARTITION_TYPE_A5 "FreeBSD"
#define FDISK_PARTITION_TYPE_A6 "OpenBSD"
#define FDISK_PARTITION_TYPE_A7 "Apple_Rhapsody_UFS"
#define FDISK_PARTITION_TYPE_A8 "Apple_UFS"
#define FDISK_PARTITION_TYPE_A9 "NetBSD"
#define FDISK_PARTITION_TYPE_AB "Apple_Boot"
#define FDISK_PARTITION_TYPE_AE "Apple_Encrypted"
#define FDISK_PARTITION_TYPE_AF "Apple_HFS"
#define FDISK_PARTITION_TYPE_FD "Linux_RAID"
#pragma pack(pop)
#ifdef KERNEL
#ifdef __cplusplus
#include <IOKit/storage/IOPartitionScheme.h>
class IOFDiskPartitionScheme : public IOPartitionScheme
{
OSDeclareDefaultStructors(IOFDiskPartitionScheme);
protected:
struct ExpansionData { };
ExpansionData * _expansionData;
OSSet * _partitions;
virtual void free(void) APPLE_KEXT_OVERRIDE;
virtual OSSet * scan(SInt32 * score);
virtual bool isPartitionExtended(fdisk_part * partition);
virtual bool isPartitionUsed(fdisk_part * partition);
virtual bool isPartitionCorrupt( fdisk_part * partition,
UInt32 partitionID,
UInt32 fdiskBlock );
virtual bool isPartitionInvalid( fdisk_part * partition,
UInt32 partitionID,
UInt32 fdiskBlock );
virtual IOMedia * instantiateMediaObject( fdisk_part * partition,
UInt32 partitionID,
UInt32 fdiskBlock );
virtual IOMedia * instantiateDesiredMediaObject( fdisk_part * partition,
UInt32 partitionID,
UInt32 fdiskBlock );
public:
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE;
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE;
virtual IOReturn requestProbe(IOOptionBits options) APPLE_KEXT_OVERRIDE;
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 0);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 1);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 2);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 3);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 4);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 5);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 6);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 7);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 8);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 9);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 10);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 11);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 12);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 13);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 14);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 15);
};
#endif
#endif
#endif