Content-Type: multipart/alternative; boundary="_000_CB6E33457884FA40993F35157061515C028DAAFMSMSX101amrcorpi_" --_000_CB6E33457884FA40993F35157061515C028DAAFMSMSX101amrcorpi_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Do these changes properly fix the issue for you? -Jaben From: winddy_zhang [mailto:winddy_zhang@byosoft.com.cn] Sent: Monday, January 30, 2012 6:49 PM To: Carsey, Jaben; edk2-devel Cc: Carsey, Jaben Subject: RE: [edk2] Report a bug in UDKShell command "ls" with ramdisk Importance: High Hi Jaben, (1) I am sorry, after rechecking, I find the change of Info->Size from 0 to= random is at CreateAndPopulateShellFileInfo(). At this function, Input parameter Info->Size still keeps as ZERO, but when= we use it for AllocateZeroPool()'s paramter, internal ZeroMem() will do no= thing, this cause ShellFileListItem->Info->Size be random. And allocate zer= o size pool also seems as a problem. So to check return BufferSize of ReadFile() in FileHandleFindFirstFile() is= still necessary. ShellFileListItem->Info =3D AllocateZeroPool((UINTN)Info->Size); = // <--- bad parameter Size. (2) You mean changes in PrintLsOutput()? I think if root folder is empty, this is not a Device Error, so we ju= st report user "STR_GEN_NO_FILES" instead of "STR_GEN_PARAM_INV". thanks. ________________________________ winddy_zhang From: Carsey, Jaben Date: 2012-01-31 02:12 To: winddy_zhang; edk2-devel@lists.sour= ceforge.net CC: Carsey, Jaben Subject: RE: [edk2] Report a bug in UDKShell command "ls" with ramdisk I have a few questions. 1. Buffer is allocated via AllocateZeroPool. What function is changi= ng the value of the struct? Is the read changing the value and then return= ing 0 size? It is not really uninitialized... 2. What does ths LS error code have to do with this first change? -Jaben From: winddy_zhang [mailto:winddy_zhang@byosoft.com.cn] Sent: Saturday, January 28, 2012 6:10 PM To: edk2-devel Subject: [edk2] Report a bug in UDKShell command "ls" with ramdisk dear Experts, I just want to report a bug in udk shell command "ls". First, I switch to ramdisk's file system(FAT16), then, at root directo= ry, run build-in command "ls", then it will assert and exit. After trace, I find the root cause is: there is no file in ramdisk's ro= ot dir("." and ".." also do not exist). And in function FileHandleFindFirst= File(), even if return status of reading file is SUCCESS, BufferSize is ZER= O. So at that time, File info pointer "Buffer" is just like a "wild pointer= ", Buffer->Size may be very big and it cause another function allocate memo= ry for FileInfo failed, then assert will be active. My suggested solution: Add returned BufferSize check when return statu= s is EFI_SUCCESS. The sample code is as below: And PrintLsOutput() maybe needs be updated also as below: thanks. EFI_STATUS EFIAPI FileHandleFindFirstFile ( // ShellPkg\Li= brary\UefiFileHandleLib\UefiFileHandleLib.c IN EFI_FILE_HANDLE DirHandle, OUT EFI_FILE_INFO **Buffer ) { ... // // read in the info about the first file // Status =3D FileHandleRead (DirHandle, &BufferSize, *Buffer); ASSERT(Status !=3D EFI_BUFFER_TOO_SMALL); if(EFI_ERROR(Status) || BufferSize=3D=3D0){ = // wztest - FreePool(*Buffer); *Buffer =3D NULL; if(!EFI_ERROR(Status)){ = // wztest + Status =3D EFI_NOT_FOUND; = // wztest + } = // wztest + return (Status); } return (EFI_SUCCESS); } SHELL_STATUS EFIAPI PrintLsOutput( // ShellPkg\Library\UefiShellLeve= l2CommandsLib\Ls.c IN CONST BOOLEAN Rec, IN CONST UINT64 Attribs, IN CONST BOOLEAN Sfo, IN CONST CHAR16 *Path, IN CONST BOOLEAN First, IN CONST UINTN Count, IN CONST INT16 TimeZone ) { ... Status =3D ShellOpenFileMetaArg((CHAR16*)CorrectedPath, EFI_FILE_MODE_REA= D, &ListHead); if(EFI_ERROR(Status)){ //- return (SHELL_DEVICE_ERROR); // wztest - ShellStatus =3D SHELL_DEVICE_ERROR; // wztest + if(Status =3D=3D EFI_NOT_FOUND){ // wztest + ShellStatus =3D SHELL_NOT_FOUND; // wztest + } = // wztest + return ShellStatus; // w= ztest + } } ________________________________ winddy_zhang From: edk2-devel-request Date: 2012-01-27 06:18 To: edk2-devel Subject: edk2-devel Digest, Vol 25, Issue 96 Send edk2-devel mailing list submissions to edk2-devel@lists.sourceforge.net To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/edk2-devel or, via email, send a message with subject or body 'help' to edk2-devel-request@lists.sourceforge.net You can reach the person managing the list at edk2-devel-owner@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of edk2-devel digest..." Today's Topics: 1. Adding EFI_SECTION directly to ffs (Justin Johnson) 2. error building StdLib with GCC44 (Duane Voth) 3. Re: error building StdLib with GCC44 (Olivier Martin) 4. [PATCH] MdeModulePkg/Dxe: Fixed the function FindFreePages() when a free region is found at 0x0 (Olivier Martin) ---------------------------------------------------------------------- Message: 1 Date: Thu, 26 Jan 2012 20:22:13 +0000 From: Justin Johnson Subject: [edk2] Adding EFI_SECTION directly to ffs To: "edk2-devel@lists.sourceforge.net" Message-ID: Content-Type: text/plain; charset=3D"us-ascii" Hi, I have a tool which builds a section file, of type EFI_SECTION_FREEFORM_SUB= TYPE_GUID. That is, the binary file already has the section header prepende= d. What needs to be entered in the FDF so that GenSec is not run on this bi= nary file. It should just be included as an input to GenFfs. I have tried both: RAW SEC_BIN Optional $(INF_OUTPUT)/$(MODULE_NAME).sec RAW BIN Optional $(INF_OUTPUT)/$(MODULE_NAME).sec But both entries will still cause GenSec to be run on $(MODULE_NAME).sec. -- Justin Johnson Associate BIOS Engineer American Megatrends, Inc. The information contained in this message may be confidential and proprieta= ry to American Megatrends, Inc. This communication is intended to be read = only by the individual or entity to whom it is addressed or by their design= ee. If the reader of this message is not the intended recipient, you are on= notice that any distribution of this message, in any form, is strictly pro= hibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission= . -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 2 Date: Thu, 26 Jan 2012 14:44:10 -0600 From: Duane Voth Subject: [edk2] error building StdLib with GCC44 To: edk2-devel@lists.sourceforge.net Message-ID: Content-Type: text/plain; charset=3DISO-8859-1 Just tried to build StdLib with GCC44 and found this: /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:1250: error: ?va_start? used in function with fixed args It doesn't appear that utimes() needs varargs - does no other compiler catch this? ----------------- build stdout ---------------- [duanev edk2]$ build -p StdLib/StdLib.dsc Build environment: Linux-2.6.33.7-server-2mnb-x86_64-with-mandrake-2010.2-Official Build start time: 14:39:47, Jan.26 2012 WORKSPACE =3D /home/duanev/efi/edk2/svn64/edk2 ECP_SOURCE =3D /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg EDK_SOURCE =3D /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg EFI_SOURCE =3D /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg EDK_TOOLS_PATH =3D /home/duanev/efi/edk2/svn64/edk2/BaseTools Architecture(s) =3D X64 Build target =3D DEBUG Toolchain =3D GCC44 Active Platform =3D /home/duanev/efi/edk2/svn64/edk2/StdLib/StdLib= .dsc Processing meta-data . done! Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/LibC.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/StdLib/StdLib.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/String/String.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Wchar/Wchar.inf [= X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Ctype/Ctype.inf [= X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Time/Time.inf [X6= 4] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Stdio/Stdio.inf [= X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Locale/Locale.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/Uefi.inf [X6= 4] "/usr/bin/gcc" -g -fshort-wchar -fno-stack-protector -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=3DLibUefiStrings -m64 "-DEFIAPI=3D__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=3Dlarge -nostdinc -nostdlib -o /home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64/StdLib/LibC/U= efi/Uefi/OUTPUT/./SysCalls.obj -I/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi -I/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64/StdLib/LibC= /Uefi/Uefi/DEBUG -I/home/duanev/efi/edk2/svn64/edk2/StdLib -I/home/duanev/efi/edk2/svn64/edk2/StdLib/Include -I/home/duanev/efi/edk2/svn64/edk2/StdLib/Include/X64 -I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles -I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles/Include -I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles/Include/X64 -I/home/duanev/efi/edk2/svn64/edk2/MdePkg -I/home/duanev/efi/edk2/svn64/edk2/MdePkg/Include -I/home/duanev/efi/edk2/svn64/edk2/MdePkg/Include/X64 -I/home/duanev/efi/edk2/svn64/edk2/ShellPkg -I/home/duanev/efi/edk2/svn64/edk2/ShellPkg/Include /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c: In function ?utimes?: /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:1250: error: ?va_start? used in function with fixed args make: *** [/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64/St= dLib/LibC/Uefi/Uefi/OUTPUT/SysCalls.obj] Error 1 build.py... : error 7000: Failed to execute command make tbuild [/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64/StdLib/LibC/= Uefi/Uefi] build.py... : error F002: Failed to build module /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/Uefi.inf [X64, GCC44, DEBUG] - Failed - Build end time: 14:39:50, Jan.26 2012 Build total time: 00:00:03 ------------------------------ Message: 3 Date: Thu, 26 Jan 2012 21:06:32 -0000 From: "Olivier Martin" Subject: Re: [edk2] error building StdLib with GCC44 To: Message-ID: <000a01ccdc6e$6194d980$24be8c80$@martin@arm.com> Content-Type: text/plain; charset=3D"windows-1252" Hi Duane, I had a similar build issue this week. I fixed it by creating a function va_utimes(const char *path, ...) and making utimes() calls this function. I= t fixed the build but I did not have the opportunity to check if it was running correctly. See attached patch. Regards, Olivier -----Original Message----- From: Duane Voth [mailto:duanev@gmail.com] Sent: 26 January 2012 20:44 To: edk2-devel@lists.sourceforge.net Subject: [edk2] error building StdLib with GCC44 Just tried to build StdLib with GCC44 and found this: /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:1250: error: ?va_start? used in function with fixed args It doesn't appear that utimes() needs varargs - does no other compiler catch this? ----------------- build stdout ---------------- [duanev edk2]$ build -p StdLib/StdLib.dsc Build environment: Linux-2.6.33.7-server-2mnb-x86_64-with-mandrake-2010.2-Official Build start time: 14:39:47, Jan.26 2012 WORKSPACE =3D /home/duanev/efi/edk2/svn64/edk2 ECP_SOURCE =3D /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg EDK_SOURCE =3D /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg EFI_SOURCE =3D /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg EDK_TOOLS_PATH =3D /home/duanev/efi/edk2/svn64/edk2/BaseTools Architecture(s) =3D X64 Build target =3D DEBUG Toolchain =3D GCC44 Active Platform =3D /home/duanev/efi/edk2/svn64/edk2/StdLib/StdLib.dsc Processing meta-data . done! Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/LibC.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/StdLib/StdLib.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/String/String.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Wchar/Wchar.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Ctype/Ctype.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Time/Time.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Stdio/Stdio.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Locale/Locale.inf [X64] make: Nothing to be done for `tbuild'. Building ... /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/Uefi.inf [X64] "/usr/bin/gcc" -g -fshort-wchar -fno-stack-protector -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=3DLibUefiStrings -m64 "-DEFIAPI=3D__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=3Dlarge -nostdinc -nostdlib -o /home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64/StdLib/LibC/U= e fi/Uefi/OUTPUT/./SysCalls.obj -I/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi -I/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64/StdLib/LibC= / Uefi/Uefi/DEBUG -I/home/duanev/efi/edk2/svn64/edk2/StdLib -I/home/duanev/efi/edk2/svn64/edk2/StdLib/Include -I/home/duanev/efi/edk2/svn64/edk2/StdLib/Include/X64 -I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles -I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles/Include -I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles/Include/X64 -I/home/duanev/efi/edk2/svn64/edk2/MdePkg -I/home/duanev/efi/edk2/svn64/edk2/MdePkg/Include -I/home/duanev/efi/edk2/svn64/edk2/MdePkg/Include/X64 -I/home/duanev/efi/edk2/svn64/edk2/ShellPkg -I/home/duanev/efi/edk2/svn64/edk2/ShellPkg/Include /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c: In function ?utimes?: /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:1250: error: ?va_start? used in function with fixed args make: *** [/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64/StdLib/LibC/= U efi/Uefi/OUTPUT/SysCalls.obj] Error 1 build.py... : error 7000: Failed to execute command make tbuild [/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64/StdLib/LibC/= U efi/Uefi] build.py... : error F002: Failed to build module /home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/Uefi.inf [X64, GCC44, DEBUG] - Failed - Build end time: 14:39:50, Jan.26 2012 Build total time: 00:00:03 ---------------------------------------------------------------------------= - -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-StdLib-SysCalls-Fix-GCC44-build-issue.patch Type: application/octet-stream Size: 1135 bytes Desc: not available ------------------------------ Message: 4 Date: Thu, 26 Jan 2012 22:18:17 -0000 From: "Olivier Martin" Subject: [edk2] [PATCH] MdeModulePkg/Dxe: Fixed the function FindFreePages() when a free region is found at 0x0 To: "Sun, Rui" Cc: edk2-devel@lists.sourceforge.net Message-ID: <000e01ccdc78$69a94930$3cfbdb90$@martin@arm.com> Content-Type: text/plain; charset=3D"windows-1252" Dear EDK2 community and MdeModulePkg maintainer, Please find the attached patch to fix FindFreePages() when a free region is found at 0x0. FindFreePages() is returning 0x0 when no free region was found. But it could be possible the region at 0x0 might be the only possible regio= n returned by FindFreePages() on platforms with system memory that starts at 0x0. In this case, it should be possible to make the difference between the region 0x0 and the 'not found' error. The direct and indirect callers of FindFreePages() have also be modified to handle the change. Bets Regards, Olivier -------------- next part -------------- An HTML attachment was scrubbed... -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-MdeModulePkg-Dxe-Fixed-the-function-FindFreePages.patch Type: application/octet-stream Size: 9722 bytes Desc: not available ------------------------------ ---------------------------------------------------------------------------= --- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ------------------------------ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel End of edk2-devel Digest, Vol 25, Issue 96 ****************************************** --_000_CB6E33457884FA40993F35157061515C028DAAFMSMSX101amrcorpi_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Do these changes properly= fix the issue for you?

 <= /p>

-Jaben<= /p>

 <= /p>

From: winddy_zhang [mailto:winddy_zhang@byosof= t.com.cn]
Sent: Monday, January 30, 2012 6:49 PM
To: Carsey, Jaben; edk2-devel
Cc: Carsey, Jaben
Subject: RE: [edk2] Report a bug in UDKShell command "ls" = with ramdisk
Importance: High

 

Hi Jaben,=

(1) I am sorry, after rechecking, I find the change of Info->Size from 0 to random is at CreateAndPopulateShellFileInfo().

At this function, Input parameter Info->Size  still keeps as = ZERO, but when we use it for AllocateZeroPool()'s paramter, inte= rnal ZeroMem() will do nothing, this cause ShellFileListItem->Info->Size be random.= And allocate zero size pool also seems as a problem.=

So to check return BufferSize of ReadFile() in FileHandleFindFirstFile() is still necessary.

&= nbsp;

ShellFileListItem->Info =3D AllocateZeroPool((UINT= N)Info->Size);          = ;           /= / <--- bad parameter Size.

 

 &nbs= p;    (2) You mean changes in PrintLsOutput()?

      I think if root folder is empt= y, this is not a Device Error, so we just report user "STR_GEN_NO_FILE= S" instead of "STR_GEN_PARAM_INV".

 

 &nbs= p;  thanks.

 

 


winddy_zh= ang

 

From: Carsey, Jaben=

Date: 20= 12-01-31 02:12

Subject: = RE: [edk2] Report a bug in UDKShell command "ls" with ramdisk

I have a few questions.

1.  &= nbsp;    Buffer is allocat= ed via AllocateZeroPool.  What function is changing the value of the s= truct?  Is the read changing the value and then returning 0 size?  It is not really uninitialized…

2.  &= nbsp;    What does ths LS = error code have to do with this first change?

-Jaben<= /p>

 <= /p>

From: winddy_zhang [mailto:winddy_zhang@byosof= t.com.cn]
Sent: Saturday, January 28, 2012 6:10 PM
To: edk2-devel
Subject: [edk2] Report a bug in UDKShell command "ls" with= ramdisk

 

dear Experts,

    I just want to report a bug in udk shell c= ommand "ls".

    First, I switch to ramdisk's file system(F= AT16),  then, at root directory, run build-in command "ls", = then it will assert and exit.

    After trace, I find the root cause is: the= re is no file in ramdisk's root dir("." and ".." also d= o not exist). And in function FileHandleFindFirstFile(), even if return status of reading fi= le is SUCCESS, BufferSize is ZERO. So at that time, File info pointer "= ;Buffer" is just like a "wild pointer", Buffer->Size may = be very big and it cause another function allocate memory for FileInfo failed, then assert will be active.

    My suggested solution:  Add returned = BufferSize check when return status is EFI_SUCCESS. The sample code is as b= elow:

    And PrintLsOutput() maybe needs be updated= also as below:

    thanks.

 

 

EFI_STATUS

EFIAPI

FileHandleFindFirstFile (     &= nbsp;           &nbs= p;            &= nbsp;     // ShellPkg\Library\UefiFileHandleLib\Ue= fiFileHandleLib.c

  IN EFI_FILE_HANDLE    &n= bsp;       DirHandle,<= /p>

  OUT EFI_FILE_INFO    &nb= sp;        **Buffer

  )

{

  ...

  //

  // read in the info abou= t the first file

  //

  Status =3D FileHandleRead (DirHand= le, &BufferSize, *Buffer);

  ASSERT(Status !=3D EFI_BUFFER_TOO_SMALL= );

  if(EFI_ERROR(Status) || BufferSize=3D= =3D0){           &nb= sp;            =             // = wztest -

    FreePool(*Buffer);<= /p>

    *Buffer =3D NULL;

    if(!EFI_ERROR(Status)){  &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;       // wztest +

      Status =3D EFI_= NOT_FOUND;           = ;            &n= bsp;            = ;            &n= bsp;    // wztest +

    }      =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;  // wztest +

    return (Status);

  }

  return (EFI_SUCCESS);

}

 

 

SHELL_STATUS

EFIAPI

PrintLsOutput(        = ;            &n= bsp;       // ShellPkg\Library\UefiShell= Level2CommandsLib\Ls.c

  IN CONST BOOLEAN Rec,

  IN CONST UINT64  Attribs,

  IN CONST BOOLEAN Sfo,

  IN CONST CHAR16  *Path,<= /o:p>

  IN CONST BOOLEAN First,=

  IN CONST UINTN   Count,<= o:p>

  IN CONST INT16   TimeZon= e

  )

{

    ...

  Status =3D ShellOpenFileMetaArg((CHAR16= *)CorrectedPath, EFI_FILE_MODE_READ, &ListHead);

  if(EFI_ERROR(Status)){

//-    return (SHELL_DEVICE_ERROR);&= nbsp;           &nbs= p;        // wztest -

    ShellStatus =3D SHELL_DEVIC= E_ERROR;           &= nbsp;    // wztest +

    if(Status =3D=3D EFI_NOT_FO= UND){           &nbs= p;            &= nbsp;   // wztest +

      ShellStatus =3D = ;SHELL_NOT_FOUND;         &nbs= p;          // wztest = 3;

    }      =             &nb= sp;            =             &nb= sp;            =             &nb= sp;      // wztest +

    return ShellStatus;  &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;        // wztest +

  }

}

 

 

 

 


winddy_zhang

 

Date: 2012= -01-27 06:18

Subject: e= dk2-devel Digest, Vol 25, Issue 96

Send edk2-devel mailing list submissions&= nbsp;to

edk2-devel@lists.sourceforge.net

 

To subscribe or unsubscribe via the&= nbsp;World Wide Web, visit

https://lists.sourceforge.net/lists/listinfo/edk2-devel<= /o:p>

or, via email, send a message w= ith subject or body 'help' to

edk2-devel-request@lists.sourceforge.net

 

You can reach the person managing&nb= sp;the list at

edk2-devel-owner@lists.sourceforge.net

 

When replying, please edit your Subj= ect line so it is more specific

than "Re: Contents of edk2-devel&nbs= p;digest..."

 

 

Today's Topics:

 

   1. Adding EFI_SECTION direct= ly to ffs (Justin Johnson)

   2. error building StdLib&nbs= p;with GCC44 (Duane Voth)

   3. Re: error building S= tdLib with GCC44 (Olivier Martin)

   4. [PATCH] MdeModulePkg/Dxe: = ;Fixed the function FindFreePages()

      when a free&nbs= p;region is found at 0x0 (Olivier Martin)

 

 

-------------------------------------------------------------= ---------

 

Message: 1

Date: Thu, 26 Jan 2012 20:22:13 = ;+0000

From: Justin Johnson <justinj@ami.com>

Subject: [edk2] Adding EFI_SECTION direct= ly to ffs

To: "edk2-devel@lists.sourceforge.net"

<edk2-devel@lists.sourceforge.net>

Message-ID:

<A9FBE64B0AF8BD4FB56BC85E566A0A491B5CDA85@atlms1.us.megatr= ends.com>

Content-Type: text/plain; charset=3D"us-ascii&= quot;

 

Hi,

I have a tool which builds a&nb= sp;section file, of type EFI_SECTION_FREEFORM_SUBTYPE_G= UID. That is, the binary file already ha= s the section header prepended. What needs&nb= sp;to be entered in the FDF so that = ;GenSec is not run on this binary file.&= nbsp;It should just be included as an in= put to GenFfs.

 

 

I have tried both:

RAW       SEC_BIN &nb= sp;            =    Optional $(INF_OUTPUT)/$(MODULE_NAME).sec=

 

RAW       BIN  &= nbsp;           &nbs= p;      Optional $(INF_OUTPUT)/$(MODULE_= NAME).sec

 

But both entries will still cause&nb= sp;GenSec to be run on $(MODULE_NAME).sec.

 

--

Justin Johnson

Associate BIOS Engineer

American Megatrends, Inc.

 

 

The information contained in this me= ssage may be confidential and proprietary to&= nbsp;American Megatrends, Inc.  This communication=  is intended to be read only by the=  individual or entity to whom it is = ;addressed or by their designee. If the = reader of this message is not the intend= ed recipient, you are on notice that any=  distribution of this message, in any fo= rm, is strictly prohibited.  Please promptly&= nbsp;notify the sender by reply e-mail or&nbs= p;by telephone at 770-246-8600, and then dele= te or destroy all copies of the transmis= sion.

 

-------------- next part --------------

An HTML attachment was scrubbed...

 

------------------------------

 

Message: 2

Date: Thu, 26 Jan 2012 14:44:10 = ;-0600

From: Duane Voth <duanev@gmail.com>=

Subject: [edk2] error building StdLib&nbs= p;with GCC44

To: edk2-devel@lists.sourceforge.net

Message-ID:

<CABpPS=3DpZenAOw-Dda-qBDRmPA9QHSef66ToWF1BwsaNT3peU4w@mai= l.gmail.com>

Content-Type: text/plain; charset=3DISO-8859-1=

 

Just tried to build StdLib with = ;GCC44 and found this:

 

/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:= 1250:

error: ?va_start? used in function w= ith fixed args

 

It doesn't appear that utimes() need= s varargs - does no other compiler=

catch this?

 

----------------- build stdout ---------------= -

 

[duanev edk2]$ build -p StdLib/StdLib.dsc=

Build environment:

Linux-2.6.33.7-server-2mnb-x86_64-with-mandrake-2010.2-Offici= al

Build start time: 14:39:47, Jan.26 2= 012

 

WORKSPACE        =3D&= nbsp;/home/duanev/efi/edk2/svn64/edk2

ECP_SOURCE       =3D = /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg

EDK_SOURCE       =3D = /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg

EFI_SOURCE       =3D = /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg

EDK_TOOLS_PATH   =3D /home/duanev/efi/edk= 2/svn64/edk2/BaseTools

 

 

Architecture(s)  =3D X64

Build target     =3D DEBUG=

Toolchain        =3D&= nbsp;GCC44

 

Active Platform       = ;   =3D /home/duanev/efi/edk2/svn64/edk2/StdLib/StdLib.= dsc

 

Processing meta-data . done!=

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/LibC.inf [X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/StdLib/StdLib.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/String/String.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Wchar/Wchar.inf [X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Ctype/Ctype.inf [X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Time/Time.inf [X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Stdio/Stdio.inf [X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Locale/Locale.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Uefi/Uefi.inf [X64]

"/usr/bin/gcc" -g -fshort-wchar -fno= -stack-protector

-fno-strict-aliasing -Wall -Werror -Wno-missin= g-braces

-Wno-array-bounds -ffunction-sections -fdata-sectio= ns -c -include

AutoGen.h -DSTRING_ARRAY_NAME=3DLibUefiStrings -m64=

"-DEFIAPI=3D__attribute__((ms_abi))" -DNO_BUIL= TIN_VA_FUNCS -mno-red-zone

-Wno-address -mcmodel=3Dlarge -nostdinc -nostd= lib -o

/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64= /StdLib/LibC/Uefi/Uefi/OUTPUT/./SysCalls.obj

-I/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi

-I/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X= 64/StdLib/LibC/Uefi/Uefi/DEBUG

-I/home/duanev/efi/edk2/svn64/edk2/StdLib

-I/home/duanev/efi/edk2/svn64/edk2/StdLib/Include<= /span>

-I/home/duanev/efi/edk2/svn64/edk2/StdLib/Include/X64

-I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles=

-I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles= /Include

-I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles= /Include/X64

-I/home/duanev/efi/edk2/svn64/edk2/MdePkg

-I/home/duanev/efi/edk2/svn64/edk2/MdePkg/Include<= /span>

-I/home/duanev/efi/edk2/svn64/edk2/MdePkg/Include/X64

-I/home/duanev/efi/edk2/svn64/edk2/ShellPkg=

-I/home/duanev/efi/edk2/svn64/edk2/ShellPkg/Include

/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c<= o:p>

/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:=  In

function ?utimes?:

/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:= 1250:

error: ?va_start? used in function w= ith fixed args

make: *** [/home/duanev/efi/edk2/svn64/edk2/Build/S= tdLib/DEBUG_GCC44/X64/StdLib/LibC/Uefi/Uefi/OUTPUT/SysCalls.obj]=

Error 1

 

 

build.py...

 : error 7000: Failed to execut= e command

        make tbu= ild

[/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X6= 4/StdLib/LibC/Uefi/Uefi]

 

 

build.py...

 : error F002: Failed to build&= nbsp;module

        /home/duanev/= efi/edk2/svn64/edk2/StdLib/LibC/Uefi/Uefi.inf

[X64, GCC44, DEBUG]

 

- Failed -

Build end time: 14:39:50, Jan.26 201= 2

Build total time: 00:00:03

 

 

 

------------------------------

 

Message: 3

Date: Thu, 26 Jan 2012 21:06:32 = ;-0000

From: "Olivier Martin" <olivier.m= artin@arm.com>

Subject: Re: [edk2] error building S= tdLib with GCC44

To: <edk2-devel@lists.sourceforge.net><= /span>

Message-ID: <000a01ccdc6e$6194d980$24be8c80$@martin@a= rm.com>

Content-Type: text/plain; charset=3D"windows-1= 252"

 

Hi Duane,

 

I had a similar build issue thi= s week. I fixed it by creating a fu= nction

va_utimes(const char *path, ...) and = ;making utimes() calls this function. It

fixed the build but I did not&n= bsp;have the opportunity to check if it = was

running correctly.

 

See attached patch.

 

Regards,

Olivier

 

-----Original Message-----

From: Duane Voth [mailto:duanev@gmail.com]&nbs= p;

Sent: 26 January 2012 20:44

To: edk2-devel@lists.sourceforge.net

Subject: [edk2] error building StdLib&nbs= p;with GCC44

 

Just tried to build StdLib with = ;GCC44 and found this:

 

/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:= 1250:

error: ?va_start? used in function w= ith fixed args

 

It doesn't appear that utimes() need= s varargs - does no other compiler=

catch this?

 

----------------- build stdout ---------------= -

 

[duanev edk2]$ build -p StdLib/StdLib.dsc=

Build environment:

Linux-2.6.33.7-server-2mnb-x86_64-with-mandrake-2010.2-Offici= al

Build start time: 14:39:47, Jan.26 2= 012

 

WORKSPACE        =3D&= nbsp;/home/duanev/efi/edk2/svn64/edk2

ECP_SOURCE       =3D = /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg

EDK_SOURCE       =3D = /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg

EFI_SOURCE       =3D = /home/duanev/efi/edk2/svn64/edk2/EdkCompatibilityPkg

EDK_TOOLS_PATH   =3D /home/duanev/efi/edk= 2/svn64/edk2/BaseTools

 

 

Architecture(s)  =3D X64

Build target     =3D DEBUG=

Toolchain        =3D&= nbsp;GCC44

 

Active Platform       = ;   =3D

/home/duanev/efi/edk2/svn64/edk2/StdLib/StdLib.dsc=

 

Processing meta-data . done!=

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/LibC.inf [X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/StdLib/StdLib.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/String/String.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Wchar/Wchar.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Ctype/Ctype.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Time/Time.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Stdio/Stdio.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Locale/Locale.inf

[X64]

make: Nothing to be done for `t= build'.

