From owner-freebsd-current Tue Mar 12 13:39:43 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA19847 for current-outgoing; Tue, 12 Mar 1996 13:39:43 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id NAA19836 Tue, 12 Mar 1996 13:39:37 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id OAA06630; Tue, 12 Mar 1996 14:35:55 -0700 From: Terry Lambert Message-Id: <199603122135.OAA06630@phaeton.artisoft.com> Subject: Re: Native & Linux ELF support finally there... To: amurai@spec.co.jp Date: Tue, 12 Mar 1996 14:35:54 -0700 (MST) Cc: sos@freebsd.org, current@freebsd.org In-Reply-To: <199603120235.LAA02530@tama.spec.co.jp> from "Atsushi Murai" at Mar 12, 96 11:35:34 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > After a hectic week, Peter Wemm and I are proud to announce that > > FreeBSD-current now has ELF support. This means that we are now > > able to run native FreeBSD ELF binaries (generated with John > > Polstras Elfkit-1.0.1) and Linux ELF binaries, and yes Linux > > QUAKE finally works, at least as far as Peter & I has tried it > > (Hey I dont have time to play) > > Sounds great! But is there any way/plan to exclude this support code > during a compiling kernel(i.e options COMPAT_LINUX) ? It's will be > helpful for optimizing a size of kernel under the restricted memory ;-) The "COMPAT_LINUX" flag crap strikes me as just that: *crap*. It affects 4 files: 1) i386/i386/exception.s This small amount of code is here because someone didn't inline it or put it in a .s for the Linux ABI module itself. It should be possible to put this anywhere, including a file that is ld -r'ed into the single Linux ABI module. 2) i386/i386/trap.c This code is the code that is called by the exception.s code; there is exception.s code at all because it wasn't inlined as a naked function here (ie: no normal C preamble/postamble, but still C code). 3) i386/i386/machdep.c This code is two lines: one external declaration for the functions that could be dynamically assigned via function pointer, if nothing else, like the NFS loadable module functions (which are also bogusly wired his way for the lease code). The line is a "setidt". It should be possible to set/unset idt's from the LKM init/deinit routines. 4) kern/imgact_aout.c This is here because the image activators are bogusly called to look at magic numbers (my original LKM design had the magic numbers in a list and the lookup taking place in the list to hit the image activator). Using the original design, adding Linux image activation would be done by adding a list item that listed the magic numbers for Linux images and referenced the same activation function. This would also be removed when the module was unloaded. At worst, the activator chould be a stub that diddles the magic number then calls the a.out activator (this really would be silly because of NetBSD and BSDI and NetBSD's alternate platform support being usable using processor emulation environments that cause a loader to mmap the program image into an emulation space... ie SPARC or MIPS or PPC binaries on FreeBSD, or vice versa). The upshot of all this is that the COMPAT_LINUX flag should go away; it's a pain in the ass to have to rebuild a kernel in order to run Linux binary compatability. The change of the magic lookup would have the pleasent side-effect of not coring Linux program when the ABI module wasn't loaded, as is currently the case. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.