Subject: kern/6872: GENERIC is misleading in its COMPAT comments for BSDI emulation
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dogcow@isi.net>
List: netbsd-bugs
Date: 01/01/1999 21:34:22
>Number:         6872
>Category:       kern
>Synopsis:       GENERIC is misleading in its COMPAT comments for BSDI emulation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 24 21:50:01 1999
>Last-Modified:
>Originator:     Tom Spindler
>Organization:
BIFFSTERS INTERNATIONAL
	
>Release:        1.3.3
>Environment:
	
System: NetBSD baloney 1.3.3 NetBSD 1.3.3 (DOGCOW) #9: Fri Jan 1 21:01:29 PST 1999 dogcow@baloney:/src/usr/src/sys/arch/i386/compile/DOGCOW i386


>Description:
	
in the /usr/src/sys/arch/i386/conf/GENERIC file, there are the following lines:
options         COMPAT_NOMID    # compatibility with 386BSD, BSDI, NetBSD 0.8,
options         COMPAT_09       # NetBSD 0.9,
options         COMPAT_10       # NetBSD 1.0,
options         COMPAT_11       # NetBSD 1.1,
options         COMPAT_12       # NetBSD 1.2,
options         COMPAT_43       # and 4.3BSD

COMPAT_NOMID's comment is quite misleading, as BSDI's binaries (from 2.1
onwards, at least) do not use exec_nomid(); what BSDI 2.1 binary emulation
does call is several COMPAT_12 functions, and compat43_getdtablesize().

The fact that there is no compat_bsdi manpage may also be construed as a
bug.
>How-To-Repeat:
	
Try only enabling COMPAT_NOMID in the kernel options file, compile and
install said kernel, and watch emulation of binaries fail with 'invalid
system call'.
>Fix:
	
Since both freebsd emulation and BSDI emulation both require
getdtablesize and (seemingly) nothing else from the COMPAT_43 option,
it may be useful to abstract that function out. Of course, since I know
nothing about BSDI emulation other than what ktrace tells me, this may
be a horribly silly suggestion. (Then again, I'm also semi-mystified why
there's sometimes an 'o' in front of getdtablesize.)

In any case, changing the comment from "NetBSD 1.2" to "NetBSD 1.2 (and
BSDI)" (and adding the same to COMPAT_43) would be helpful for those of
us plebian slobs merely trying to get BSDI emulation working.

doc patch follows:

--- /usr/src/sys/arch/i386/conf/GENERIC.orig    Fri Jan  1 21:28:27 1999
+++ /usr/src/sys/arch/i386/conf/GENERIC Fri Jan  1 21:28:51 1999
@@ -66,8 +66,8 @@
 options        COMPAT_09       # NetBSD 0.9,
 options        COMPAT_10       # NetBSD 1.0,
 options        COMPAT_11       # NetBSD 1.1,
-options        COMPAT_12       # NetBSD 1.2,
-options        COMPAT_43       # and 4.3BSD
+options        COMPAT_12       # NetBSD 1.2 (and BSDI),
+options        COMPAT_43       # and 4.3BSD (and BSDI)
 
 options        COMPAT_SVR4     # binary compatibility with SVR4
 options        COMPAT_IBCS2    # binary compatibility with SCO and ISC


>Audit-Trail:
>Unformatted: