Discussion:
elilo allocation problem
S***@public.gmane.org
2008-10-22 17:55:54 UTC
Permalink
Hello...

I'm trying to boot off of a usb key, and elilo is failing to allocate
the memory for the kernel. This is on an unreleased Dell platform.

Apparently elilo is trying to allocate 4MB at address 0x100000 (it's
calling AllocatePages(2, 2, 1024, 0x100000)), and the firmware on this
platform reserves the memory from 0x100000 (1MB) to 0x4000000 (64MB) for
its own use.

Is there a reason that elilo is trying to allocate memory for the kernel
at exactly 0x100000?

Thanks!
Stuart
Jason Fleischli
2008-10-22 18:44:59 UTC
Permalink
On Wed, 2008-10-22 at 12:55 -0500, Stuart_Hayes-DYMqY+***@public.gmane.org wrote:
Hi
Post by S***@public.gmane.org
Hello...
I'm trying to boot off of a usb key, and elilo is failing to allocate
the memory for the kernel. This is on an unreleased Dell platform.
elilo doesnt have a reiserfs driver so booting directly off of usb wont
currently work, it supports FAT-12,16,32, ext2fs, and PXE for netboot.
Post by S***@public.gmane.org
Apparently elilo is trying to allocate 4MB at address 0x100000 (it's
calling AllocatePages(2, 2, 1024, 0x100000)), and the firmware on this
platform reserves the memory from 0x100000 (1MB) to 0x4000000 (64MB)
for its own use.
This is a seperate issue, which version are we talking about here?
actually it may be irrelevant looking at latest source from
ia32/system.c and x86_64/system.c line 100
---
/* This starting address will hold true for all of the loader types for
now */
VOID *kernel_start = (VOID *)0x100000; /* 1M */
---
Looks like an old assumption is being broken by your new platform.
so, for now to get you going you could hardcode in a correct start
address for your config and rebuild elilo (just follow the build
dependencies in the release notes). I'll file a bug for this hardcoded
garbaaj and see if we can smarten it up a bit to use only the memory
allocated to it by the underlying efi.

-Jason
Post by S***@public.gmane.org
Thanks!
Stuart
--
___________________________________
JASON FLEISCHLI
HP - Open Source Linux Lab
Ft. Collins CO (970)898-0874


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
S***@public.gmane.org
2008-11-10 22:35:49 UTC
Permalink
I've run into an issue where elilo gets an EFI_INVALID_PARAMETER and
stops with the error message "LocateHandle GopProtocol failed." This is
from the first call to LocateHandle() in get_video_info().

It looks like this first call is meant to get the size of the buffer
that's needed, and size should be 0 to make this call. The buffer is
then allocated, and a second call to LocateHandle() is meant to actually
get the structure.

But the variable "size" is passed to LocateHandle() uninitialized, and,
on my system, is larger than the size of the GopProtocol structure, so
LocateHandle() is returning EFI_INVALID_PARAMETER because size is ok but
the buffer pointer isn't.

Here's a patch to fix this.

Thanks!
Stuart


--- elilo/x86_64/system.c.orig 2008-11-10 10:00:50.000000000 -0600
+++ elilo/x86_64/system.c 2008-11-10 10:17:28.000000000 -0600
@@ -192,7 +192,7 @@ static INTN get_video_info(boot_params_t
EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Gop_mode;
EFI_HANDLE *Gop_handle;
EFI_STATUS efi_status;
- UINTN size, size1;
+ UINTN size = 0, size1;
UINT8 i;

efi_status = uefi_call_wrapper(


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Jason Fleischli
2008-11-11 00:01:25 UTC
Permalink
Post by S***@public.gmane.org
It looks like this first call is meant to get the size of the buffer
that's needed, and size should be 0 to make this call. The buffer is
then allocated, and a second call to LocateHandle() is meant to actually
get the structure.
Thanks Stuart, this bug was already identified and fixed
and will be in next release which should post in the next
few weeks I hope.

-jason



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Sven Anders
2009-02-18 15:36:44 UTC
Permalink
Post by Jason Fleischli
Post by S***@public.gmane.org
It looks like this first call is meant to get the size of the buffer
that's needed, and size should be 0 to make this call. The buffer is
then allocated, and a second call to LocateHandle() is meant to actually
get the structure.
Thanks Stuart, this bug was already identified and fixed
and will be in next release which should post in the next
few weeks I hope.
-jason
Hello!

Any progress here?
When can we expect the new version (with this bug fixed)?
I consider this bug serious.

Regards
Sven
--
Sven Anders <anders-***@public.gmane.org> () Ascii Ribbon Campaign
/\ Support plain text e-mail
ANDURAS service solutions AG
Innstraße 71 - 94036 Passau - Germany
Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55

Rechtsform: Aktiengesellschaft - Sitz: Passau - Amtsgericht Passau HRB 6032
Mitglieder des Vorstands: Sven Anders, Marcus Junker
Vorsitzender des Aufsichtsrats: Mark Peters
Jason Fleischli
2009-02-18 18:31:16 UTC
Permalink
Post by Sven Anders
Hello!
Any progress here?
When can we expect the new version (with this bug fixed)?
I consider this bug serious.
Regards
Sven,

I have one more port and test to complete before elilo's next release.
in the mean time you always have the option to download the
top of tree source and build a version for yourself.
the bug fix that concerns you is in the top of tree source.
just follow the build instructions in elilo-3.8 release notes
paying particular attention to the build dependencies on
versions of gnu-efi and binutils to create a successful build
environment for elilo.

source and instructions for checkout
http://sourceforge.net/cvs/?group_id=91879

Regards,
-jason

Alex Williamson
2008-10-22 19:26:29 UTC
Permalink
Post by S***@public.gmane.org
Apparently elilo is trying to allocate 4MB at address 0x100000 (it's
calling AllocatePages(2, 2, 1024, 0x100000)), and the firmware on this
platform reserves the memory from 0x100000 (1MB) to 0x4000000 (64MB)
for its own use.
Is there a reason that elilo is trying to allocate memory for the
kernel at exactly 0x100000?
It looks like it's reading the start address from the kernel elf header,
and 1MB is unfortunately the default. Most distributions enabled
CONFIG_RELOCATABLE these days, but the ia32 elilo code probably never
got updated to support this like the ia64 side did.

Alex
--
Alex Williamson HP Open Source & Linux Org.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Jason Fleischli
2008-10-22 22:23:09 UTC
Permalink
Post by Alex Williamson
It looks like it's reading the start address from the kernel elf header,
and 1MB is unfortunately the default. Most distributions enabled
CONFIG_RELOCATABLE these days, but the ia32 elilo code probably never
got updated to support this like the ia64 side did.
Alex
Thats correct the option is only implemented for ia64 from a code grep.
--
___________________________________
JASON FLEISCHLI
HP - Open Source Linux Lab
Ft. Collins CO (970)898-0874


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Loading...