On 05/17/16 19:13, Foster, Matthew I wrote: > I am trying to boot a linux kernel from within the shell that is > using a ramdisk filesystem. I allocate memory in the shell for a > ramdisk. I read the filesystem out of flash memory after allocating > memory in the shell: > > KernelRootFS = AllocatePages(((KernelFSSize/FOUR_KB_ALIGNED) +1)); > > I then use that address (KernelRootFS) to pass it to the kernel > command line to tell there kernel where the filesystem is in memory. > When it goes to use the ramdisk at some in the kernel boot, the > ramdisk appears to be corrupted and I get SQUASHFS errors. > > If I do that exact procedure in BdsBoot, I do not see the corruption. > Which leads me to believe the shell might be somehow trampling over > the memory. Does anyone have any ideas on what I might do, or what > could be going on here?
Please see the following messages in the list archive: http://thread.gmane.org/gmane.comp.bios.edk2.devel/10766 http://thread.gmane.org/gmane.comp.bios.edk2.devel/9885/focus=9923 In a nutshell (basically just summarizing what others have described): - Reserved memory is needed only if you want to boot off of a RAM disk (as opposed to just playing with the filesystem on it while in the UEFI shell or similar). - If you want to boot off of a RAM disk, then reserved memory *is* necessary. - The RAM disks created with the firmware setup forms (HII) are not meant for booting off of. So, you should do something like this: EFI_STATUS Status; EFI_PHYSICAL_ADDRESS KernelRootFsAddress; Status = gBS->AllocatePages ( AllocateAnyPages, EfiReservedMemoryType, EFI_SIZE_TO_PAGES ((UINTN)KernelFsSize), &KernelRootFsAddress ); if (!EFI_ERROR (Status)) { VOID *KernelRootFs; KernelRootFs = (VOID *)(UINTN)KernelRootFsAddress; /* ... */ } Thanks, Laszlo _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

