freebsd-skq/sys/i386/ibcs2
1995-12-09 04:33:27 +00:00
..
coff.h
ibcs2_dirent.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_dummy.c Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
ibcs2_errno.c Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_errno.h Import of original NetBSD's ibcs2 emulator sources by Scott Bartram, 1995-10-10 07:27:24 +00:00
ibcs2_fcntl.c Added (null for the i386) conversions from ibcs2's bogus fcntl args 1995-11-12 04:42:58 +00:00
ibcs2_fcntl.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_file.c Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
ibcs2_ioctl.c Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_ioctl.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_ipc.c Added bogus casts to avoid compiler warnings. 1995-11-13 09:03:30 +00:00
ibcs2_ipc.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_isc_syscall.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_isc_sysent.c Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_isc.c Untangled the vm.h include file spaghetti. 1995-12-07 12:48:31 +00:00
ibcs2_misc.c Add code to properly translate signal returned in status argument of wait4() 1995-10-23 19:46:51 +00:00
ibcs2_mount.h Import of original NetBSD's ibcs2 emulator sources by Scott Bartram, 1995-10-10 07:27:24 +00:00
ibcs2_msg.c Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_other.c Untangled the vm.h include file spaghetti. 1995-12-07 12:48:31 +00:00
ibcs2_poll.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_proto.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_signal.c In bsd_to_ibcs2_sigaction(), flag for ibcs2 system should be 1995-10-21 20:33:43 +00:00
ibcs2_signal.h Fixed parentheses in macros. 1995-11-13 08:58:06 +00:00
ibcs2_socksys.c Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_socksys.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_stat.c Do a better fake for uname information returned in utssys() call. 1995-10-16 05:32:20 +00:00
ibcs2_stat.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_statfs.h Import of original NetBSD's ibcs2 emulator sources by Scott Bartram, 1995-10-10 07:27:24 +00:00
ibcs2_stats.c Reviewed by: julian with quick glances by bruce and others 1995-08-28 09:19:25 +00:00
ibcs2_stropts.h Import of original NetBSD's ibcs2 emulator sources by Scott Bartram, 1995-10-10 07:27:24 +00:00
ibcs2_syscall.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_sysent.c Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_sysi86.c Removed unnecessary #includes of <sys/user.h>. Some of these were just 1995-12-06 23:44:23 +00:00
ibcs2_sysvec.c Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_termios.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_time.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_timeb.h Import of original NetBSD's ibcs2 emulator sources by Scott Bartram, 1995-10-10 07:27:24 +00:00
ibcs2_types.h Import of original NetBSD's ibcs2 emulator sources by Scott Bartram, 1995-10-10 07:27:24 +00:00
ibcs2_unistd.h Import of original NetBSD's ibcs2 emulator sources by Scott Bartram, 1995-10-10 07:27:24 +00:00
ibcs2_ustat.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_util.c Change alternate space base name from /emul/ibcs2 to /compat/ibcs2, 1995-10-10 17:33:19 +00:00
ibcs2_util.h Update ibcs2 to use the new ps_strings / stack gap arrangements.. 1995-12-09 04:33:27 +00:00
ibcs2_utime.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_utsname.h Do a better fake for uname information returned in utssys() call. 1995-10-16 05:32:20 +00:00
ibcs2_xenix_syscall.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_xenix_sysent.c Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_xenix.c Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2_xenix.h Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
ibcs2.h Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
imgact_coff.c Untangled the vm.h include file spaghetti. 1995-12-07 12:48:31 +00:00
README.iBCS2
syscalls.conf Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
syscalls.isc Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
syscalls.isc.conf Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
syscalls.master Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
syscalls.xenix Remove old files no longer needed. 1995-10-10 07:59:30 +00:00
syscalls.xenix.conf Remove old files no longer needed. 1995-10-10 07:59:30 +00:00

What it is
==========

This is a project that Sean Eric Fagan (sef@kithrup.com) started, and
Soren Schmidt (sos@login.dknet.dk, author of syscons) picked up.  It allows
SYSVr3.2 i386 binaries (iBCS2 compatible) to run under FreeBSD-2.0.
We haven't been able to do an exhaustive test, of course, but we are able 
to run at least the following programs:

	ISC 2.2 	sh, vi, dd, date, wc, chmod, etc. 
			
	SCO 3.2v2 	runs most (coff) utils on a chroot'ed filesystem
			Informix-2.10, gcc, bash, tcsh ....

	SCO 3.2v4 	sh, gzip, GNU make, tcsh

