Discussion:
[edk2] Filesystem support
Meenakshi Aggarwal
2015-06-16 09:09:33 UTC
Permalink
Hi All,


I want to boot linux and run SCT from SD card.

I have seen BeagleBoard package code which is booting linux from SD.

I got confused with entry:
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(B615F1F5-5088-43CD-809C-A16E52487D00)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/zImage"

from where are 0x3F and 0x19FC0 came. Is it some default value for start address and size?
Do I need to create an FV entry for this?

Also what all I need to include in my dsc and fdf file to enable support of filesystem. I can see following listed files for filesystem support (reference : BeagleBoard)

Changes in FDF:
#
# FAT filesystem + GPT/MBR partitioning
#
INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
INF FatBinPkg/EnhancedFatDxe/Fat.inf
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf

Changes in DSC
#
# FAT filesystem + GPT/MBR partitioning
#
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf




Thanks & regards
Meenakshi Aggarwal
Olivier Martin
2015-06-16 11:12:34 UTC
Permalink
UEFI specification says 'HD(Partition,Type,Signature,Start, Size)'.
These values are specific to you partition table.

gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath is specific to the ARM BDS. It is to create a default boot entry when you start your system for a first time.
It is not (necessary) relevant to boot Linux or run SCT on your platform.

I would say you have the appropriate list of EFI modules to get FAT support (if you already have SD support in your UEFI firmware).


From: Meenakshi Aggarwal [mailto:***@freescale.com]
Sent: 16 June 2015 10:10
To: edk2-***@lists.sourceforge.net
Subject: [edk2] Filesystem support

Hi All,


I want to boot linux and run SCT from SD card.

I have seen BeagleBoard package code which is booting linux from SD.

I got confused with entry:
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(B615F1F5-5088-43CD-809C-A16E52487D00)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/zImage"

from where are 0x3F and 0x19FC0 came. Is it some default value for start address and size?
Do I need to create an FV entry for this?


Also what all I need to include in my dsc and fdf file to enable support of filesystem. I can see following listed files for filesystem support (reference : BeagleBoard)

Changes in FDF:
#
# FAT filesystem + GPT/MBR partitioning
#
INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
INF FatBinPkg/EnhancedFatDxe/Fat.inf
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf

Changes in DSC
#
# FAT filesystem + GPT/MBR partitioning
#
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf




Thanks & regards
Meenakshi Aggarwal


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
Meenakshi Aggarwal
2015-07-15 13:29:48 UTC
Permalink
Hi,



I need your help in running SCT from SD card on Freescale SoC.





I have built SCT and copied following images on SD card (formatted with FAT32), inserted this SD card in my board:



1.EdkShellBinPkg/FullShell/Arm/Shell_Full.efi

