1.1 --- a/epoc32/include/partitions.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,198 +0,0 @@
1.4 -// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -// e32\include\partitions.h
1.18 -//
1.19 -//
1.20 -
1.21 -
1.22 -
1.23 -/**
1.24 - @file
1.25 - @internalTechnology
1.26 -*/
1.27 -
1.28 -#ifndef __PARTITIONS_H__
1.29 -#define __PARTITIONS_H__
1.30 -#include <e32def.h>
1.31 -
1.32 -const TUint KPartitionTypeEmpty=0x00;
1.33 -const TUint KPartitionTypeFAT12=0x01;
1.34 -const TUint KPartitionTypeXENIXroot=0x02;
1.35 -const TUint KPartitionTypeXENIXusr=0x03;
1.36 -const TUint KPartitionTypeFAT16small=0x04;
1.37 -const TUint KPartitionTypeExtended=0x05;
1.38 -const TUint KPartitionTypeFAT16=0x06;
1.39 -const TUint KPartitionTypeNTFS=0x07;
1.40 -const TUint KPartitionTypeAIX=0x08;
1.41 -const TUint KPartitionTypeAIXboot=0x09;
1.42 -const TUint KPartitionTypeOS2BootManager=0x0a;
1.43 -const TUint KPartitionTypeWin95FAT32=0x0b;
1.44 -const TUint KPartitionTypeWin95FAT32LBA=0x0c;
1.45 -const TUint KPartitionTypeWin95FAT16LBA=0x0e;
1.46 -const TUint KPartitionTypeWin95ExtdLBA=0x0f;
1.47 -const TUint KPartitionTypeOPUS=0x10;
1.48 -const TUint KPartitionTypeHiddenFAT12=0x11;
1.49 -const TUint KPartitionTypeCompaqDiag=0x12;
1.50 -const TUint KPartitionTypeHiddenFAT16small=0x14;
1.51 -const TUint KPartitionTypeHiddenFAT16=0x16;
1.52 -const TUint KPartitionTypeHiddenNTFS=0x17;
1.53 -const TUint KPartitionTypeASTSmartSleep=0x18;
1.54 -const TUint KPartitionTypeHiddenWin95FAT32=0x1b;
1.55 -const TUint KPartitionTypeHiddenWin95FAT32LBA=0x1c;
1.56 -const TUint KPartitionTypeHiddenWin95FAT16LBA=0x1e;
1.57 -const TUint KPartitionTypeNECDOS=0x24;
1.58 -const TUint KPartitionTypePlan9=0x39;
1.59 -const TUint KPartitionTypePartitionMagic=0x3c;
1.60 -const TUint KPartitionTypeVenix80286=0x40;
1.61 -const TUint KPartitionTypePPCPRePBoot=0x41;
1.62 -const TUint KPartitionTypeSFS=0x42;
1.63 -const TUint KPartitionTypeQNX4x=0x4d;
1.64 -const TUint KPartitionTypeQNX4x_2=0x4e;
1.65 -const TUint KPartitionTypeQNX4x_3=0x4f;
1.66 -const TUint KPartitionTypeOnTrackDM=0x50;
1.67 -const TUint KPartitionTypeOnTrackDM6Aux=0x51;
1.68 -const TUint KPartitionTypeCPM=0x52;
1.69 -const TUint KPartitionTypeOnTrackDM6Aux_2=0x53;
1.70 -const TUint KPartitionTypeOnTrackDM6=0x54;
1.71 -const TUint KPartitionTypeEZDrive=0x55;
1.72 -const TUint KPartitionTypeGoldenBow=0x56;
1.73 -const TUint KPartitionTypePriamEdisk=0x5c;
1.74 -const TUint KPartitionTypeSpeedStor=0x61;
1.75 -const TUint KPartitionTypeGNU_HURD=0x63;
1.76 -const TUint KPartitionTypeNovellNetware=0x64;
1.77 -const TUint KPartitionTypeNovellNetware_2=0x65;
1.78 -const TUint KPartitionTypeDiskSecure=0x70;
1.79 -const TUint KPartitionTypePCIX=0x75;
1.80 -const TUint KPartitionTypeOldMinix=0x80;
1.81 -const TUint KPartitionTypeMinixOldLinux=0x81;
1.82 -const TUint KPartitionTypeLinuxSwap=0x82;
1.83 -const TUint KPartitionTypeLinux=0x83;
1.84 -const TUint KPartitionTypeOS2Hidden=0x84;
1.85 -const TUint KPartitionTypeLinuxExtended=0x85;
1.86 -const TUint KPartitionTypeNTFSvolset=0x86;
1.87 -const TUint KPartitionTypeNTFSvolset_2=0x87;
1.88 -const TUint KPartitionTypeLinuxLVM=0x8e;
1.89 -const TUint KPartitionTypeAmoeba=0x93;
1.90 -const TUint KPartitionTypeAmoebaBBT=0x94;
1.91 -const TUint KPartitionTypeBSD_OS=0x9f;
1.92 -const TUint KPartitionTypeIBMThinkpad=0xa0;
1.93 -const TUint KPartitionTypeFreeBSD=0xa5;
1.94 -const TUint KPartitionTypeOpenBSD=0xa6;
1.95 -const TUint KPartitionTypeNeXTSTEP=0xa7;
1.96 -const TUint KPartitionTypeNetBSD=0xa9;
1.97 -const TUint KPartitionTypeBSDIfs=0xb7;
1.98 -const TUint KPartitionTypeBSDIswap=0xb8;
1.99 -const TUint KPartitionTypeBootWizardHidden=0xbb;
1.100 -const TUint KPartitionTypeDRDOS=0xc1;
1.101 -const TUint KPartitionTypeDRDOS_2=0xc4;
1.102 -const TUint KPartitionTypeDRDOS_3=0xc6;
1.103 -const TUint KPartitionTypeSyrinx=0xc7;
1.104 -const TUint KPartitionTypeNonFSData=0xda;
1.105 -const TUint KPartitionTypeCPM_CTOS=0xdb;
1.106 -const TUint KPartitionTypeDellUtility=0xde;
1.107 -const TUint KPartitionTypeBootIt=0xdf;
1.108 -const TUint KPartitionTypeDOSaccess=0xe1;
1.109 -const TUint KPartitionTypeDOS_RO=0xe3;
1.110 -const TUint KPartitionTypeSymbianCrashLog=0xf0;
1.111 -const TUint KPartitionTypeSpeedStor_2=0xf1;
1.112 -const TUint KPartitionTypeDOSsecondary=0xf2;
1.113 -const TUint KPartitionTypeSpeedStor_3=0xf4;
1.114 -const TUint KPartitionTypeRofs=0xfa; // HACK
1.115 -const TUint KPartitionTypeIso9660=0xfb; // hack
1.116 -const TUint KPartitionTypeEneaLFFS=0xfc; // hack
1.117 -const TUint KPartitionTypeLinuxRaidAuto=0xfd;
1.118 -const TUint KPartitionTypeLANStep=0xfe;
1.119 -const TUint KPartitionTypeBBT=0xff;
1.120 -
1.121 -inline TBool PartitionIsFAT(TUint a)
1.122 - {
1.123 - return (
1.124 - a==KPartitionTypeFAT12 ||
1.125 - a==KPartitionTypeFAT16small ||
1.126 - a==KPartitionTypeFAT16 ||
1.127 - a==KPartitionTypeFAT16 ||
1.128 - a==KPartitionTypeWin95FAT16LBA ||
1.129 - a==KPartitionTypeHiddenFAT12 ||
1.130 - a==KPartitionTypeHiddenFAT16small ||
1.131 - a==KPartitionTypeHiddenFAT16 ||
1.132 - a==KPartitionTypeHiddenWin95FAT16LBA
1.133 - );
1.134 - }
1.135 -
1.136 -inline TBool PartitionIsFAT32(TUint a)
1.137 - {
1.138 - return (
1.139 - a==KPartitionTypeWin95FAT32 ||
1.140 - a==KPartitionTypeWin95FAT32LBA ||
1.141 - a==KPartitionTypeHiddenWin95FAT32 ||
1.142 - a==KPartitionTypeHiddenWin95FAT32LBA
1.143 - );
1.144 - }
1.145 -
1.146 -inline TBool PartitionIsNTFS(TUint a)
1.147 - {
1.148 - return (
1.149 - a==KPartitionTypeNTFS ||
1.150 - a==KPartitionTypeHiddenNTFS
1.151 - );
1.152 - }
1.153 -
1.154 -//
1.155 -// Entry in MBR partition table
1.156 -//
1.157 -const TUint KBootIndicatorBootable=0x80;
1.158 -
1.159 -class TMBRPartitionEntry
1.160 - {
1.161 -public:
1.162 - TBool IsValidPartition()
1.163 - { return (iNumSectors>0 && iPartitionType!=KPartitionTypeEmpty); }
1.164 - TBool IsValidDosPartition()
1.165 - { return (iNumSectors>0 && PartitionIsFAT(iPartitionType)); }
1.166 - TBool IsDefaultBootPartition()
1.167 - { return(iX86BootIndicator==KBootIndicatorBootable && (IsValidDosPartition() || IsValidFAT32Partition())); }
1.168 - TBool IsValidFAT32Partition()
1.169 - { return (iNumSectors>0 && PartitionIsFAT32(iPartitionType)); }
1.170 -public:
1.171 - TUint8 iX86BootIndicator;
1.172 - TUint8 iStartHead;
1.173 - TUint8 iStartSector;
1.174 - TUint8 iStartCylinder;
1.175 - TUint8 iPartitionType;
1.176 - TUint8 iEndHead;
1.177 - TUint8 iEndSector;
1.178 - TUint8 iEndCylinder;
1.179 - TUint32 iFirstSector;
1.180 - TUint32 iNumSectors;
1.181 - };
1.182 -
1.183 -//
1.184 -// Defines for Master boot record
1.185 -//
1.186 -const TUint KMBRFirstPartitionOffset=0x1BE;
1.187 -const TUint KMBRSignatureOffset=0x1FE;
1.188 -const TUint KMBRSignature=0xAA55;
1.189 -const TInt KMBRMaxPrimaryPartitions=4;
1.190 -
1.191 -class TMasterBootRecord
1.192 - {
1.193 -public:
1.194 - TUint8 iBootCode[KMBRFirstPartitionOffset];
1.195 - TMBRPartitionEntry iPartitionEntry[KMBRMaxPrimaryPartitions];
1.196 - TUint16 iSignature;
1.197 - };
1.198 -
1.199 -
1.200 -
1.201 -#endif