Building ... /home/duanev/efi/edk2/svn64/edk2/StdLi= b/LibC/Uefi/Uefi.inf

[X64]

"/usr/bin/gcc" -g -fshort-wchar -fno= -stack-protector

-fno-strict-aliasing -Wall -Werror -Wno-missin= g-braces

-Wno-array-bounds -ffunction-sections -fdata-sectio= ns -c -include

AutoGen.h -DSTRING_ARRAY_NAME=3DLibUefiStrings -m64=

"-DEFIAPI=3D__attribute__((ms_abi))" -DNO_BUIL= TIN_VA_FUNCS -mno-red-zone

-Wno-address -mcmodel=3Dlarge -nostdinc -nostd= lib -o

/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X64= /StdLib/LibC/Ue

fi/Uefi/OUTPUT/./SysCalls.obj

-I/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi

-I/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X= 64/StdLib/LibC/

Uefi/Uefi/DEBUG

-I/home/duanev/efi/edk2/svn64/edk2/StdLib

-I/home/duanev/efi/edk2/svn64/edk2/StdLib/Include<= /span>

-I/home/duanev/efi/edk2/svn64/edk2/StdLib/Include/X64

-I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles=

-I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles= /Include

-I/home/duanev/efi/edk2/svn64/edk2/StdLibPrivateInternalFiles= /Include/X64

