--*/\r
\r
#include "Partition.h"\r
-#include "ElTorito.h"\r
\r
BOOLEAN\r
PartitionInstallElToritoChildHandles (\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- ElTorito.h\r
- \r
-Abstract:\r
-\r
- Data Structures required for detecting ElTorito Partitions\r
- \r
-Revision History\r
-\r
---*/\r
-\r
-#ifndef _ELTORITO_H_\r
-#define _ELTORITO_H_\r
-\r
-#pragma pack(1)\r
-//\r
-// CDROM_VOLUME_DESCRIPTOR.Types\r
-//\r
-#define CDVOL_TYPE_STANDARD 0x0\r
-#define CDVOL_TYPE_CODED 0x1\r
-#define CDVOL_TYPE_END 0xFF\r
-\r
-//\r
-// CDROM_VOLUME_DESCRIPTOR.Id\r
-//\r
-#define CDVOL_ID "CD001"\r
-\r
-//\r
-// CDROM_VOLUME_DESCRIPTOR.SystemId\r
-//\r
-#define CDVOL_ELTORITO_ID "EL TORITO SPECIFICATION"\r
-\r
-//\r
-// Indicator types\r
-//\r
-#define ELTORITO_ID_CATALOG 0x01\r
-#define ELTORITO_ID_SECTION_BOOTABLE 0x88\r
-#define ELTORITO_ID_SECTION_NOT_BOOTABLE 0x00\r
-#define ELTORITO_ID_SECTION_HEADER 0x90\r
-#define ELTORITO_ID_SECTION_HEADER_FINAL 0x91\r
-\r
-//\r
-// ELTORITO_CATALOG.Boot.MediaTypes\r
-//\r
-#define ELTORITO_NO_EMULATION 0x00\r
-#define ELTORITO_12_DISKETTE 0x01\r
-#define ELTORITO_14_DISKETTE 0x02\r
-#define ELTORITO_28_DISKETTE 0x03\r
-#define ELTORITO_HARD_DISK 0x04\r
-\r
-//\r
-// El Torito Volume Descriptor\r
-// Note that the CDROM_VOLUME_DESCRIPTOR does not match the ISO-9660\r
-// descriptor. For some reason descriptor used by El Torito is\r
-// different, but they start the same. The El Torito descriptor\r
-// is left shifted 1 byte starting with the SystemId. (Note this\r
-// causes the field to get unaligned)\r
-//\r
-typedef struct {\r
- UINT8 Type;\r
- CHAR8 Id[5]; // CD001\r
- UINT8 Version;\r
- CHAR8 SystemId[26];\r
- CHAR8 Unused[38];\r
- UINT8 EltCatalog[4];\r
- CHAR8 Unused2[5];\r
- UINT32 VolSpaceSize[2];\r
-} CDROM_VOLUME_DESCRIPTOR;\r
-\r
-//\r
-// Catalog Entry\r
-//\r
-typedef union {\r
- struct {\r
- CHAR8 Reserved[0x20];\r
- } Unknown;\r
-\r
- //\r
- // Catalog validation entry (Catalog header)\r
- //\r
- struct {\r
- UINT8 Indicator;\r
- UINT8 PlatformId;\r
- UINT16 Reserved;\r
- CHAR8 ManufacId[24];\r
- UINT16 Checksum;\r
- UINT16 Id55AA;\r
- } Catalog;\r
-\r
- //\r
- // Initial/Default Entry or Section Entry\r
- //\r
- struct {\r
- UINT8 Indicator;\r
- UINT8 MediaType : 4;\r
- UINT8 Reserved1 : 4;\r
- UINT16 LoadSegment;\r
- UINT8 SystemType;\r
- UINT8 Reserved2;\r
- UINT16 SectorCount;\r
- UINT32 Lba;\r
- } Boot;\r
-\r
- //\r
- // Section Header Entry\r
- //\r
- struct {\r
- UINT8 Indicator;\r
- UINT8 PlatformId;\r
- UINT16 SectionEntries;\r
- CHAR8 Id[28];\r
- } Section;\r
-\r
-} ELTORITO_CATALOG;\r
-\r
-#pragma pack()\r
-\r
-#endif\r
--*/\r
\r
#include "Partition.h"\r
-#include "Gpt.h"\r
-#include "Mbr.h"\r
\r
BOOLEAN\r
PartitionValidGptTable (\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- Gpt.h\r
- \r
-Abstract:\r
-\r
- Data Structures required for detecting GPT Partitions\r
- \r
-Revision History\r
-\r
---*/\r
-\r
-#ifndef _GPT_H_\r
-#define _GPT_H_\r
-\r
-#pragma pack(1)\r
-\r
-#define PRIMARY_PART_HEADER_LBA 1\r
-\r
-#define EFI_PTAB_HEADER_ID "EFI PART"\r
-\r
-//\r
-// EFI Partition Attributes\r
-//\r
-#define EFI_PART_REQUIRED_TO_FUNCTION 0x0000000000000001\r
-\r
-//\r
-// GPT Partition Table Header\r
-//\r
-typedef struct {\r
- EFI_TABLE_HEADER Header;\r
- EFI_LBA MyLBA;\r
- EFI_LBA AlternateLBA;\r
- EFI_LBA FirstUsableLBA;\r
- EFI_LBA LastUsableLBA;\r
- EFI_GUID DiskGUID;\r
- EFI_LBA PartitionEntryLBA;\r
- UINT32 NumberOfPartitionEntries;\r
- UINT32 SizeOfPartitionEntry;\r
- UINT32 PartitionEntryArrayCRC32;\r
-} EFI_PARTITION_TABLE_HEADER;\r
-\r
-//\r
-// GPT Partition Entry\r
-//\r
-typedef struct {\r
- EFI_GUID PartitionTypeGUID;\r
- EFI_GUID UniquePartitionGUID;\r
- EFI_LBA StartingLBA;\r
- EFI_LBA EndingLBA;\r
- UINT64 Attributes;\r
- CHAR16 PartitionName[36];\r
-} EFI_PARTITION_ENTRY;\r
-\r
-//\r
-// GPT Partition Entry Status\r
-//\r
-typedef struct {\r
- BOOLEAN OutOfRange;\r
- BOOLEAN Overlap;\r
-} EFI_PARTITION_ENTRY_STATUS;\r
-\r
-#pragma pack()\r
-\r
-#endif\r
--*/\r
\r
#include "Partition.h"\r
-#include "Mbr.h"\r
\r
BOOLEAN\r
PartitionValidMbr (\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- Mbr.h\r
- \r
-Abstract:\r
-\r
- Data Structures required for detecting MBR Partitions\r
- \r
-Revision History\r
-\r
---*/\r
-\r
-#ifndef _MBR_H_\r
-#define _MBR_H_\r
-\r
-#pragma pack(1)\r
-\r
-#define MBR_SIGNATURE 0xaa55\r
-#define MIN_MBR_DEVICE_SIZE 0x80000\r
-#define MBR_ERRATA_PAD 0x40000 // 128 MB\r
-#define EXTENDED_DOS_PARTITION 0x05\r
-#define EXTENDED_WINDOWS_PARTITION 0x0F\r
-#define MAX_MBR_PARTITIONS 4\r
-\r
-#define PMBR_GPT_PARTITION 0xEE\r
-#define EFI_PARTITION 0xEF\r
-#define MBR_SIZE 512\r
-\r
-//\r
-// MBR Partition Entry\r
-//\r
-typedef struct {\r
- UINT8 BootIndicator;\r
- UINT8 StartHead;\r
- UINT8 StartSector;\r
- UINT8 StartTrack;\r
- UINT8 OSIndicator;\r
- UINT8 EndHead;\r
- UINT8 EndSector;\r
- UINT8 EndTrack;\r
- UINT8 StartingLBA[4];\r
- UINT8 SizeInLBA[4];\r
-} MBR_PARTITION_RECORD;\r
-\r
-//\r
-// MBR Partition table\r
-//\r
-typedef struct {\r
- UINT8 BootStrapCode[440];\r
- UINT8 UniqueMbrSignature[4];\r
- UINT8 Unknown[2];\r
- MBR_PARTITION_RECORD Partition[MAX_MBR_PARTITIONS];\r
- UINT16 Signature;\r
-} MASTER_BOOT_RECORD;\r
-\r
-#pragma pack()\r
-\r
-#endif\r
#ifndef __PARTITION_H__\r
#define __PARTITION_H__\r
\r
-\r
+#include <IndustryStandard/Mbr.h>\r
+#include <IndustryStandard/ElTorito.h>\r
+#include <IndustryStandard/EfiGpt.h>\r
\r
//\r
// Partition private data\r
-<?xml version="1.0" encoding="UTF-8"?>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
<MsaHeader>\r
<ModuleName>Partition</ModuleName>\r
</LibraryClassDefinitions>\r
<SourceFiles>\r
<Filename>Partition.h</Filename>\r
- <Filename>ElTorito.h</Filename>\r
- <Filename>Gpt.h</Filename>\r
- <Filename>Mbr.h</Filename>\r
<Filename>Partition.c</Filename>\r
<Filename>ElTorito.c</Filename>\r
<Filename>Gpt.c</Filename>\r