/** @file
Decode an El Torito formatted CD-ROM
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "Partition.h"
/**
Install child handles if the Handle supports El Torito format.
@param[in] This Calling context.
@param[in] Handle Parent Handle.
@param[in] DiskIo Parent DiskIo interface.
@param[in] BlockIo Parent BlockIo interface.
@param[in] BlockIo2 Parent BlockIo2 interface.
@param[in] DevicePath Parent Device Path
@retval EFI_SUCCESS Child handle(s) was added.
@retval EFI_MEDIA_CHANGED Media changed Detected.
@retval other no child handle was added.
**/
)
{
VolSpaceSize = 0;
//
// CD_ROM has the fixed block size as 2048 bytes
//
return EFI_NOT_FOUND;
}
if (VolDescriptor == NULL) {
return EFI_NOT_FOUND;
}
//
// the ISO-9660 volume descriptor starts at 32k on the media
// and CD_ROM has the fixed block size as 2048 bytes, so...
//
//
// ((16*2048) / Media->BlockSize) - 1;
//
VolDescriptorLba = 15;
//
// Loop: handle one volume descriptor per time
//
while (TRUE) {
VolDescriptorLba += 1;
//
// We are pointing past the end of the device so exit
//
break;
}
);
break;
}
//
// Check for valid volume descriptor signature
//
) {
//
// end of Volume descriptor list
//
break;
}
//
// Read the Volume Space Size from Primary Volume Descriptor 81-88 byte,
// the 32-bit numerical values is stored in Both-byte orders
//
}
//
// Is it an El Torito volume descriptor?
//
if (CompareMem (VolDescriptor->BootRecordVolume.SystemId, CDVOL_ELTORITO_ID, sizeof (CDVOL_ELTORITO_ID) - 1) != 0) {
continue;
}
//
// Read in the boot El Torito boot catalog
//
continue;
}
);
continue;
}
//
// We don't care too much about the Catalog header's contents, but we do want
// to make sure it looks like a Catalog header
//
continue;
}
Check = 0;
}
if ((Check & 0xFFFF) != 0) {
continue;
}
//
// Next entry
//
Catalog += 1;
//
// Check this entry
//
continue;
}
SubBlockSize = 512;
case ELTORITO_NO_EMULATION:
break;
case ELTORITO_HARD_DISK:
break;
case ELTORITO_12_DISKETTE:
break;
case ELTORITO_14_DISKETTE:
break;
case ELTORITO_28_DISKETTE:
break;
default:
DEBUG ((EFI_D_INIT, "EltCheckDevice: unsupported El Torito boot media type %x\n", Catalog->Boot.MediaType));
SectorCount = 0;
break;
}
//
// Create child device handle
//
if (Index == 1) {
//
//
BootEntry = 0;
}
BootEntry++;
if (SectorCount < 2) {
//
// When the SectorCount < 2, set the Partition as the whole CD.
//
} else {
}
} else {
);
}
This,
);
Found = EFI_SUCCESS;
}
}
}
return Found;
}