SHA256
1
0
forked from pool/elilo
elilo/elilo-bzimage-alloc.diff

48 lines
2.0 KiB
Diff

From: Stuart_Hayes@Dell.com
Subject: Re: [elilo-discuss] Follow-Up to 1MB Allocation Problem
Message-ID: <DFEF91B22ED07447AB6AA4B237F913F90218586E@ausx3mpc125.aus.amer.dell.com>
Here's one solution to the problem, for bzImages in x86_64 (which could
easily be ported to the other image types and architecture). I tried to
make this minimally invasive. If bzImage_probe() can't load the kernel
where it should be, it will just load the kernel anywhere, and it will
be moved to the right address after elilo exits EFI boot services. (I
also made it read where the kernel should be from the kernel header.)
It looks like it was already loading the initrd just anywhere and then
moving it after exiting boot services.
(I also enhanced the "MEMCPY" macro in x86_64/sysdeps.h so it will copy
to an overlapping area correctly regardless of whether the "from"
address is higher or lower than the "to" address.)
I originally wrote code that would actually check if the kernel was
relocatable and then relocate it, like the ia64 code does. That worked
fine, except that the address that was found overlapped the area where
elilo copies the initrd in start_kernel() after EFI boot services are
exited! Instead of modifying the initrd addresses, too, I decided it
would be easier and less likely to break anyting else (and would work
with non-relocatable kernels, too) to just do it the other way.
Any chance we could get this patch into elilo? I can modify and
resubmit if there are any issues with this approach.
Thanks!
[ only one change of this patch is still missing... -- rw@suse.de ]
---
fs/localfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/localfs.c
+++ b/fs/localfs.c
@@ -98,7 +98,7 @@ localfs_open(localfs_interface_t *this,
DBG_PRT((L"localfs_open on %s\n", name));
- status = uefi_call_wrapper(lfs->volume->Open, 5, lfs->volume, &fh, name, EFI_FILE_MODE_READ, 0);
+ status = uefi_call_wrapper(lfs->volume->Open, 5, lfs->volume, &fh, name, EFI_FILE_MODE_READ, (UINT64)0);
if (status == EFI_SUCCESS) {
*fd = LOCALFS_F2FD(fh);
}