OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
Mbr.c File Reference
#include "Partition.h"

Go to the source code of this file.

Functions

BOOLEAN PartitionValidMbr (IN MASTER_BOOT_RECORD *Mbr, IN EFI_LBA LastLba)
 
EFI_STATUS PartitionInstallMbrChildHandles (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Handle, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN EFI_DISK_IO2_PROTOCOL *DiskIo2, IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_BLOCK_IO2_PROTOCOL *BlockIo2, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 

Detailed Description

Decode a hard disk partitioned with the legacy MBR found on most PC's

MBR - Master Boot Record is in the first sector of a partitioned hard disk. The MBR supports four partitions per disk. The MBR also contains legacy code that is not run on an EFI system. The legacy code reads the first sector of the active partition into memory and

BPB - BIOS Parameter Block is in the first sector of a FAT file system. The BPB contains information about the FAT file system. The BPB is always on the first sector of a media. The first sector also contains the legacy boot strap code.

Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc. Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Mbr.c.

Function Documentation

◆ PartitionInstallMbrChildHandles()

EFI_STATUS PartitionInstallMbrChildHandles ( IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE Handle,
IN EFI_DISK_IO_PROTOCOL * DiskIo,
IN EFI_DISK_IO2_PROTOCOL * DiskIo2,
IN EFI_BLOCK_IO_PROTOCOL * BlockIo,
IN EFI_BLOCK_IO2_PROTOCOL * BlockIo2,
IN EFI_DEVICE_PATH_PROTOCOL * DevicePath )

Install child handles if the Handle supports MBR format.

Parameters
[in]ThisCalling context.
[in]HandleParent Handle.
[in]DiskIoParent DiskIo interface.
[in]DiskIo2Parent DiskIo2 interface.
[in]BlockIoParent BlockIo interface.
[in]BlockIo2Parent BlockIo2 interface.
[in]DevicePathParent Device Path.
Return values
EFI_SUCCESSA child handle was added.
EFI_MEDIA_CHANGEDMedia change was detected.
OthersMBR partition was not found.

Definition at line 118 of file Mbr.c.

◆ PartitionValidMbr()

BOOLEAN PartitionValidMbr ( IN MASTER_BOOT_RECORD * Mbr,
IN EFI_LBA LastLba )

Test to see if the Mbr buffer is a valid MBR.

Parameters
MbrParent Handle.
LastLbaLast Lba address on the device.
Return values
TRUEMbr is a Valid MBR.
FALSEMbr is not a Valid MBR.

Definition at line 34 of file Mbr.c.