LoadMBR Function

Microchip MDD File System Interface

MDDFS Interface Library Help
LoadMBR Function
C
BYTE LoadMBR(
    DISK * dsk
);
Description

The LoadMBR function will use the function pointed to by the MDD_SectorRead function pointer to read the 0 sector from the device. If a valid boot signature is obtained, this function will compare fields in that cached sector to the values that would be present if that sector was a boot sector. If all of those values match, it will be assumed that the device does not have a master boot record and the 0 sector is actually the boot sector. Otherwise, data about the partition and the actual location of the boot sector will be loaded from the MBR into the DISK structure pointed to by 'dsk.'

Preconditions

This function should not be called by the user.

Parameters
Parameters 
Description 
dsk 
The disk containing the master boot record to be loaded 
Return Values
Return Values 
Description 
CE_GOOD 
MBR loaded successfully 
CE_BAD_SECTOR_READ 
A bad read occured of a sector 
CE_BAD_PARTITION 
The boot record is bad 
Side Effects

None

Remarks

None

Microchip MDD File System Interface 1.2.0 - [Aug 18, 2008]
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.