Thanks Daryl for responding so promptly.  I'm trying to use just the 
standard C library for opening files so fopen /fclose etc. I used the 
MSVCRT lib for this.
Why do I need to add the DevShell to the libraryClasses ? 
I'm using the UDK2010 kit and I did see the ShellPkg contains File IO 
functions in it.  Can I not expect the standard FILE IO calls to work 
within the efi app  and do I specifically have to use the functions that 
are there in the ShellPkg? If that is the case , why is that?
I got the file open/close to work with just the fopen/fclose ( include 
stdio.h). 

Thanks




From:   "Mcdaniel, Daryl" <[email protected]>
To:     "[email protected]" 
<[email protected]>
Date:   09/04/2012 01:43 PM
Subject:        Re: [edk2] fOpen calls within an efi application fail or 
hang



Hello,
 
There are two possible causes for the behavior you are seeing.
1.       The file system driver is not loaded.  Please make sure that 
DevShell is listed in the [LibraryClasses] section of your application’s 
.inf file.
2.       The current working directory is not on the disk partition you 
are attempting to access.  When the Shell is first started, the current 
working directory (CWD), and partition, are NULL.  It is necessary to 
first change to the partition you wish to access before the CWD is 
defined.  If the Shell’s prompt is “Shell”, then the CWD hasn’t been set. 
If it is something like “fs0”, “f8” or some other name (as displayed by 
the map command) then the CWD has been set.
 
There are, of course, an extremely large number of other possible causes; 
though they are unlikely.  If one of the two remedies listed above don’t 
take care of the problem, I will need more detailed information.
 
Sincerely,
Daryl McDaniel
 
 
From: Bhavana Brar [mailto:[email protected]] 
Sent: Tuesday, September 04, 2012 8:48 AM
To: [email protected]
Subject: [edk2] fOpen calls within an efi application fail or hang
 
Hi, 
I've modified the HelloWorld application to use the standard file I/O 
calls ( fopen_s ) to read  an existing file ( "test.txt) and print out its 
contents. The txt file exists in the same partition and location as the 
HelloWorld .efi app ( \EFI|BOOT).  I added prints before and after the 
fopen call and I see the first print and then the application seems to 
hang. 
I'm using UDK2010 ( latest version) and VS2008 . 

My end goal is to be able to read/write some sort of a text file within an 
efi application  and then do some post processing etc. 
Any ideas or suggestions on whether this should work etc? 
Thanks 
Bhavana 
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to