summaryrefslogtreecommitdiffstats
path: root/src/image/elf.c
Commit message (Collapse)AuthorAgeFilesLines
* [elf] Reject ELFBoot images requiring virtual addressingMichael Brown2015-07-291-51/+88
| | | | | | | | | | | | | | We do not set up any kind of virtual addressing before invoking an ELFBoot image. Reject if the image's program headers indicate that virtual addresses are not equal to physical addresses. This avoids problems when loading some RHEL5 kernels, which seem to include ELFBoot headers using virtual addressing. With this change, these kernels are no longer detected as ELFBoot, and so may be (correctly) detected as bzImage instead. Reported-by: Torgeir.Wulfsberg@kongsberg.com Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [multiboot] Place multiboot modules low in memoryMichael Brown2012-04-191-3/+15
| | | | | | | | | | | | | | | Solaris assumes that there is enough space above the Multiboot modules to use as a decompression and scratch area. This assumption is invalid when using iPXE, which places the Multiboot modules near the top of (32-bit) memory. Fix by copying the modules to an area of memory immediately following the loaded kernel. Debugged-by: Michael Brown <mcb30@ipxe.org> Debugged-by: Scott McWhirter <scottm@joyent.com> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [elf] Avoid attempting to load 64-bit ELF binariesMichael Brown2012-04-091-1/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image managementMichael Brown2011-03-071-14/+15
| | | | | | | | | | | Refactor the {load,exec} image operations as {probe,exec}. This makes the probe mechanism cleaner, eliminates some forward declarations, avoids holding magic state in image->priv, eliminates the possibility of screwing up between the "load" and "exec" stages, and makes the documentation simpler since the concept of "loading" (as distinct from "executing") no longer needs to be explained. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-4/+4
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-181-0/+2
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [elf] Work around entry point bug in NetBSD kernelsMichael Brown2009-04-241-14/+41
| | | | | | | | | | | | | | NetBSD kernels are multiboot ELF kernels with an entry point incorrectly specified as a virtual address rather than a physical address. Work around this by looking for the segment that could plausibly contain the entry point address (interpreted as either a physical or virtual address), and using that to determine the eventual physical entry point. In the event of any ambiguity, precedence is given to interpretation of the entry point as a physical address.
* [i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] longMichael Brown2008-11-191-1/+1
| | | | | | This brings us in to line with Linux definitions, and also simplifies adding x86_64 support since both platforms have 2-byte shorts, 4-byte ints and 8-byte long longs.
* [ELF] Add ability to boot ELF images generated by wraplinux and mkelfImageMichael Brown2008-06-091-23/+6Star
| | | | | | | | | | | | | | | | | | | Delete ELF as a generic image type. The method for invoking an ELF-based image (as well as any tables that must be set up to allow it to boot) will always depend on the specific architecture. core/elf.c now only provides the elf_load() function, to avoid duplicating functionality between ELF-based image types. Add arch/i386/image/elfboot.c, to handle the generic case of 32-bit x86 ELF images. We don't currently set up any multiboot tables, ELF notes, etc. This seems to be sufficient for loading kernels generated using both wraplinux and coreboot's mkelfImage. Note that while Etherboot 5.4 allowed ELF images to return, we don't. There is no callback mechanism for the loaded image to shut down gPXE, which means that we have to shut down before invoking the image. This means that we lose device state, protection against being trampled on, etc. It is not safe to continue afterwards.
* Replace image->entry with image->priv.Michael Brown2007-01-141-2/+2
|
* Force probing of multiboot before ELF.Michael Brown2007-01-121-2/+2
|
* Rename copy_user() to memcpy_user(). Add memmove_user() andMichael Brown2007-01-121-1/+1
| | | | userptr_add().
* Provide registration mechanism for loaded images, so that we can e.g.Michael Brown2007-01-121-5/+11
| | | | | | | | refer to them by name from the command line, or build them into a multiboot module list. Use setting image->type to disambiguate between "not my image" and "bad image"; this avoids relying on specific values of the error code.
* Add placeholder elf_execute()Michael Brown2007-01-111-0/+11
|
* Limit -ENOEXEC to mean "this is not in my format".Michael Brown2007-01-111-3/+3
|
* Use generic "struct image" rather than "struct elf".Michael Brown2007-01-111-11/+18
|
* Create include/gpxe/elf.h for the ELF bits that aren't part of the ELFMichael Brown2007-01-111-8/+4Star
| | | | standard and so don't belong in include/elf.h
* Removed the Etherboot-specific ELF-image code and replaced it with aMichael Brown2007-01-111-0/+130
generic ELF loader, to be used by the multiboot code.