-I/home/duanev/efi/edk2/svn64/edk2/MdePkg

-I/home/duanev/efi/edk2/svn64/edk2/MdePkg/Include<= /span>

-I/home/duanev/efi/edk2/svn64/edk2/MdePkg/Include/X64

-I/home/duanev/efi/edk2/svn64/edk2/ShellPkg=

-I/home/duanev/efi/edk2/svn64/edk2/ShellPkg/Include

/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c<= o:p>

/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:=  In

function ?utimes?:

/home/duanev/efi/edk2/svn64/edk2/StdLib/LibC/Uefi/SysCalls.c:= 1250:

error: ?va_start? used in function w= ith fixed args

make: ***

[/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X6= 4/StdLib/LibC/U

efi/Uefi/OUTPUT/SysCalls.obj]

Error 1

 

 

build.py...

 : error 7000: Failed to execut= e command

        make tbu= ild

[/home/duanev/efi/edk2/svn64/edk2/Build/StdLib/DEBUG_GCC44/X6= 4/StdLib/LibC/U

efi/Uefi]

 

 

build.py...

 : error F002: Failed to build&= nbsp;module

        /home/duanev/= efi/edk2/svn64/edk2/StdLib/LibC/Uefi/Uefi.inf

[X64, GCC44, DEBUG]

 

