diff options
author | sos <sos@FreeBSD.org> | 1996-03-10 08:42:54 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 1996-03-10 08:42:54 +0000 |
commit | 7d151a09c3f9613590f35dad81c77959e4f34381 (patch) | |
tree | ab85b2b967b056b586d4e20e909a63357cd88185 /lkm/linux | |
parent | bfb211a9a540fa804c574162f720bebded3fcddf (diff) | |
download | FreeBSD-src-7d151a09c3f9613590f35dad81c77959e4f34381.zip FreeBSD-src-7d151a09c3f9613590f35dad81c77959e4f34381.tar.gz |
First attempt at FreeBSD & Linux ELF support.
Compile and link a new kernel, that will give native ELF support, and
provide the hooks for other ELF interpreters as well.
To make native ELF binaries use John Polstras elf-kit-1.0.1..
For the time being also use his ld-elf.so.1 and put it in
/usr/libexec.
The Linux emulator has been enhanced to also run ELF binaries, it
is however in its very first incarnation.
Just get some Linux ELF libs (Slackware-3.0) and put them in the
prober place (/compat/linux/...).
I've ben able to run all the Slackware-3.0 binaries I've tried
so far.
(No it won't run quake yet :)
Diffstat (limited to 'lkm/linux')
-rw-r--r-- | lkm/linux/Makefile | 4 | ||||
-rw-r--r-- | lkm/linux/linux.c | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/lkm/linux/Makefile b/lkm/linux/Makefile index 7c7074c..e544b7f 100644 --- a/lkm/linux/Makefile +++ b/lkm/linux/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.5 1996/01/27 23:57:06 rgrimes Exp $ +# $Id: Makefile,v 1.6 1996/03/02 20:00:35 peter Exp $ .PATH: ${.CURDIR}/../../sys/i386/linux KMOD= linux_mod @@ -11,7 +11,7 @@ NOMAN= CFLAGS+= -DLKM -I. -DCOMPAT_43 -DCOMPAT_LINUX #-DDEBUG CPPFLAGS= -I. -I${.CURDIR}/../../sys - +EXPORT_SYMS=_linux_mod CLEANFILES+= vnode_if.h vnode_if.c linux_genassym.o linux_genassym machine \ linux_assym.h diff --git a/lkm/linux/linux.c b/lkm/linux/linux.c index 67faa18..dbd319f 100644 --- a/lkm/linux/linux.c +++ b/lkm/linux/linux.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux.c,v 1.3 1995/11/13 07:18:38 bde Exp $ + * $Id: linux.c,v 1.4 1995/11/14 07:34:18 bde Exp $ */ #include <sys/param.h> @@ -34,14 +34,24 @@ #include <sys/conf.h> #include <sys/sysent.h> #include <sys/lkm.h> +#include <sys/imgact_elf.h> +#include "i386/linux/linux.h" extern const struct execsw linux_execsw; MOD_EXEC(linux, -1, (struct execsw*)&linux_execsw); +static Elf32_Interp_info linux_interp = { + &elf_linux_sysvec, + "/lib/ld-linux.so.1", + "/compat/linux" + }; + static int linux_load(struct lkm_table *lkmtp, int cmd) { + if (elf_insert_interp(&linux_interp)) + uprintf("Could not install ELF interpreter entry\n"); uprintf("Linux emulator installed\n"); return 0; } @@ -49,6 +59,8 @@ linux_load(struct lkm_table *lkmtp, int cmd) static int linux_unload(struct lkm_table *lkmtp, int cmd) { + if (elf_remove_interp(&linux_interp)) + uprintf("Could not deinstall ELF interpreter entry\n"); uprintf("Linux emulator removed\n"); return 0; } |