summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_aout.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>1995-02-14 19:23:22 +0000
committersos <sos@FreeBSD.org>1995-02-14 19:23:22 +0000
commit6deee3a45e9abcbe47f1e19b76c976658e2c5f26 (patch)
tree14e904cc9fa37485b1036478f5d4998f31c42a71 /sys/kern/imgact_aout.c
parent7402b2152526539603dab9e8f1b64f404e3905e1 (diff)
downloadFreeBSD-src-6deee3a45e9abcbe47f1e19b76c976658e2c5f26.zip
FreeBSD-src-6deee3a45e9abcbe47f1e19b76c976658e2c5f26.tar.gz
First attempt to run linux binaries. This is only the changes needed to
the generic kernel. The actual emulator is a separate LKM. (not finished yet, sorry). Submitted by: sos@freebsd.org & sef@kithrup.com
Diffstat (limited to 'sys/kern/imgact_aout.c')
-rw-r--r--sys/kern/imgact_aout.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index c700c26..5d6454c 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact_aout.c,v 1.8 1994/09/24 21:36:50 davidg Exp $
+ * $Id: imgact_aout.c,v 1.9 1994/09/25 19:33:31 phk Exp $
*/
#include <sys/param.h>
@@ -54,6 +54,16 @@ exec_aout_imgact(iparams)
int error;
extern struct sysentvec aout_sysvec;
+#ifdef COMPAT_LINUX
+ /*
+ * Linux and *BSD binaries look very much alike,
+ * only the machine id is different:
+ * 0x64 for Linux, 0x86 for *BSD.
+ */
+ if (((a_out->a_magic >> 16) & 0xff) != 0x86)
+ return -1;
+#endif /* COMPAT_LINUX */
+
/*
* Set file/virtual offset based on a.out variant.
* We do two cases: host byte order and network byte order
OpenPOWER on IntegriCloud