How is data stored on disk? - EFI GUID

ε祈祈猫儿з 提交于 2019-12-02 05:04:24

问题


I posted this question earlier on SuperUser but I feel it is more suited for programmers.

If I understand correctly, according to GPT, the first 16 bytes of LBA 2 is the partition type GUID for the first partition on disk. In Windows Disk Management the first partition is designated as an EFI System Partition. However upon further investigation an EFI System Partition's GUID is:

C12A7328-F81F-11D2-BA4B-00A0C93EC93B

And yet the first 16 bytes tell me otherwise:

28732AC1-1FF8-D211-BA4B-00A0C93EC93B

Interestingly the first 3 sections act as little endian while the other 2 are big endian.

Why is this the case?


回答1:


EFI_GUID datatype is declared as follows:

typedef struct {
  UINT32  Data1;
  UINT16  Data2;
  UINT16  Data3;
  UINT8   Data4[8];
} EFI_GUID;

Because original EFI architectures (IA64 LE and IA32e) were little-endian by default, so are the integers. I haven't really seen an UEFI implementation on big-endian machine, so I don't know if standard GUIDs will be stored otherwise.



来源:https://stackoverflow.com/questions/36872321/how-is-data-stored-on-disk-efi-guid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!