summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/load_elf.c
Commit message (Collapse)AuthorAgeFilesLines
* Use __FBSDID().obrien2003-08-251-2/+3
| | | | Also some minor style cleanups.
* Fix lookup of module metadata on amd64 systems. While this is inpeter2003-05-121-5/+25
| | | | | | | | common code, the non-trivial part is #ifdef'ed and only executes when loading amd64 kernels. The rest is trivial but needed for the the amd64 case. (Two variables changed from char ** to Elf_Addr). Approved by: re (amd64 "low-risk" stuff)
* Enable the i386 loader to load and run an amd64 kernel. If this putspeter2003-05-011-53/+64
| | | | | | | | | | | | | | | things over floppy size limits, I can exclude it for release builds or something like that. Most of the changes are to get the load_elf.c file into a seperate elf32_ or elf64_ namespace so that you can have two ELF loaders present at once. Note that for 64 bit kernels, it actually starts up the kernel already in 64 bit mode with paging enabled. This is really easy because we have a known minimum feature set. Of note is that for amd64, we have to pass in the bios int 15 0xe821 memory map because once in long mode, you absolutely cannot make VM86 calls. amd64 does not use 'struct bootinfo' at all. It is a pure loader metadata startup, just like sparc64 and powerpc. Much of the infrastructure to support this was adapted from sparc64.
* Libdisk does not need to include <sys/diskslice.h> any more.phk2003-04-041-1/+0
| | | | | | | | | Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h> Move i386/pc98 specific bits from <sys/reboot.h> to <i386/include/bootinfo.h> as well. Adjust includes in sys/boot accordingly.
* Fix module dependency (pre)loading on sparc64 by relocating the variablesjake2003-01-211-6/+57
| | | | | | | | read from the raw kld files. Submitted by: Hartmut Brandt <brandt@fokus.gmd.de> PR: 46870 Tested on: alpha (obrien), i386, sparc64
* We don't need bootinfo any more, and sparc64 doesn't have it anyways.obrien2002-05-101-1/+0
|
* Fix another unsigned long used to index the symbol table which should bejake2002-04-091-1/+1
| | | | Elf_Hashelt.
* Use the correct elf hash table entry type. This matches a similar fixpeter2002-04-061-6/+6
| | | | | in the kernel side of things some time ago. The hash table entries are always 32 bits wide, even on 64 bit machines.
* Implement the long-awaited module->file cache database. A userlandpeter2001-09-111-24/+16
| | | | | | | tool (kldxref(8)) keeps a cache of what modules and versions are inside what .ko files. I have tested this on both Alpha and i386. Submitted by: bp
* Get rid of some constness warnings.dwmalone2001-06-241-6/+7
|
* Convert the elf loader to the new linker set layout for elf files.peter2001-06-191-6/+7
| | | | | | This should make dependencies at load time work like before. Oops. Noticed by: markm
* Fix some of the worst formatting bug (seperate commit)peter2001-06-191-2/+4
|
* Cleanup warnings. Most of these are signed/unsigned warnings, as well asjhb2000-08-031-19/+25
| | | | some added const's.
* Remove residual printf.dcs2000-06-071-1/+0
| | | | Prodded by: msmith
* long != int on Alphas.bp2000-05-121-1/+2
|
* Update loader logic to distinguish modules vs. files.bp2000-05-011-83/+255
| | | | | | | Add support for module metadata. The old way of dependancy handling will be supported for a while. Reviewed by: peter
* Fix the loader to handle module dependencies properly. More fixesbp2000-02-251-39/+8
| | | | | | | will be provided after modmetadata appears in the kernel. Reviewed by: msmith Approved by: jkh
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Enable load of i386 ELF kernels with larger KVA range (e.g. starting attegge1999-02-151-2/+2
| | | | 0xe0100000u or 0xc0100000u instead of the usual 0xf0100000u).
* Don't forget a trailing \n when loading a kernel that has been stripped.peter1999-01-041-7/+8
| | | | | (This might make ELF_VERBOSE look funny, but I'm tempted to delete that anyway)
* Load the first page of the file and use the headers in it. This shouldpeter1998-10-171-52/+48
| | | | | avoid the need to seek back to offset zero which is causing trouble on the Alpha with a gzipped kernel.
* "fix" the gzipped kernel load problem by having the loader check that itpeter1998-10-161-22/+33
| | | | | | | can seek back to the first PT_LOAD and doing a close/reopen if it cannot. This is because the first PT_LOAD section includes the ELF headers. This fixes gzipped kernels on the i386, it should solve mike's problem for the Alpha.
* Change some printfs so that ELF_VERBOSE prints meaningful values on the alpha.dfr1998-10-151-3/+3
|
* Tweak the output one more time again. The kernel or module pathnamepeter1998-10-141-2/+3
| | | | is useful, and usually fits all on one line with the load sizes.
* Make the ELF load messages cleaner.peter1998-10-131-8/+17
|
* Only print kernel entry point during load.peter1998-10-121-62/+76
| | | | | | | | | | | | | | | | | | | Drastically quieten down the verbose load progress messages. They were more useful for debugging than anything, but are beyond a joke when loading a few dozen modules. Simplify the ELF extended symbol table load format. Just take the main symbol table and the string table that corresponds. This is what we will be getting local symbols from. (needed for the alpha stack tracebacks). Use the (optional) full symbol tables in lookups. This means we have to furhter distinguish between symbols that can come from the dynamic linking table and the complete table. The alpha boot code now needs to be adapted as ddb/db_elf.c cannot use the simpler format. I have not implemented loading the extended symbol tables from the syscall interface yet, just for preloaded modules. I am not sure about the symbol resolution. I *think* it's possible that a local symbol can be found in preference to a global, depending on the search sequence and dependency tree.
* Implement preloading for elf modulespeter1998-10-091-33/+129
| | | | | | | | - get dependency info from PT_DYNAMIC's DT_NEEDED tags. - store MODINFOMD_DYNAMIC for the kernel's later use setenv kernelname when we have it Fix firstaddr/lastaddr calculation (duh! :-) Explicitly skip string table with section names in it.
* First shot at loading elf symbols. Things are a bit strange becausepeter1998-10-021-13/+126
| | | | | | | | | | | | of the ..umm.. "wierd" way binutils lays out the file. The section headers are nearly at the end of the file and this is a problem when loading from a .gz file which can't seek backwards (or has a limited reverse seek, ~2K from memory). This is intended to be compatable with the ddb/db_elf.c code and the alpha/libalpha/elf_freebsd.c layout. I've studied these (which are NetBSD derived) but did it a bit differently. Naturally the process is similar since it's supposed to end up with the same result.
* ELF loader, part 1. It works with ELF kernels generated on the i386peter1998-09-301-0/+276
so far, and should probably be able to be made to work for the alpha without too much trouble once it's connected up and my assumptions tested. I think (but have not tested) it will also load "old" ELF kernels that were not linked with DYNAMIC headers. The module glue is yet to come. (oh fun.. :-) It does not explicitly load symbols [yet]. The _DYNAMIC data contains a runtime symbol set that ddb can use via ddb/db_kld.c. It'll be missing some detail that stabs normally provides (eg: number of args to a function, line numbers, etc). On the other hand, those minimal symbols will always be available even on a stripped kernel. This is mostly stolen from load_aout.c with some ideas from alpha/libalpha/elf_freebsd.c.
OpenPOWER on IntegriCloud