Hi all,

I wrote a code segment to get the information of a SATA's partition:

//SATA devices have MediaId = 0.
if (SataBlockIo != NULL && SataBlockIo->Media->MediaId == 0) {
   if (((HARDDRIVE_DEVICE_PATH*)TmpPath)->MBRType ==
MBR_TYPE_EFI_PARTITION_TABLE_HEADER &&
                ((HARDDRIVE_DEVICE_PATH*)TmpPath)->MBRType ==
SIGNATURE_TYPE_GUID) {

        INFO ("PartitionEndLBA: %lx\n",
((HARDDRIVE_DEVICE_PATH*)TmpPath)->PartitionSize +
((HARDDRIVE_DEVICE_PATH*)TmpPath)->PartitionStart - 1);
        INFO ("LastBlock: %lx\n", SataBlockIo->Media->LastBlock);
    }
}

But LastBlock (SataBlockIo->Media->LastBlock) is not equal to End LBA
(PartitionSize + PartitionStart - 1).
I want to read/write the "last block" of a partition. Should I use
LastBlock or End LBA?

Thanks,
Hien

=================
HCMUT
[email protected]
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to