- Failed -

Build end time: 14:39:50, Jan.26 201= 2

Build total time: 00:00:03

 

-------------------------------------------------------------= ---------------

--

Keep Your Developer Skills Current w= ith LearnDevNow!

The most comprehensive online learning&nb= sp;library for Microsoft developers

is just $99.99! Visual Studio, Share= Point, SQL - plus HTML5, CSS3, MVC3,

Metro Style Apps, more. Free future&= nbsp;releases when you subscribe now!=

http://p.sf.net/sfu/learndevnow-d2d

_______________________________________________

edk2-devel mailing list

edk2-devel@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/edk2-devel<= /o:p>

-------------- next part --------------

A non-text attachment was scrubbed...

Name: 0001-StdLib-SysCalls-Fix-GCC44-build-issue.patch

Type: application/octet-stream

Size: 1135 bytes

Desc: not available

 

------------------------------

 

Message: 4

Date: Thu, 26 Jan 2012 22:18:17 = ;-0000

From: "Olivier Martin" <olivier.m= artin@arm.com>

Subject: [edk2] [PATCH] MdeModulePkg/Dxe: = ;Fixed the function

FindFreePages() when a free region is&nbs= p;found at 0x0

To: "Sun, Rui" <rui.sun@intel.com= >

Cc: edk2-devel@lists.sourceforge.net

