From: Daniel M. <dan...@er...> - 2011-09-06 14:13:24
|
Ok, I found a way to access that memory, which is accesing it directly. The memmory is in this range: 0000000100000000-000000027FFFFFFF EFI_PHYSICAL_ADDRESS add = 0x0000000100000000; Status = BS->AllocatePages(AllocateAddress,EfiLoaderData,1500000, &add); Then my question is, how could I do to get that memmory automatically detected when for example I use AllocatePages with the AllocateAnyPages modifier: Status = BS->AllocatePages(AllocateAnyPages,EfiLoaderData,3,NULL); Or when I call the AllocateZeroPool(): Filename = AllocateZeroPool(FilenameSize); Or even when trying to load a .efi image, although there is memory available in that range, my system does not recognize it and the .efi image is not loaded. How could I mark that memmory as available (possible to allocate in) or how do I tell the system to search for it there? Thank you very much. BR Daniel ________________________________ From: Daniel Moral [mailto:dan...@er...] Sent: den 6 september 2011 12:41 To: edk...@li...; efi...@li... Subject: [edk2] Problem when allocating memory Hi all, I am having a problem in my board when trying to allocate memmory. After loading the Shell and executing memmap this is the summary: reserved : 65 Pages (266,240) LoaderCode: 349 Pages (1,429,504) LoaderData: 384 Pages (1,572,864) BS_code : 1,492 Pages (6,111,232) BS_data : 262,865 Pages (1,076,695,040) RT_code : 97 Pages (397,312) RT_data : 43 Pages (176,128) available : 1,822,931 Pages (7,466,725,376) ACPI_recl : 8 Pages (32,768) ACPI_NVS : 630 Pages (2,580,480) MemMapIO : 69,711 Pages (285,536,256) Total Memory: 8,159 MB (8,555,720,704) Bytes I wrote an application which allocates memmory until it is not possible to allocate more, it executes this loop: while(!(EFI_ERROR(Status))){ cont++; Status = BS->AllocatePages(AllocateAnyPages,EfiLoaderData,3,NULL); } Then, if for example I try to load an application (EFIFMT.EFI) I get the following error messages: Promote the memory resource AllocatePoolPages: failed to allocate 44 pages AllocatePool: failed to allocate 179296 bytes Promote the memory resource AllocatePoolPages: failed to allocate 44 pages AllocatePool: failed to allocate 179296 bytes CoreOpenImageFile: Device did not support a known load protocol Promote the memory resource AllocatePoolPages: failed to allocate 44 pages AllocatePool: failed to allocate 179296 bytes 'EFIFMT.EFI' is not recognized as an internal or external command, operable program, or batch file Exit status code: Invalid Parameter But if I execute memmap again I get this: reserved : 65 Pages (266,240) LoaderCode: 349 Pages (1,429,504) LoaderData: 250,440 Pages (1,025,802,240) BS_code : 1,492 Pages (6,111,232) BS_data : 262,865 Pages (1,076,695,040) RT_code : 97 Pages (397,312) RT_data : 43 Pages (176,128) available : 1,572,875 Pages (6,442,496,000) ACPI_recl : 8 Pages (32,768) ACPI_NVS : 630 Pages (2,580,480) MemMapIO : 69,711 Pages (285,536,256) Total Memory: 8,159 MB (8,555,720,704) Bytes So if there is that much available memmory why can I only use like 2GB in total? Is there any limitation or any parameter anywhere to limit this? Or do you think it is because of my board? Thank you very much BR Daniel |