2.Build/UefiSct/DEBUG_ARMGCC/SctPackageAARCH64/AARCH64/*







On running shell I saw following entry:

UEFI Interactive Shell v2.1

EDK II

UEFI v2.40 (LS1043a Simulator EFI Jul 15 2015 16:55:13, 0x00000000)

Mapping table

FS0: Alias(s):HD0mohuqyt:;BLK0:

HD(-1225503552,175,0,0x20021BE11DF9E45,0xAFAFAFAF1BC5D5A5)





I am not getting from where it is populating these values of HD().





Now on selecting FS0, I saw following prints:

Shell> fs0:

FS0:\> ls

Get RTC Year: 15 Mon: 07 Day: 15 Hour: 17 Min: 24 Sec: 59

Get DATE: 2015-07-15 TIME: 17:24:59

FSOpen: Open '.' Success

File Not Found

FS0:\>





My UEFI binary has support of SD card, I can probe a card and its read, write and erase functionalities are working fine.

I want to execute SCT.efi using shell. Kindly help me with this


Along with the above issue, I am seeing following failures in OpenVolume() call:

FATDirSize: cluster chain corrupt
*OutputFileName 0x61
*OutputFileName 0x62
*OutputFileName 0x63
FatGrowEof: cluster chain corrupt
FatShrinkEof: cluster chain corrupt


What is the reason behind these prints?


Regards
Meenakshi

From: Olivier Martin [mailto:***@arm.com]
Sent: Tuesday, June 16, 2015 4:43 PM
To: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] Filesystem support

UEFI specification says 'HD(Partition,Type,Signature,Start, Size)'.
These values are specific to you partition table.

gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath is specific to the ARM BDS. It is to create a default boot entry when you start your system for a first time.
It is not (necessary) relevant to boot Linux or run SCT on your platform.

I would say you have the appropriate list of EFI modules to get FAT support (if you already have SD support in your UEFI firmware).


From: Meenakshi Aggarwal [mailto:***@freescale.com]
Sent: 16 June 2015 10:10
To: edk2-***@lists.sourceforge.net<mailto:edk2-***@lists.sourceforge.net>
Subject: [edk2] Filesystem support

Hi All,


I want to boot linux and run SCT from SD card.

I have seen BeagleBoard package code which is booting linux from SD.

I got confused with entry:
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(B615F1F5-5088-43CD-809C-A16E52487D00)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/zImage"

from where are 0x3F and 0x19FC0 came. Is it some default value for start address and size?
Do I need to create an FV entry for this?


Also what all I need to include in my dsc and fdf file to enable support of filesystem. I can see following listed files for filesystem support (reference : BeagleBoard)

Changes in FDF:
#
# FAT filesystem + GPT/MBR partitioning
#
INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
INF FatBinPkg/EnhancedFatDxe/Fat.inf
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf

Changes in DSC
#
# FAT filesystem + GPT/MBR partitioning
#
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf




Thanks & regards
Meenakshi Aggarwal


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
Andrew Fish
2015-07-15 14:02:54 UTC
Permalink
Post by Meenakshi Aggarwal
Hi,
I need your help in running SCT from SD card on Freescale SoC.
1.EdkShellBinPkg/FullShell/Arm/Shell_Full.efi
2.Build/UefiSct/DEBUG_ARMGCC/SctPackageAARCH64/AARCH64/*
UEFI Interactive Shell v2.1
EDK II
UEFI v2.40 (LS1043a Simulator EFI Jul 15 2015 16:55:13, 0x00000000)
Mapping table
HD(-1225503552,175,0,0x20021BE11DF9E45,0xAFAFAFAF1BC5D5A5)
It is the hard drive device path. The UEFI spec defines these device path display formats in the “EFI Device Path Display Format Overview” section.

HD(Partition,Type,Signature,Start, Size)
HD(Partition,Type,Signature) (Display Only)

The Partition is an integer representing the partition number. It is optional and the default is 0. If Partition is 0, then Start and Size are prohibited.
The Type is an integer between 0-255 or else the keyword MBR (1) or GPT (2). The type is optional and the default is 2.
The Signature is an integer if Type is 1 or else GUID if Type is 2. The signature is required.
The Start is a 64-bit unsigned integer. It is prohibited if Partition is 0. Otherwise it is required.
The Size is a 64-bit unsigned integer. It is prohibited if Partition is 0. Otherwise it is required.

The SD spec defines the format to be an MBR partition with a single entry, that is formatted FAT32. SD XC is MBR formatted with exFAT :(.

The partition driver should not bind to a malformed MBR (it produced the device path), so maybe this is memory corruption?
https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg/Universal/Disk/PartitionDxe/ <https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg/Universal/Disk/PartitionDxe/>

This is the binary data structure being converted to text:
https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Protocol/DevicePath.h <https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Protocol/DevicePath.h>
///
/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
///
typedef struct {
EFI_DEVICE_PATH_PROTOCOL Header;
///
/// Describes the entry in a partition table, starting with entry 1.
/// Partition number zero represents the entire device. Valid
/// partition numbers for a MBR partition are [1, 4]. Valid
/// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].
///
UINT32 PartitionNumber;
///
/// Starting LBA of the partition on the hard drive.
///
UINT64 PartitionStart;
///
/// Size of the partition in units of Logical Blocks.
///
UINT64 PartitionSize;
///
/// Signature unique to this partition:
/// If SignatureType is 0, this field has to be initialized with 16 zeros.
/// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.
/// The other 12 bytes are initialized with zeros.
/// If SignatureType is 2, this field contains a 16 byte signature.
///
UINT8 Signature[16];
///
/// Partition Format: (Unused values reserved).
/// 0x01 - PC-AT compatible legacy MBR.
/// 0x02 - GUID Partition Table.
///
UINT8 MBRType;
///
/// Type of Disk Signature: (Unused values reserved).
/// 0x00 - No Disk Signature.
/// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
/// 0x02 - GUID signature.
///
UINT8 SignatureType;
} HARDDRIVE_DEVICE_PATH;

#define MBR_TYPE_PCAT 0x01
#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02

#define NO_DISK_SIGNATURE 0x00
#define SIGNATURE_TYPE_MBR 0x01
#define SIGNATURE_TYPE_GUID 0x02
Thanks,

Andrew Fish
Post by Meenakshi Aggarwal
I am not getting from where it is populating these values of HD().
FS0:\> ls
Get RTC Year: 15 Mon: 07 Day: 15 Hour: 17 Min: 24 Sec: 59
Get DATE: 2015-07-15 TIME: 17:24:59
FSOpen: Open '.' Success
File Not Found
FS0:\>
My UEFI binary has support of SD card, I can probe a card and its read, write and erase functionalities are working fine.
I want to execute SCT.efi using shell. Kindly help me with this
FATDirSize: cluster chain corrupt
*OutputFileName 0x61
*OutputFileName 0x62
*OutputFileName 0x63
FatGrowEof: cluster chain corrupt
FatShrinkEof: cluster chain corrupt
What is the reason behind these prints?
Regards
Meenakshi
Sent: Tuesday, June 16, 2015 4:43 PM
Subject: Re: [edk2] Filesystem support
UEFI specification says ‘HD(Partition,Type,Signature,Start, Size)’.
These values are specific to you partition table.
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath is specific to the ARM BDS. It is to create a default boot entry when you start your system for a first time.
It is not (necessary) relevant to boot Linux or run SCT on your platform.
I would say you have the appropriate list of EFI modules to get FAT support (if you already have SD support in your UEFI firmware).
Sent: 16 June 2015 10:10
Subject: [edk2] Filesystem support
Hi All,
I want to boot linux and run SCT from SD card.
I have seen BeagleBoard package code which is booting linux from SD.
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(B615F1F5-5088-43CD-809C-A16E52487D00)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/zImage"
from where are 0x3F and 0x19FC0 came. Is it some default value for start address and size?
Do I need to create an FV entry for this?
Also what all I need to include in my dsc and fdf file to enable support of filesystem. I can see following listed files for filesystem support (reference : BeagleBoard)
#
# FAT filesystem + GPT/MBR partitioning
#
INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
INF FatBinPkg/EnhancedFatDxe/Fat.inf
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
Changes in DSC
#
# FAT filesystem + GPT/MBR partitioning
#
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
Thanks & regards
Meenakshi Aggarwal
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/_______________________________________________ <https://www.gigenetcloud.com/_______________________________________________>
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel <https://lists.sourceforge.net/lists/listinfo/edk2-devel>
Continue reading on narkive:
Loading...