Message-ID: <000e01ccdc78$69a94930$3cfbdb90$@martin@a= rm.com>

Content-Type: text/plain; charset=3D"windows-1= 252"

 

Dear EDK2 community and MdeModulePkg = ;maintainer,

 

 

 

Please find the attached patch to&nb= sp;fix FindFreePages() when a free region is<= o:p>

found at 0x0.

 

FindFreePages() is returning 0x0 when&nbs= p;no free region was found.

 

But it could be possible the re= gion at 0x0 might be the only possible&n= bsp;region

returned by FindFreePages() on platforms&= nbsp;with system memory that starts at<= /span>

0x0.

 

In this case, it should be poss= ible to make the difference between the<= /o:p>

region 0x0 and the 'not found' = error.

 

 

 

The direct and indirect callers of&n= bsp;FindFreePages() have also be modified to<= /o:p>

handle the change.

 

 

 

Bets Regards,

 

Olivier

-------------- next part --------------

An HTML attachment was scrubbed...

-------------- next part --------------

A non-text attachment was scrubbed...

Name: 0001-MdeModulePkg-Dxe-Fixed-the-function-FindFreeP= ages.patch

Type: application/octet-stream

Size: 9722 bytes

Desc: not available

 

------------------------------

 

-------------------------------------------------------------= -----------------

Keep Your Developer Skills Current w= ith LearnDevNow!

The most comprehensive online learning&nb= sp;library for Microsoft developers

is just $99.99! Visual Studio, Share= Point, SQL - plus HTML5, CSS3, MVC3,

Metro Style Apps, more. Free future&= nbsp;releases when you subscribe now!=

http://p.sf.net/sfu/learndevnow-d2d

 

------------------------------

 

_______________________________________________

edk2-devel mailing list

edk2-devel@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/edk2-devel<= /o:p>

 

 

End of edk2-devel Digest, Vol 25,&nb= sp;Issue 96

******************************************<= /p>

--_000_CB6E33457884FA40993F35157061515C028DAAFMSMSX101amrcorpi_--