Olivier,
I have several comments regarding your patch:

1.        if (((2048 % Media->BlockSize) != 0) && (Media->BlockSize > 2048)) {

    return EFI_NOT_FOUND;

  }

The above check cannot catch the case when Media->BlockSize is 13. So I am 
wondering maybe "&&" should be "||". Please confirm.

2.        IsFirstVolumeDescriptor = TRUE;

  while (TRUE) {

    if (IsFirstVolumeDescriptor) {

      // Move to the next volume descriptor

      VolDescriptorOffset += SIZE_2KB;

      IsFirstVolumeDescriptor = FALSE;

}
         I don't understand why it only adds SIZE_2KB in the first loop? Can 
you explain more?

3.      VolDescriptorOffset is type of UINT32. I suggest to change to UINT64.

4.      There are two places using 2048. Suggest to change to SIZE_2KB.

Thanks,
Ray

From: Olivier Martin [mailto:olivier.mar...@arm.com]
Sent: Tuesday, October 21, 2014 1:09 AM
To: Tian, Feng
Cc: edk2-devel@lists.sourceforge.net
Subject: [edk2] [PATCH] MdeModulePkg/PartitionDxe: Fixed El Torito support when 
the medium is not a CDROM

Dear MdeModulePkg maintainer,

Please find the attached patch that fixes El Torito format on media that do not 
have a 2KB block size.

El Torito format can be used on different media (eg: USB).
A ISO image can be dumped onto a USB mass-storage.

These media might not have the same block size as the CDROM media (ie: 2KB).
The El Torito code and the the El Torito catalogue assume a 2KB-LBA.

In addition, the UEFI specification says in "12.3.4.4 CD-ROM and DVD-ROM":
UEFI code does not assume a fixed block size.

I was able to duplicate the issue by copying a debian ISO on a USB driver and 
try to open the device with UEFI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin 
<olivier.mar...@arm.com<mailto:olivier.mar...@arm.com>>

Regards,
Olivier
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to