Some of those, for both ISC and SCO, used the shared libraries that are 
available for those systems.  Currently, the only way to run them, is to 
get a copy of the shared libraries in question (e.g. /shlib/libc_s).
There might be a way to generate them from a package available for Linux, 
but we haven't had the time or energy to do it ourself, and the last call
for volunteers resulted in nothing.  If someone else wants to volunteer, 
we would be grateful.


How to get it into the system
=============================

There are two ways of getting iBCS2 support into the system. One is to use
Loadable Kernel Modules (LKM) to put it into the kernel at run-time. This
demands a kernel compiled with:

	options "COMPAT_IBCS2"

This puts in the nessesary hooks to let the iBCS2 support do its thing.
One loads the iBCS2 support by using the command 'ibcs2' (in /usr/bin).
You can use 'modstat' to see the loaded modules.

Another way is to compile it into the kernel. This is accomplished using:

	options "COMPAT_IBCS2"
	options "IBCS2"

in the kernel config file.


Where's what
============

The ibcs2 package consists of quite a few files located in ./sys/i386/ibcs2.
Here is a brief description of them:

ibcs2.h:	Basic header file defines iBCS2 types etc.

ibcs2_dummy.c:	Stubs to system calls not yet supported, or not feasible
		to emulate.

ibcs2_ioctl.c:	Probably the single-most complicated part of it, this deals 
		with translating as many ioctl calls as possible between 
		BSD and iBCS2.

ibcs2_misc.c:	This has all of the wrapping routines that were thought 
		"easy" (at least initially) or that didn't fit anywhere else.

ibcs2_file.c:	Functions that deals with file I/O, such as getdents and read
		which are more complex than one should expect.

ibcs2_signal.c:	This deals with the signal cruft, including both system 
		calls and signal translation.  

ibcs2_stats.c:  This has all of the filesystem statistic wrappers 
		(stat, fstat, statfs, etc.).

ibcs2_sysent.c:	This has the system call table for iBCS2 programs, and is 
		NOT generated automatically.

ibcs2_ipc.c:	Stubs for the iBCS2 ipc calls (shm, msg, sem).

ibcs2_isc.c:	This deals with the ISC specific system call (cisc()).

ibcs2_sysi86.c:	This deals with the i86 specific system call (sysi86()).

ibcs2_xenix.c:	This deals with the Xenix specific system call (cxenix()).
		(This also has some of SCO's POSIX-conformant functions.)

imgact_coff.c:  This is the functions that alllows the kernel to load 
		COFF programs. It also deals with shared library loading.

There also exist two files (ibcs2_socksys.[ch]) which contains a proto
implementation of the SYSVr3 socket system, donated by Mostyn Lewis 
(mostyn@mrl.com). It has not been tested much but is included as a basis
for network support, which is nessesary to run X and the likes.


What's Next
===========

Much needs to be done yet, mainly the socksys emulation should be looked
at to get socket support going.  There currently also is no ipc support.
The sem & msg functions should map fairly easy to the BSD ones, but our
current BSD shm implementation is not even close to SYSV behavior, if it 
works at all. 
We currently have loaders or "image_activators" for other binary formats,
but none of them is really usefull yet (xout, elf).
Also most of the wrappers for the extra syscalls used by SYSVr4 has been
done, but not much testing yet because of lacks in the elf loader (but it
will run a statically linked SYSVr4 shell).

All the wrappers should be tested one by one using every aspect of use 
by the iBCS2 system.  The tests we have done so far is to run small 
testprograms to check a limited set of the emulation.  When this proved 
that the basics was functional, we tried with what iBCS2 programs where 
at hand.  This is by no means an exhaustive test or to say that the 
emulation is errorfree, only a statement of overall functionality of 
the emulator. 

Surely much work can be done here, but we are both kind of lazy, and did 
the whole thing just for the fun of it, and mainly as a "can it be done"
project. 

	Soren Schmidt 		(sos@login.dknet.dk)
	Sean Eric Fagan 	(sef@kithrup.com)