summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/compat/bsdos/Makefile13
-rw-r--r--sys/compat/bsdos/bsdos_exec.c144
-rw-r--r--sys/compat/bsdos/bsdos_exec.h47
-rw-r--r--sys/compat/bsdos/bsdos_syscall.h187
-rw-r--r--sys/compat/bsdos/bsdos_syscallargs.h201
-rw-r--r--sys/compat/bsdos/bsdos_syscalls.c247
-rw-r--r--sys/compat/bsdos/bsdos_sysent.c477
-rw-r--r--sys/compat/bsdos/files.bsdos11
-rw-r--r--sys/compat/bsdos/syscalls.conf12
9 files changed, 1339 insertions, 0 deletions
diff --git a/sys/compat/bsdos/Makefile b/sys/compat/bsdos/Makefile
new file mode 100644
index 00000000000..948dfc942e6
--- /dev/null
+++ b/sys/compat/bsdos/Makefile
@@ -0,0 +1,13 @@
+# $OpenBSD: Makefile,v 1.1 1997/09/02 08:54:11 downsj Exp $
+
+SYS= ../..
+DEP= syscalls.conf syscalls.master ${SYS}/kern/makesyscalls.sh
+OBJS= bsdos_sysent.c bsdos_syscalls.c \
+ bsdos_syscall.h bsdos_syscallargs.h
+
+${OBJS}: ${DEP}
+ -mv -f bsdos_sysent.c bsdos_sysent.c.bak
+ -mv -f bsdos_syscalls.c bsdos_syscalls.c.bak
+ -mv -f bsdos_syscall.h bsdos_syscall.h.bak
+ -mv -f bsdos_syscallargs.h bsdos_syscallargs.h.bak
+ sh ${SYS}/kern/makesyscalls.sh syscalls.conf syscalls.master
diff --git a/sys/compat/bsdos/bsdos_exec.c b/sys/compat/bsdos/bsdos_exec.c
new file mode 100644
index 00000000000..6e3bf9019c1
--- /dev/null
+++ b/sys/compat/bsdos/bsdos_exec.c
@@ -0,0 +1,144 @@
+/* $OpenBSD: bsdos_exec.c,v 1.1 1997/09/02 08:54:12 downsj Exp $ */
+
+/*
+ * Copyright (c) 1993, 1994 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Christopher G. Demetriou.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/malloc.h>
+#include <sys/vnode.h>
+#include <sys/exec.h>
+#include <sys/resourcevar.h>
+#include <vm/vm.h>
+
+#if 0
+#include <machine/bsdos_machdep.h>
+#endif
+
+#include <compat/bsdos/bsdos_exec.h>
+#include <compat/bsdos/bsdos_syscall.h>
+
+extern struct sysent bsdos_sysent[];
+extern char *bsdos_syscallnames[];
+
+extern void sendsig __P((sig_t, int, int, u_long, int, union sigval));
+extern char sigcode[], esigcode[];
+
+struct emul emul_bsdos = {
+ "bsdos",
+ NULL,
+ sendsig,
+ BSDOS_SYS_syscall,
+ BSDOS_SYS_MAXSYSCALL,
+ bsdos_sysent,
+ bsdos_syscallnames,
+ 0,
+ copyargs,
+ setregs,
+ NULL,
+ sigcode,
+ esigcode,
+};
+
+/*
+ * exec_aout_makecmds(): Check if it's an a.out-format executable.
+ *
+ * Given a proc pointer and an exec package pointer, see if the referent
+ * of the epp is in a.out format. First check 'standard' magic numbers for
+ * this architecture. If that fails, try a cpu-dependent hook.
+ *
+ * This function, in the former case, or the hook, in the latter, is
+ * responsible for creating a set of vmcmds which can be used to build
+ * the process's vm space and inserting them into the exec package.
+ */
+
+int
+exec_bsdos_aout_makecmds(p, epp)
+ struct proc *p;
+ struct exec_package *epp;
+{
+ u_long midmag, magic;
+ u_short mid;
+ int error = ENOEXEC;
+ struct exec *execp = epp->ep_hdr;
+
+ if (epp->ep_hdrvalid < sizeof(struct exec))
+ return ENOEXEC;
+
+ midmag = ntohl(execp->a_midmag);
+ mid = (midmag >> 16) & 0xffff;
+ magic = midmag & 0xffff;
+
+ if (magic == 0) {
+ magic = (execp->a_midmag & 0xffff);
+ mid = MID_BSDOS;
+ }
+
+ midmag = mid << 16 | magic;
+
+ switch (midmag) {
+ case (MID_BSDOS << 16) | ZMAGIC:
+ /*
+ * 386BSD's ZMAGIC format:
+ */
+ error = exec_aout_prep_oldzmagic(p, epp);
+ break;
+ case (MID_BSDOS << 16) | QMAGIC:
+ /*
+ * BSDI's QMAGIC format:
+ * same as new ZMAGIC format, but with different magic number.
+ */
+ error = exec_aout_prep_zmagic(p, epp);
+ break;
+ case (MID_BSDOS << 16) | NMAGIC:
+ /*
+ * BSDI's NMAGIC format:
+ * same as NMAGIC format, but with different magic number
+ * and with text starting at 0.
+ */
+ error = exec_aout_prep_oldnmagic(p, epp);
+ break;
+ case (MID_BSDOS << 16) | OMAGIC:
+ /*
+ * BSDI's OMAGIC format:
+ * same as OMAGIC format, but with different magic number
+ * and with text starting at 0.
+ */
+ error = exec_aout_prep_oldomagic(p, epp);
+ break;
+ }
+ if (error == 0)
+ epp->ep_emul = &emul_bsdos;
+ else
+ kill_vmcmds(&epp->ep_vmcmds);
+
+ return error;
+}
diff --git a/sys/compat/bsdos/bsdos_exec.h b/sys/compat/bsdos/bsdos_exec.h
new file mode 100644
index 00000000000..d56c3f3cf00
--- /dev/null
+++ b/sys/compat/bsdos/bsdos_exec.h
@@ -0,0 +1,47 @@
+/* $OpenBSD: bsdos_exec.h,v 1.1 1997/09/02 08:54:12 downsj Exp $ */
+
+/*-
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)exec.h 8.1 (Berkeley) 6/11/93
+ */
+
+#ifndef _BSDOS_EXEC_H
+#define _BSDOS_EXEC_H
+
+#define MID_BSDOS MID_ZERO
+
+#define BSDOS_AOUT_HDR_SIZE sizeof(struct exec)
+
+int exec_bsdos_aout_makecmds __P((struct proc *, struct exec_package *));
+
+#endif /* !_BSDOS_EXEC_H */
diff --git a/sys/compat/bsdos/bsdos_syscall.h b/sys/compat/bsdos/bsdos_syscall.h
new file mode 100644
index 00000000000..2965eaf4e32
--- /dev/null
+++ b/sys/compat/bsdos/bsdos_syscall.h
@@ -0,0 +1,187 @@
+/*
+ * System call numbers.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * created from OpenBSD: syscalls.master,v 1.1 1997/09/02 08:51:16 downsj Exp
+ */
+
+#define BSDOS_SYS_syscall 0
+#define BSDOS_SYS_exit 1
+#define BSDOS_SYS_fork 2
+#define BSDOS_SYS_read 3
+#define BSDOS_SYS_write 4
+#define BSDOS_SYS_open 5
+#define BSDOS_SYS_close 6
+#define BSDOS_SYS_wait4 7
+#define BSDOS_SYS_ocreat 8
+#define BSDOS_SYS_link 9
+#define BSDOS_SYS_unlink 10
+ /* 11 is obsolete execv */
+#define BSDOS_SYS_chdir 12
+#define BSDOS_SYS_fchdir 13
+#define BSDOS_SYS_mknod 14
+#define BSDOS_SYS_chmod 15
+#define BSDOS_SYS_chown 16
+#define BSDOS_SYS_break 17
+#define BSDOS_SYS_getfsstat 18
+#define BSDOS_SYS_olseek 19
+#define BSDOS_SYS_getpid 20
+#define BSDOS_SYS_mount 21
+#define BSDOS_SYS_unmount 22
+#define BSDOS_SYS_setuid 23
+#define BSDOS_SYS_getuid 24
+#define BSDOS_SYS_geteuid 25
+#define BSDOS_SYS_ptrace 26
+#define BSDOS_SYS_recvmsg 27
+#define BSDOS_SYS_sendmsg 28
+#define BSDOS_SYS_recvfrom 29
+#define BSDOS_SYS_accept 30
+#define BSDOS_SYS_getpeername 31
+#define BSDOS_SYS_getsockname 32
+#define BSDOS_SYS_access 33
+#define BSDOS_SYS_chflags 34
+#define BSDOS_SYS_fchflags 35
+#define BSDOS_SYS_sync 36
+#define BSDOS_SYS_kill 37
+#define BSDOS_SYS_ostat 38
+#define BSDOS_SYS_getppid 39
+#define BSDOS_SYS_olstat 40
+#define BSDOS_SYS_dup 41
+#define BSDOS_SYS_pipe 42
+#define BSDOS_SYS_getegid 43
+#define BSDOS_SYS_profil 44
+#define BSDOS_SYS_ktrace 45
+#define BSDOS_SYS_sigaction 46
+#define BSDOS_SYS_getgid 47
+#define BSDOS_SYS_sigprocmask 48
+#define BSDOS_SYS_getlogin 49
+#define BSDOS_SYS_setlogin 50
+#define BSDOS_SYS_acct 51
+#define BSDOS_SYS_sigpending 52
+#define BSDOS_SYS_sigaltstack 53
+#define BSDOS_SYS_ioctl 54
+#define BSDOS_SYS_reboot 55
+#define BSDOS_SYS_revoke 56
+#define BSDOS_SYS_symlink 57
+#define BSDOS_SYS_readlink 58
+#define BSDOS_SYS_execve 59
+#define BSDOS_SYS_umask 60
+#define BSDOS_SYS_chroot 61
+#define BSDOS_SYS_ofstat 62
+#define BSDOS_SYS_ogetkerninfo 63
+#define BSDOS_SYS_ogetpagesize 64
+#define BSDOS_SYS_msync 65
+#define BSDOS_SYS_vfork 66
+ /* 67 is obsolete vread */
+ /* 68 is obsolete vwrite */
+#define BSDOS_SYS_sbrk 69
+#define BSDOS_SYS_sstk 70
+#define BSDOS_SYS_ommap 71
+#define BSDOS_SYS_vadvise 72
+#define BSDOS_SYS_munmap 73
+#define BSDOS_SYS_mprotect 74
+#define BSDOS_SYS_madvise 75
+ /* 76 is obsolete vhangup */
+ /* 77 is obsolete vlimit */
+#define BSDOS_SYS_mincore 78
+#define BSDOS_SYS_getgroups 79
+#define BSDOS_SYS_setgroups 80
+#define BSDOS_SYS_getpgrp 81
+#define BSDOS_SYS_setpgid 82
+#define BSDOS_SYS_setitimer 83
+#define BSDOS_SYS_owait 84
+#define BSDOS_SYS_swapon 85
+#define BSDOS_SYS_getitimer 86
+#define BSDOS_SYS_ogethostname 87
+#define BSDOS_SYS_osethostname 88
+#define BSDOS_SYS_ogetdtablesize 89
+#define BSDOS_SYS_dup2 90
+#define BSDOS_SYS_fcntl 92
+#define BSDOS_SYS_select 93
+#define BSDOS_SYS_fsync 95
+#define BSDOS_SYS_setpriority 96
+#define BSDOS_SYS_socket 97
+#define BSDOS_SYS_connect 98
+#define BSDOS_SYS_oaccept 99
+#define BSDOS_SYS_getpriority 100
+#define BSDOS_SYS_osend 101
+#define BSDOS_SYS_orecv 102
+#define BSDOS_SYS_sigreturn 103
+#define BSDOS_SYS_bind 104
+#define BSDOS_SYS_setsockopt 105
+#define BSDOS_SYS_listen 106
+ /* 107 is obsolete vtimes */
+#define BSDOS_SYS_osigvec 108
+#define BSDOS_SYS_osigblock 109
+#define BSDOS_SYS_osigsetmask 110
+#define BSDOS_SYS_sigsuspend 111
+#define BSDOS_SYS_osigstack 112
+#define BSDOS_SYS_orecvmsg 113
+#define BSDOS_SYS_osendmsg 114
+#define BSDOS_SYS_vtrace 115
+ /* 115 is obsolete vtrace */
+#define BSDOS_SYS_gettimeofday 116
+#define BSDOS_SYS_getrusage 117
+#define BSDOS_SYS_getsockopt 118
+ /* 119 is obsolete resuba */
+#define BSDOS_SYS_readv 120
+#define BSDOS_SYS_writev 121
+#define BSDOS_SYS_settimeofday 122
+#define BSDOS_SYS_fchown 123
+#define BSDOS_SYS_fchmod 124
+#define BSDOS_SYS_orecvfrom 125
+#define BSDOS_SYS_osetreuid 126
+#define BSDOS_SYS_osetregid 127
+#define BSDOS_SYS_rename 128
+#define BSDOS_SYS_otruncate 129
+#define BSDOS_SYS_oftruncate 130
+#define BSDOS_SYS_flock 131
+#define BSDOS_SYS_mkfifo 132
+#define BSDOS_SYS_sendto 133
+#define BSDOS_SYS_shutdown 134
+#define BSDOS_SYS_socketpair 135
+#define BSDOS_SYS_mkdir 136
+#define BSDOS_SYS_rmdir 137
+#define BSDOS_SYS_utimes 138
+ /* 139 is obsolete 4.2 sigreturn */
+#define BSDOS_SYS_adjtime 140
+#define BSDOS_SYS_ogetpeername 141
+#define BSDOS_SYS_ogethostid 142
+#define BSDOS_SYS_osethostid 143
+#define BSDOS_SYS_ogetrlimit 144
+#define BSDOS_SYS_osetrlimit 145
+#define BSDOS_SYS_okillpg 146
+#define BSDOS_SYS_setsid 147
+#define BSDOS_SYS_quotactl 148
+#define BSDOS_SYS_oquota 149
+#define BSDOS_SYS_ogetsockname 150
+#define BSDOS_SYS_nfssvc 155
+#define BSDOS_SYS_ogetdirentries 156
+#define BSDOS_SYS_statfs 157
+#define BSDOS_SYS_fstatfs 158
+#define BSDOS_SYS_getfh 161
+#define BSDOS_SYS_shmsys 171
+#define BSDOS_SYS_setgid 181
+#define BSDOS_SYS_setegid 182
+#define BSDOS_SYS_seteuid 183
+#define BSDOS_SYS_lfs_bmapv 184
+#define BSDOS_SYS_lfs_markv 185
+#define BSDOS_SYS_lfs_segclean 186
+#define BSDOS_SYS_lfs_segwait 187
+#define BSDOS_SYS_stat 188
+#define BSDOS_SYS_fstat 189
+#define BSDOS_SYS_lstat 190
+#define BSDOS_SYS_pathconf 191
+#define BSDOS_SYS_fpathconf 192
+#define BSDOS_SYS_getrlimit 194
+#define BSDOS_SYS_setrlimit 195
+#define BSDOS_SYS_getdirentries 196
+#define BSDOS_SYS_mmap 197
+#define BSDOS_SYS___syscall 198
+#define BSDOS_SYS_lseek 199
+#define BSDOS_SYS_truncate 200
+#define BSDOS_SYS_ftruncate 201
+#define BSDOS_SYS___sysctl 202
+#define BSDOS_SYS_mlock 203
+#define BSDOS_SYS_munlock 204
+#define BSDOS_SYS_MAXSYSCALL 211
diff --git a/sys/compat/bsdos/bsdos_syscallargs.h b/sys/compat/bsdos/bsdos_syscallargs.h
new file mode 100644
index 00000000000..fdd67e5fd2e
--- /dev/null
+++ b/sys/compat/bsdos/bsdos_syscallargs.h
@@ -0,0 +1,201 @@
+/*
+ * System call argument lists.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * created from OpenBSD: syscalls.master,v 1.1 1997/09/02 08:51:16 downsj Exp
+ */
+
+#define syscallarg(x) union { x datum; register_t pad; }
+
+/*
+ * System call prototypes.
+ */
+
+int sys_nosys __P((struct proc *, void *, register_t *));
+int sys_exit __P((struct proc *, void *, register_t *));
+int sys_fork __P((struct proc *, void *, register_t *));
+int sys_read __P((struct proc *, void *, register_t *));
+int sys_write __P((struct proc *, void *, register_t *));
+int sys_open __P((struct proc *, void *, register_t *));
+int sys_close __P((struct proc *, void *, register_t *));
+int sys_wait4 __P((struct proc *, void *, register_t *));
+int compat_43_sys_creat __P((struct proc *, void *, register_t *));
+int sys_link __P((struct proc *, void *, register_t *));
+int sys_unlink __P((struct proc *, void *, register_t *));
+int sys_chdir __P((struct proc *, void *, register_t *));
+int sys_fchdir __P((struct proc *, void *, register_t *));
+int sys_mknod __P((struct proc *, void *, register_t *));
+int sys_chmod __P((struct proc *, void *, register_t *));
+int sys_chown __P((struct proc *, void *, register_t *));
+int sys_obreak __P((struct proc *, void *, register_t *));
+int sys_getfsstat __P((struct proc *, void *, register_t *));
+int compat_43_sys_lseek __P((struct proc *, void *, register_t *));
+int sys_getpid __P((struct proc *, void *, register_t *));
+int sys_mount __P((struct proc *, void *, register_t *));
+int sys_unmount __P((struct proc *, void *, register_t *));
+int sys_setuid __P((struct proc *, void *, register_t *));
+int sys_getuid __P((struct proc *, void *, register_t *));
+int sys_geteuid __P((struct proc *, void *, register_t *));
+int sys_ptrace __P((struct proc *, void *, register_t *));
+int sys_recvmsg __P((struct proc *, void *, register_t *));
+int sys_sendmsg __P((struct proc *, void *, register_t *));
+int sys_recvfrom __P((struct proc *, void *, register_t *));
+int sys_accept __P((struct proc *, void *, register_t *));
+int sys_getpeername __P((struct proc *, void *, register_t *));
+int sys_getsockname __P((struct proc *, void *, register_t *));
+int sys_access __P((struct proc *, void *, register_t *));
+int sys_chflags __P((struct proc *, void *, register_t *));
+int sys_fchflags __P((struct proc *, void *, register_t *));
+int sys_sync __P((struct proc *, void *, register_t *));
+int sys_kill __P((struct proc *, void *, register_t *));
+int compat_43_sys_stat __P((struct proc *, void *, register_t *));
+int sys_getppid __P((struct proc *, void *, register_t *));
+int compat_43_sys_lstat __P((struct proc *, void *, register_t *));
+int sys_dup __P((struct proc *, void *, register_t *));
+int sys_pipe __P((struct proc *, void *, register_t *));
+int sys_getegid __P((struct proc *, void *, register_t *));
+int sys_profil __P((struct proc *, void *, register_t *));
+#ifdef KTRACE
+int sys_ktrace __P((struct proc *, void *, register_t *));
+#else
+#endif
+int sys_sigaction __P((struct proc *, void *, register_t *));
+int sys_getgid __P((struct proc *, void *, register_t *));
+int sys_sigprocmask __P((struct proc *, void *, register_t *));
+int sys_getlogin __P((struct proc *, void *, register_t *));
+int sys_setlogin __P((struct proc *, void *, register_t *));
+int sys_acct __P((struct proc *, void *, register_t *));
+int sys_sigpending __P((struct proc *, void *, register_t *));
+int sys_sigaltstack __P((struct proc *, void *, register_t *));
+int sys_ioctl __P((struct proc *, void *, register_t *));
+int sys_reboot __P((struct proc *, void *, register_t *));
+int sys_revoke __P((struct proc *, void *, register_t *));
+int sys_symlink __P((struct proc *, void *, register_t *));
+int sys_readlink __P((struct proc *, void *, register_t *));
+int sys_execve __P((struct proc *, void *, register_t *));
+int sys_umask __P((struct proc *, void *, register_t *));
+int sys_chroot __P((struct proc *, void *, register_t *));
+int compat_43_sys_fstat __P((struct proc *, void *, register_t *));
+int compat_43_sys_getkerninfo __P((struct proc *, void *, register_t *));
+int compat_43_sys_getpagesize __P((struct proc *, void *, register_t *));
+int sys_msync __P((struct proc *, void *, register_t *));
+int sys_vfork __P((struct proc *, void *, register_t *));
+int sys_sbrk __P((struct proc *, void *, register_t *));
+int sys_sstk __P((struct proc *, void *, register_t *));
+int compat_43_sys_mmap __P((struct proc *, void *, register_t *));
+int sys_ovadvise __P((struct proc *, void *, register_t *));
+int sys_munmap __P((struct proc *, void *, register_t *));
+int sys_mprotect __P((struct proc *, void *, register_t *));
+int sys_madvise __P((struct proc *, void *, register_t *));
+int sys_mincore __P((struct proc *, void *, register_t *));
+int sys_getgroups __P((struct proc *, void *, register_t *));
+int sys_setgroups __P((struct proc *, void *, register_t *));
+int sys_getpgrp __P((struct proc *, void *, register_t *));
+int sys_setpgid __P((struct proc *, void *, register_t *));
+int sys_setitimer __P((struct proc *, void *, register_t *));
+int compat_43_sys_wait __P((struct proc *, void *, register_t *));
+int sys_swapon __P((struct proc *, void *, register_t *));
+int sys_getitimer __P((struct proc *, void *, register_t *));
+int compat_43_sys_gethostname __P((struct proc *, void *, register_t *));
+int compat_43_sys_sethostname __P((struct proc *, void *, register_t *));
+int compat_43_sys_getdtablesize __P((struct proc *, void *, register_t *));
+int sys_dup2 __P((struct proc *, void *, register_t *));
+int sys_fcntl __P((struct proc *, void *, register_t *));
+int sys_select __P((struct proc *, void *, register_t *));
+int sys_fsync __P((struct proc *, void *, register_t *));
+int sys_setpriority __P((struct proc *, void *, register_t *));
+int sys_socket __P((struct proc *, void *, register_t *));
+int sys_connect __P((struct proc *, void *, register_t *));
+int compat_43_sys_accept __P((struct proc *, void *, register_t *));
+int sys_getpriority __P((struct proc *, void *, register_t *));
+int compat_43_sys_send __P((struct proc *, void *, register_t *));
+int compat_43_sys_recv __P((struct proc *, void *, register_t *));
+int sys_sigreturn __P((struct proc *, void *, register_t *));
+int sys_bind __P((struct proc *, void *, register_t *));
+int sys_setsockopt __P((struct proc *, void *, register_t *));
+int sys_listen __P((struct proc *, void *, register_t *));
+int compat_43_sys_sigvec __P((struct proc *, void *, register_t *));
+int compat_43_sys_sigblock __P((struct proc *, void *, register_t *));
+int compat_43_sys_sigsetmask __P((struct proc *, void *, register_t *));
+int sys_sigsuspend __P((struct proc *, void *, register_t *));
+int compat_43_sys_sigstack __P((struct proc *, void *, register_t *));
+int compat_43_sys_recvmsg __P((struct proc *, void *, register_t *));
+int compat_43_sys_sendmsg __P((struct proc *, void *, register_t *));
+#ifdef TRACE
+int sys_vtrace __P((struct proc *, void *, register_t *));
+#else
+#endif
+int sys_gettimeofday __P((struct proc *, void *, register_t *));
+int sys_getrusage __P((struct proc *, void *, register_t *));
+int sys_getsockopt __P((struct proc *, void *, register_t *));
+int sys_readv __P((struct proc *, void *, register_t *));
+int sys_writev __P((struct proc *, void *, register_t *));
+int sys_settimeofday __P((struct proc *, void *, register_t *));
+int sys_fchown __P((struct proc *, void *, register_t *));
+int sys_fchmod __P((struct proc *, void *, register_t *));
+int compat_43_sys_recvfrom __P((struct proc *, void *, register_t *));
+int compat_43_sys_setreuid __P((struct proc *, void *, register_t *));
+int compat_43_sys_setregid __P((struct proc *, void *, register_t *));
+int sys_rename __P((struct proc *, void *, register_t *));
+int compat_43_sys_truncate __P((struct proc *, void *, register_t *));
+int compat_43_sys_ftruncate __P((struct proc *, void *, register_t *));
+int sys_flock __P((struct proc *, void *, register_t *));
+int sys_mkfifo __P((struct proc *, void *, register_t *));
+int sys_sendto __P((struct proc *, void *, register_t *));
+int sys_shutdown __P((struct proc *, void *, register_t *));
+int sys_socketpair __P((struct proc *, void *, register_t *));
+int sys_mkdir __P((struct proc *, void *, register_t *));
+int sys_rmdir __P((struct proc *, void *, register_t *));
+int sys_utimes __P((struct proc *, void *, register_t *));
+int sys_adjtime __P((struct proc *, void *, register_t *));
+int compat_43_sys_getpeername __P((struct proc *, void *, register_t *));
+int compat_43_sys_gethostid __P((struct proc *, void *, register_t *));
+int compat_43_sys_sethostid __P((struct proc *, void *, register_t *));
+int compat_43_sys_getrlimit __P((struct proc *, void *, register_t *));
+int compat_43_sys_setrlimit __P((struct proc *, void *, register_t *));
+int compat_43_sys_killpg __P((struct proc *, void *, register_t *));
+int sys_setsid __P((struct proc *, void *, register_t *));
+int sys_quotactl __P((struct proc *, void *, register_t *));
+int compat_43_sys_quota __P((struct proc *, void *, register_t *));
+int compat_43_sys_getsockname __P((struct proc *, void *, register_t *));
+#if defined(NFSCLIENT) || defined(NFSSERVER)
+int sys_nfssvc __P((struct proc *, void *, register_t *));
+#else
+#endif
+int compat_43_sys_getdirentries __P((struct proc *, void *, register_t *));
+int sys_statfs __P((struct proc *, void *, register_t *));
+int sys_fstatfs __P((struct proc *, void *, register_t *));
+#ifdef NFSCLIENT
+int sys_getfh __P((struct proc *, void *, register_t *));
+#else
+#endif
+#if defined(SYSVSHM) && !defined(alpha)
+int compat_10_sys_shmsys __P((struct proc *, void *, register_t *));
+#else
+#endif
+int sys_setgid __P((struct proc *, void *, register_t *));
+int sys_setegid __P((struct proc *, void *, register_t *));
+int sys_seteuid __P((struct proc *, void *, register_t *));
+#ifdef LFS
+int lfs_bmapv __P((struct proc *, void *, register_t *));
+int lfs_markv __P((struct proc *, void *, register_t *));
+int lfs_segclean __P((struct proc *, void *, register_t *));
+int lfs_segwait __P((struct proc *, void *, register_t *));
+#else
+#endif
+int sys_stat __P((struct proc *, void *, register_t *));
+int sys_fstat __P((struct proc *, void *, register_t *));
+int sys_lstat __P((struct proc *, void *, register_t *));
+int sys_pathconf __P((struct proc *, void *, register_t *));
+int sys_fpathconf __P((struct proc *, void *, register_t *));
+int sys_getrlimit __P((struct proc *, void *, register_t *));
+int sys_setrlimit __P((struct proc *, void *, register_t *));
+int sys_getdirentries __P((struct proc *, void *, register_t *));
+int sys_mmap __P((struct proc *, void *, register_t *));
+int sys_nosys __P((struct proc *, void *, register_t *));
+int sys_lseek __P((struct proc *, void *, register_t *));
+int sys_truncate __P((struct proc *, void *, register_t *));
+int sys_ftruncate __P((struct proc *, void *, register_t *));
+int sys___sysctl __P((struct proc *, void *, register_t *));
+int sys_mlock __P((struct proc *, void *, register_t *));
+int sys_munlock __P((struct proc *, void *, register_t *));
diff --git a/sys/compat/bsdos/bsdos_syscalls.c b/sys/compat/bsdos/bsdos_syscalls.c
new file mode 100644
index 00000000000..f391cddc519
--- /dev/null
+++ b/sys/compat/bsdos/bsdos_syscalls.c
@@ -0,0 +1,247 @@
+/*
+ * System call names.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * created from OpenBSD: syscalls.master,v 1.1 1997/09/02 08:51:16 downsj Exp
+ */
+
+char *bsdos_syscallnames[] = {
+ "syscall", /* 0 = syscall */
+ "exit", /* 1 = exit */
+ "fork", /* 2 = fork */
+ "read", /* 3 = read */
+ "write", /* 4 = write */
+ "open", /* 5 = open */
+ "close", /* 6 = close */
+ "wait4", /* 7 = wait4 */
+ "ocreat", /* 8 = ocreat */
+ "link", /* 9 = link */
+ "unlink", /* 10 = unlink */
+ "#11 (obsolete execv)", /* 11 = obsolete execv */
+ "chdir", /* 12 = chdir */
+ "fchdir", /* 13 = fchdir */
+ "mknod", /* 14 = mknod */
+ "chmod", /* 15 = chmod */
+ "chown", /* 16 = chown */
+ "break", /* 17 = break */
+ "getfsstat", /* 18 = getfsstat */
+ "olseek", /* 19 = olseek */
+ "getpid", /* 20 = getpid */
+ "mount", /* 21 = mount */
+ "unmount", /* 22 = unmount */
+ "setuid", /* 23 = setuid */
+ "getuid", /* 24 = getuid */
+ "geteuid", /* 25 = geteuid */
+ "ptrace", /* 26 = ptrace */
+ "recvmsg", /* 27 = recvmsg */
+ "sendmsg", /* 28 = sendmsg */
+ "recvfrom", /* 29 = recvfrom */
+ "accept", /* 30 = accept */
+ "getpeername", /* 31 = getpeername */
+ "getsockname", /* 32 = getsockname */
+ "access", /* 33 = access */
+ "chflags", /* 34 = chflags */
+ "fchflags", /* 35 = fchflags */
+ "sync", /* 36 = sync */
+ "kill", /* 37 = kill */
+ "ostat", /* 38 = ostat */
+ "getppid", /* 39 = getppid */
+ "olstat", /* 40 = olstat */
+ "dup", /* 41 = dup */
+ "pipe", /* 42 = pipe */
+ "getegid", /* 43 = getegid */
+ "profil", /* 44 = profil */
+#ifdef KTRACE
+ "ktrace", /* 45 = ktrace */
+#else
+ "#45 (unimplemented ktrace)", /* 45 = unimplemented ktrace */
+#endif
+ "sigaction", /* 46 = sigaction */
+ "getgid", /* 47 = getgid */
+ "sigprocmask", /* 48 = sigprocmask */
+ "getlogin", /* 49 = getlogin */
+ "setlogin", /* 50 = setlogin */
+ "acct", /* 51 = acct */
+ "sigpending", /* 52 = sigpending */
+ "sigaltstack", /* 53 = sigaltstack */
+ "ioctl", /* 54 = ioctl */
+ "reboot", /* 55 = reboot */
+ "revoke", /* 56 = revoke */
+ "symlink", /* 57 = symlink */
+ "readlink", /* 58 = readlink */
+ "execve", /* 59 = execve */
+ "umask", /* 60 = umask */
+ "chroot", /* 61 = chroot */
+ "ofstat", /* 62 = ofstat */
+ "ogetkerninfo", /* 63 = ogetkerninfo */
+ "ogetpagesize", /* 64 = ogetpagesize */
+ "msync", /* 65 = msync */
+ "vfork", /* 66 = vfork */
+ "#67 (obsolete vread)", /* 67 = obsolete vread */
+ "#68 (obsolete vwrite)", /* 68 = obsolete vwrite */
+ "sbrk", /* 69 = sbrk */
+ "sstk", /* 70 = sstk */
+ "ommap", /* 71 = ommap */
+ "vadvise", /* 72 = vadvise */
+ "munmap", /* 73 = munmap */
+ "mprotect", /* 74 = mprotect */
+ "madvise", /* 75 = madvise */
+ "#76 (obsolete vhangup)", /* 76 = obsolete vhangup */
+ "#77 (obsolete vlimit)", /* 77 = obsolete vlimit */
+ "mincore", /* 78 = mincore */
+ "getgroups", /* 79 = getgroups */
+ "setgroups", /* 80 = setgroups */
+ "getpgrp", /* 81 = getpgrp */
+ "setpgid", /* 82 = setpgid */
+ "setitimer", /* 83 = setitimer */
+ "owait", /* 84 = owait */
+ "swapon", /* 85 = swapon */
+ "getitimer", /* 86 = getitimer */
+ "ogethostname", /* 87 = ogethostname */
+ "osethostname", /* 88 = osethostname */
+ "ogetdtablesize", /* 89 = ogetdtablesize */
+ "dup2", /* 90 = dup2 */
+ "#91 (unimplemented getdopt)", /* 91 = unimplemented getdopt */
+ "fcntl", /* 92 = fcntl */
+ "select", /* 93 = select */
+ "#94 (unimplemented setdopt)", /* 94 = unimplemented setdopt */
+ "fsync", /* 95 = fsync */
+ "setpriority", /* 96 = setpriority */
+ "socket", /* 97 = socket */
+ "connect", /* 98 = connect */
+ "oaccept", /* 99 = oaccept */
+ "getpriority", /* 100 = getpriority */
+ "osend", /* 101 = osend */
+ "orecv", /* 102 = orecv */
+ "sigreturn", /* 103 = sigreturn */
+ "bind", /* 104 = bind */
+ "setsockopt", /* 105 = setsockopt */
+ "listen", /* 106 = listen */
+ "#107 (obsolete vtimes)", /* 107 = obsolete vtimes */
+ "osigvec", /* 108 = osigvec */
+ "osigblock", /* 109 = osigblock */
+ "osigsetmask", /* 110 = osigsetmask */
+ "sigsuspend", /* 111 = sigsuspend */
+ "osigstack", /* 112 = osigstack */
+ "orecvmsg", /* 113 = orecvmsg */
+ "osendmsg", /* 114 = osendmsg */
+#ifdef TRACE
+ "vtrace", /* 115 = vtrace */
+#else
+ "#115 (obsolete vtrace)", /* 115 = obsolete vtrace */
+#endif
+ "gettimeofday", /* 116 = gettimeofday */
+ "getrusage", /* 117 = getrusage */
+ "getsockopt", /* 118 = getsockopt */
+ "#119 (obsolete resuba)", /* 119 = obsolete resuba */
+ "readv", /* 120 = readv */
+ "writev", /* 121 = writev */
+ "settimeofday", /* 122 = settimeofday */
+ "fchown", /* 123 = fchown */
+ "fchmod", /* 124 = fchmod */
+ "orecvfrom", /* 125 = orecvfrom */
+ "osetreuid", /* 126 = osetreuid */
+ "osetregid", /* 127 = osetregid */
+ "rename", /* 128 = rename */
+ "otruncate", /* 129 = otruncate */
+ "oftruncate", /* 130 = oftruncate */
+ "flock", /* 131 = flock */
+ "mkfifo", /* 132 = mkfifo */
+ "sendto", /* 133 = sendto */
+ "shutdown", /* 134 = shutdown */
+ "socketpair", /* 135 = socketpair */
+ "mkdir", /* 136 = mkdir */
+ "rmdir", /* 137 = rmdir */
+ "utimes", /* 138 = utimes */
+ "#139 (obsolete 4.2 sigreturn)", /* 139 = obsolete 4.2 sigreturn */
+ "adjtime", /* 140 = adjtime */
+ "ogetpeername", /* 141 = ogetpeername */
+ "ogethostid", /* 142 = ogethostid */
+ "osethostid", /* 143 = osethostid */
+ "ogetrlimit", /* 144 = ogetrlimit */
+ "osetrlimit", /* 145 = osetrlimit */
+ "okillpg", /* 146 = okillpg */
+ "setsid", /* 147 = setsid */
+ "quotactl", /* 148 = quotactl */
+ "oquota", /* 149 = oquota */
+ "ogetsockname", /* 150 = ogetsockname */
+ "#151 (unimplemented sem_lock)", /* 151 = unimplemented sem_lock */
+ "#152 (unimplemented sem_wakeup)", /* 152 = unimplemented sem_wakeup */
+ "#153 (unimplemented asyncdaemon)", /* 153 = unimplemented asyncdaemon */
+ "#154 (unimplemented)", /* 154 = unimplemented */
+#if defined(NFSCLIENT) || defined(NFSSERVER)
+ "nfssvc", /* 155 = nfssvc */
+#else
+ "#155 (unimplemented)", /* 155 = unimplemented */
+#endif
+ "ogetdirentries", /* 156 = ogetdirentries */
+ "statfs", /* 157 = statfs */
+ "fstatfs", /* 158 = fstatfs */
+ "#159 (unimplemented)", /* 159 = unimplemented */
+ "#160 (unimplemented)", /* 160 = unimplemented */
+#ifdef NFSCLIENT
+ "getfh", /* 161 = getfh */
+#else
+ "#161 (unimplemented getfh)", /* 161 = unimplemented getfh */
+#endif
+ "#162 (unimplemented)", /* 162 = unimplemented */
+ "#163 (unimplemented)", /* 163 = unimplemented */
+ "#164 (unimplemented)", /* 164 = unimplemented */
+ "#165 (unimplemented)", /* 165 = unimplemented */
+ "#166 (unimplemented)", /* 166 = unimplemented */
+ "#167 (unimplemented)", /* 167 = unimplemented */
+ "#168 (unimplemented)", /* 168 = unimplemented */
+ "#169 (unimplemented)", /* 169 = unimplemented */
+ "#170 (unimplemented)", /* 170 = unimplemented */
+#if defined(SYSVSHM) && !defined(alpha)
+ "shmsys", /* 171 = shmsys */
+#else
+ "#171 (unimplemented shmsys)", /* 171 = unimplemented shmsys */
+#endif
+ "#172 (unimplemented)", /* 172 = unimplemented */
+ "#173 (unimplemented)", /* 173 = unimplemented */
+ "#174 (unimplemented)", /* 174 = unimplemented */
+ "#175 (unimplemented)", /* 175 = unimplemented */
+ "#176 (unimplemented)", /* 176 = unimplemented */
+ "#177 (unimplemented sfork)", /* 177 = unimplemented sfork */
+ "#178 (unimplemented)", /* 178 = unimplemented */
+ "#179 (unimplemented getdescriptor)", /* 179 = unimplemented getdescriptor */
+ "#180 (unimplemented setdescriptor)", /* 180 = unimplemented setdescriptor */
+ "setgid", /* 181 = setgid */
+ "setegid", /* 182 = setegid */
+ "seteuid", /* 183 = seteuid */
+#ifdef LFS
+ "lfs_bmapv", /* 184 = lfs_bmapv */
+ "lfs_markv", /* 185 = lfs_markv */
+ "lfs_segclean", /* 186 = lfs_segclean */
+ "lfs_segwait", /* 187 = lfs_segwait */
+#else
+ "#184 (unimplemented)", /* 184 = unimplemented */
+ "#185 (unimplemented)", /* 185 = unimplemented */
+ "#186 (unimplemented)", /* 186 = unimplemented */
+ "#187 (unimplemented)", /* 187 = unimplemented */
+#endif
+ "stat", /* 188 = stat */
+ "fstat", /* 189 = fstat */
+ "lstat", /* 190 = lstat */
+ "pathconf", /* 191 = pathconf */
+ "fpathconf", /* 192 = fpathconf */
+ "#193 (unimplemented)", /* 193 = unimplemented */
+ "getrlimit", /* 194 = getrlimit */
+ "setrlimit", /* 195 = setrlimit */
+ "getdirentries", /* 196 = getdirentries */
+ "mmap", /* 197 = mmap */
+ "__syscall", /* 198 = __syscall */
+ "lseek", /* 199 = lseek */
+ "truncate", /* 200 = truncate */
+ "ftruncate", /* 201 = ftruncate */
+ "__sysctl", /* 202 = __sysctl */
+ "mlock", /* 203 = mlock */
+ "munlock", /* 204 = munlock */
+ "#205 (unimplemented)", /* 205 = unimplemented */
+ "#206 (unimplemented)", /* 206 = unimplemented */
+ "#207 (unimplemented)", /* 207 = unimplemented */
+ "#208 (unimplemented)", /* 208 = unimplemented */
+ "#209 (unimplemented)", /* 209 = unimplemented */
+ "#210 (unimplemented)", /* 210 = unimplemented */
+};
diff --git a/sys/compat/bsdos/bsdos_sysent.c b/sys/compat/bsdos/bsdos_sysent.c
new file mode 100644
index 00000000000..d346b5883f0
--- /dev/null
+++ b/sys/compat/bsdos/bsdos_sysent.c
@@ -0,0 +1,477 @@
+/*
+ * System call switch table.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * created from OpenBSD: syscalls.master,v 1.1 1997/09/02 08:51:16 downsj Exp
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/signal.h>
+#include <sys/mount.h>
+#include <sys/syscallargs.h>
+#include <compat/bsdos/bsdos_syscallargs.h>
+
+#define s(type) sizeof(type)
+
+struct sysent bsdos_sysent[] = {
+ { 0, 0,
+ sys_nosys }, /* 0 = syscall */
+ { 1, s(struct sys_exit_args),
+ sys_exit }, /* 1 = exit */
+ { 0, 0,
+ sys_fork }, /* 2 = fork */
+ { 3, s(struct sys_read_args),
+ sys_read }, /* 3 = read */
+ { 3, s(struct sys_write_args),
+ sys_write }, /* 4 = write */
+ { 3, s(struct sys_open_args),
+ sys_open }, /* 5 = open */
+ { 1, s(struct sys_close_args),
+ sys_close }, /* 6 = close */
+ { 4, s(struct sys_wait4_args),
+ sys_wait4 }, /* 7 = wait4 */
+ { 2, s(struct compat_43_sys_creat_args),
+ compat_43_sys_creat }, /* 8 = ocreat */
+ { 2, s(struct sys_link_args),
+ sys_link }, /* 9 = link */
+ { 1, s(struct sys_unlink_args),
+ sys_unlink }, /* 10 = unlink */
+ { 0, 0,
+ sys_nosys }, /* 11 = obsolete execv */
+ { 1, s(struct sys_chdir_args),
+ sys_chdir }, /* 12 = chdir */
+ { 1, s(struct sys_fchdir_args),
+ sys_fchdir }, /* 13 = fchdir */
+ { 3, s(struct sys_mknod_args),
+ sys_mknod }, /* 14 = mknod */
+ { 2, s(struct sys_chmod_args),
+ sys_chmod }, /* 15 = chmod */
+ { 3, s(struct sys_chown_args),
+ sys_chown }, /* 16 = chown */
+ { 1, s(struct sys_obreak_args),
+ sys_obreak }, /* 17 = break */
+ { 3, s(struct sys_getfsstat_args),
+ sys_getfsstat }, /* 18 = getfsstat */
+ { 3, s(struct compat_43_sys_lseek_args),
+ compat_43_sys_lseek }, /* 19 = olseek */
+ { 0, 0,
+ sys_getpid }, /* 20 = getpid */
+ { 4, s(struct sys_mount_args),
+ sys_mount }, /* 21 = mount */
+ { 2, s(struct sys_unmount_args),
+ sys_unmount }, /* 22 = unmount */
+ { 1, s(struct sys_setuid_args),
+ sys_setuid }, /* 23 = setuid */
+ { 0, 0,
+ sys_getuid }, /* 24 = getuid */
+ { 0, 0,
+ sys_geteuid }, /* 25 = geteuid */
+ { 4, s(struct sys_ptrace_args),
+ sys_ptrace }, /* 26 = ptrace */
+ { 3, s(struct sys_recvmsg_args),
+ sys_recvmsg }, /* 27 = recvmsg */
+ { 3, s(struct sys_sendmsg_args),
+ sys_sendmsg }, /* 28 = sendmsg */
+ { 6, s(struct sys_recvfrom_args),
+ sys_recvfrom }, /* 29 = recvfrom */
+ { 3, s(struct sys_accept_args),
+ sys_accept }, /* 30 = accept */
+ { 3, s(struct sys_getpeername_args),
+ sys_getpeername }, /* 31 = getpeername */
+ { 3, s(struct sys_getsockname_args),
+ sys_getsockname }, /* 32 = getsockname */
+ { 2, s(struct sys_access_args),
+ sys_access }, /* 33 = access */
+ { 2, s(struct sys_chflags_args),
+ sys_chflags }, /* 34 = chflags */
+ { 2, s(struct sys_fchflags_args),
+ sys_fchflags }, /* 35 = fchflags */
+ { 0, 0,
+ sys_sync }, /* 36 = sync */
+ { 2, s(struct sys_kill_args),
+ sys_kill }, /* 37 = kill */
+ { 2, s(struct compat_43_sys_stat_args),
+ compat_43_sys_stat }, /* 38 = ostat */
+ { 0, 0,
+ sys_getppid }, /* 39 = getppid */
+ { 2, s(struct compat_43_sys_lstat_args),
+ compat_43_sys_lstat }, /* 40 = olstat */
+ { 1, s(struct sys_dup_args),
+ sys_dup }, /* 41 = dup */
+ { 0, 0,
+ sys_pipe }, /* 42 = pipe */
+ { 0, 0,
+ sys_getegid }, /* 43 = getegid */
+ { 4, s(struct sys_profil_args),
+ sys_profil }, /* 44 = profil */
+#ifdef KTRACE
+ { 4, s(struct sys_ktrace_args),
+ sys_ktrace }, /* 45 = ktrace */
+#else
+ { 0, 0,
+ sys_nosys }, /* 45 = unimplemented ktrace */
+#endif
+ { 3, s(struct sys_sigaction_args),
+ sys_sigaction }, /* 46 = sigaction */
+ { 0, 0,
+ sys_getgid }, /* 47 = getgid */
+ { 2, s(struct sys_sigprocmask_args),
+ sys_sigprocmask }, /* 48 = sigprocmask */
+ { 2, s(struct sys_getlogin_args),
+ sys_getlogin }, /* 49 = getlogin */
+ { 1, s(struct sys_setlogin_args),
+ sys_setlogin }, /* 50 = setlogin */
+ { 1, s(struct sys_acct_args),
+ sys_acct }, /* 51 = acct */
+ { 0, 0,
+ sys_sigpending }, /* 52 = sigpending */
+ { 2, s(struct sys_sigaltstack_args),
+ sys_sigaltstack }, /* 53 = sigaltstack */
+ { 3, s(struct sys_ioctl_args),
+ sys_ioctl }, /* 54 = ioctl */
+ { 1, s(struct sys_reboot_args),
+ sys_reboot }, /* 55 = reboot */
+ { 1, s(struct sys_revoke_args),
+ sys_revoke }, /* 56 = revoke */
+ { 2, s(struct sys_symlink_args),
+ sys_symlink }, /* 57 = symlink */
+ { 3, s(struct sys_readlink_args),
+ sys_readlink }, /* 58 = readlink */
+ { 3, s(struct sys_execve_args),
+ sys_execve }, /* 59 = execve */
+ { 1, s(struct sys_umask_args),
+ sys_umask }, /* 60 = umask */
+ { 1, s(struct sys_chroot_args),
+ sys_chroot }, /* 61 = chroot */
+ { 2, s(struct compat_43_sys_fstat_args),
+ compat_43_sys_fstat }, /* 62 = ofstat */
+ { 4, s(struct compat_43_sys_getkerninfo_args),
+ compat_43_sys_getkerninfo }, /* 63 = ogetkerninfo */
+ { 0, 0,
+ compat_43_sys_getpagesize }, /* 64 = ogetpagesize */
+ { 3, s(struct sys_msync_args),
+ sys_msync }, /* 65 = msync */
+ { 0, 0,
+ sys_vfork }, /* 66 = vfork */
+ { 0, 0,
+ sys_nosys }, /* 67 = obsolete vread */
+ { 0, 0,
+ sys_nosys }, /* 68 = obsolete vwrite */
+ { 1, s(struct sys_sbrk_args),
+ sys_sbrk }, /* 69 = sbrk */
+ { 1, s(struct sys_sstk_args),
+ sys_sstk }, /* 70 = sstk */
+ { 6, s(struct compat_43_sys_mmap_args),
+ compat_43_sys_mmap }, /* 71 = ommap */
+ { 1, s(struct sys_ovadvise_args),
+ sys_ovadvise }, /* 72 = vadvise */
+ { 2, s(struct sys_munmap_args),
+ sys_munmap }, /* 73 = munmap */
+ { 3, s(struct sys_mprotect_args),
+ sys_mprotect }, /* 74 = mprotect */
+ { 3, s(struct sys_madvise_args),
+ sys_madvise }, /* 75 = madvise */
+ { 0, 0,
+ sys_nosys }, /* 76 = obsolete vhangup */
+ { 0, 0,
+ sys_nosys }, /* 77 = obsolete vlimit */
+ { 3, s(struct sys_mincore_args),
+ sys_mincore }, /* 78 = mincore */
+ { 2, s(struct sys_getgroups_args),
+ sys_getgroups }, /* 79 = getgroups */
+ { 2, s(struct sys_setgroups_args),
+ sys_setgroups }, /* 80 = setgroups */
+ { 0, 0,
+ sys_getpgrp }, /* 81 = getpgrp */
+ { 2, s(struct sys_setpgid_args),
+ sys_setpgid }, /* 82 = setpgid */
+ { 3, s(struct sys_setitimer_args),
+ sys_setitimer }, /* 83 = setitimer */
+ { 0, 0,
+ compat_43_sys_wait }, /* 84 = owait */
+ { 1, s(struct sys_swapon_args),
+ sys_swapon }, /* 85 = swapon */
+ { 2, s(struct sys_getitimer_args),
+ sys_getitimer }, /* 86 = getitimer */
+ { 2, s(struct compat_43_sys_gethostname_args),
+ compat_43_sys_gethostname }, /* 87 = ogethostname */
+ { 2, s(struct compat_43_sys_sethostname_args),
+ compat_43_sys_sethostname }, /* 88 = osethostname */
+ { 0, 0,
+ compat_43_sys_getdtablesize }, /* 89 = ogetdtablesize */
+ { 2, s(struct sys_dup2_args),
+ sys_dup2 }, /* 90 = dup2 */
+ { 0, 0,
+ sys_nosys }, /* 91 = unimplemented getdopt */
+ { 3, s(struct sys_fcntl_args),
+ sys_fcntl }, /* 92 = fcntl */
+ { 5, s(struct sys_select_args),
+ sys_select }, /* 93 = select */
+ { 0, 0,
+ sys_nosys }, /* 94 = unimplemented setdopt */
+ { 1, s(struct sys_fsync_args),
+ sys_fsync }, /* 95 = fsync */
+ { 3, s(struct sys_setpriority_args),
+ sys_setpriority }, /* 96 = setpriority */
+ { 3, s(struct sys_socket_args),
+ sys_socket }, /* 97 = socket */
+ { 3, s(struct sys_connect_args),
+ sys_connect }, /* 98 = connect */
+ { 3, s(struct compat_43_sys_accept_args),
+ compat_43_sys_accept }, /* 99 = oaccept */
+ { 2, s(struct sys_getpriority_args),
+ sys_getpriority }, /* 100 = getpriority */
+ { 4, s(struct compat_43_sys_send_args),
+ compat_43_sys_send }, /* 101 = osend */
+ { 4, s(struct compat_43_sys_recv_args),
+ compat_43_sys_recv }, /* 102 = orecv */
+ { 1, s(struct sys_sigreturn_args),
+ sys_sigreturn }, /* 103 = sigreturn */
+ { 3, s(struct sys_bind_args),
+ sys_bind }, /* 104 = bind */
+ { 5, s(struct sys_setsockopt_args),
+ sys_setsockopt }, /* 105 = setsockopt */
+ { 2, s(struct sys_listen_args),
+ sys_listen }, /* 106 = listen */
+ { 0, 0,
+ sys_nosys }, /* 107 = obsolete vtimes */
+ { 3, s(struct compat_43_sys_sigvec_args),
+ compat_43_sys_sigvec }, /* 108 = osigvec */
+ { 1, s(struct compat_43_sys_sigblock_args),
+ compat_43_sys_sigblock }, /* 109 = osigblock */
+ { 1, s(struct compat_43_sys_sigsetmask_args),
+ compat_43_sys_sigsetmask }, /* 110 = osigsetmask */
+ { 1, s(struct sys_sigsuspend_args),
+ sys_sigsuspend }, /* 111 = sigsuspend */
+ { 2, s(struct compat_43_sys_sigstack_args),
+ compat_43_sys_sigstack }, /* 112 = osigstack */
+ { 3, s(struct compat_43_sys_recvmsg_args),
+ compat_43_sys_recvmsg }, /* 113 = orecvmsg */
+ { 3, s(struct compat_43_sys_sendmsg_args),
+ compat_43_sys_sendmsg }, /* 114 = osendmsg */
+#ifdef TRACE
+ { 2, s(struct sys_vtrace_args),
+ sys_vtrace }, /* 115 = vtrace */
+#else
+ { 0, 0,
+ sys_nosys }, /* 115 = obsolete vtrace */
+#endif
+ { 2, s(struct sys_gettimeofday_args),
+ sys_gettimeofday }, /* 116 = gettimeofday */
+ { 2, s(struct sys_getrusage_args),
+ sys_getrusage }, /* 117 = getrusage */
+ { 5, s(struct sys_getsockopt_args),
+ sys_getsockopt }, /* 118 = getsockopt */
+ { 0, 0,
+ sys_nosys }, /* 119 = obsolete resuba */
+ { 3, s(struct sys_readv_args),
+ sys_readv }, /* 120 = readv */
+ { 3, s(struct sys_writev_args),
+ sys_writev }, /* 121 = writev */
+ { 2, s(struct sys_settimeofday_args),
+ sys_settimeofday }, /* 122 = settimeofday */
+ { 3, s(struct sys_fchown_args),
+ sys_fchown }, /* 123 = fchown */
+ { 2, s(struct sys_fchmod_args),
+ sys_fchmod }, /* 124 = fchmod */
+ { 6, s(struct compat_43_sys_recvfrom_args),
+ compat_43_sys_recvfrom }, /* 125 = orecvfrom */
+ { 2, s(struct compat_43_sys_setreuid_args),
+ compat_43_sys_setreuid }, /* 126 = osetreuid */
+ { 2, s(struct compat_43_sys_setregid_args),
+ compat_43_sys_setregid }, /* 127 = osetregid */
+ { 2, s(struct sys_rename_args),
+ sys_rename }, /* 128 = rename */
+ { 2, s(struct compat_43_sys_truncate_args),
+ compat_43_sys_truncate }, /* 129 = otruncate */
+ { 2, s(struct compat_43_sys_ftruncate_args),
+ compat_43_sys_ftruncate }, /* 130 = oftruncate */
+ { 2, s(struct sys_flock_args),
+ sys_flock }, /* 131 = flock */
+ { 2, s(struct sys_mkfifo_args),
+ sys_mkfifo }, /* 132 = mkfifo */
+ { 6, s(struct sys_sendto_args),
+ sys_sendto }, /* 133 = sendto */
+ { 2, s(struct sys_shutdown_args),
+ sys_shutdown }, /* 134 = shutdown */
+ { 4, s(struct sys_socketpair_args),
+ sys_socketpair }, /* 135 = socketpair */
+ { 2, s(struct sys_mkdir_args),
+ sys_mkdir }, /* 136 = mkdir */
+ { 1, s(struct sys_rmdir_args),
+ sys_rmdir }, /* 137 = rmdir */
+ { 2, s(struct sys_utimes_args),
+ sys_utimes }, /* 138 = utimes */
+ { 0, 0,
+ sys_nosys }, /* 139 = obsolete 4.2 sigreturn */
+ { 2, s(struct sys_adjtime_args),
+ sys_adjtime }, /* 140 = adjtime */
+ { 3, s(struct compat_43_sys_getpeername_args),
+ compat_43_sys_getpeername }, /* 141 = ogetpeername */
+ { 0, 0,
+ compat_43_sys_gethostid }, /* 142 = ogethostid */
+ { 1, s(struct compat_43_sys_sethostid_args),
+ compat_43_sys_sethostid }, /* 143 = osethostid */
+ { 2, s(struct compat_43_sys_getrlimit_args),
+ compat_43_sys_getrlimit }, /* 144 = ogetrlimit */
+ { 2, s(struct compat_43_sys_setrlimit_args),
+ compat_43_sys_setrlimit }, /* 145 = osetrlimit */
+ { 2, s(struct compat_43_sys_killpg_args),
+ compat_43_sys_killpg }, /* 146 = okillpg */
+ { 0, 0,
+ sys_setsid }, /* 147 = setsid */
+ { 4, s(struct sys_quotactl_args),
+ sys_quotactl }, /* 148 = quotactl */
+ { 0, 0,
+ compat_43_sys_quota }, /* 149 = oquota */
+ { 3, s(struct compat_43_sys_getsockname_args),
+ compat_43_sys_getsockname }, /* 150 = ogetsockname */
+ { 0, 0,
+ sys_nosys }, /* 151 = unimplemented sem_lock */
+ { 0, 0,
+ sys_nosys }, /* 152 = unimplemented sem_wakeup */
+ { 0, 0,
+ sys_nosys }, /* 153 = unimplemented asyncdaemon */
+ { 0, 0,
+ sys_nosys }, /* 154 = unimplemented */
+#if defined(NFSCLIENT) || defined(NFSSERVER)
+ { 2, s(struct sys_nfssvc_args),
+ sys_nfssvc }, /* 155 = nfssvc */
+#else
+ { 0, 0,
+ sys_nosys }, /* 155 = unimplemented */
+#endif
+ { 4, s(struct compat_43_sys_getdirentries_args),
+ compat_43_sys_getdirentries }, /* 156 = ogetdirentries */
+ { 2, s(struct sys_statfs_args),
+ sys_statfs }, /* 157 = statfs */
+ { 2, s(struct sys_fstatfs_args),
+ sys_fstatfs }, /* 158 = fstatfs */
+ { 0, 0,
+ sys_nosys }, /* 159 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 160 = unimplemented */
+#ifdef NFSCLIENT
+ { 2, s(struct sys_getfh_args),
+ sys_getfh }, /* 161 = getfh */
+#else
+ { 0, 0,
+ sys_nosys }, /* 161 = unimplemented getfh */
+#endif
+ { 0, 0,
+ sys_nosys }, /* 162 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 163 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 164 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 165 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 166 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 167 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 168 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 169 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 170 = unimplemented */
+#if defined(SYSVSHM) && !defined(alpha)
+ { 4, s(struct compat_10_sys_shmsys_args),
+ compat_10_sys_shmsys }, /* 171 = shmsys */
+#else
+ { 0, 0,
+ sys_nosys }, /* 171 = unimplemented shmsys */
+#endif
+ { 0, 0,
+ sys_nosys }, /* 172 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 173 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 174 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 175 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 176 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 177 = unimplemented sfork */
+ { 0, 0,
+ sys_nosys }, /* 178 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 179 = unimplemented getdescriptor */
+ { 0, 0,
+ sys_nosys }, /* 180 = unimplemented setdescriptor */
+ { 1, s(struct sys_setgid_args),
+ sys_setgid }, /* 181 = setgid */
+ { 1, s(struct sys_setegid_args),
+ sys_setegid }, /* 182 = setegid */
+ { 1, s(struct sys_seteuid_args),
+ sys_seteuid }, /* 183 = seteuid */
+#ifdef LFS
+ { 3, s(struct lfs_bmapv_args),
+ lfs_bmapv }, /* 184 = lfs_bmapv */
+ { 3, s(struct lfs_markv_args),
+ lfs_markv }, /* 185 = lfs_markv */
+ { 2, s(struct lfs_segclean_args),
+ lfs_segclean }, /* 186 = lfs_segclean */
+ { 2, s(struct lfs_segwait_args),
+ lfs_segwait }, /* 187 = lfs_segwait */
+#else
+ { 0, 0,
+ sys_nosys }, /* 184 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 185 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 186 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 187 = unimplemented */
+#endif
+ { 2, s(struct sys_stat_args),
+ sys_stat }, /* 188 = stat */
+ { 2, s(struct sys_fstat_args),
+ sys_fstat }, /* 189 = fstat */
+ { 2, s(struct sys_lstat_args),
+ sys_lstat }, /* 190 = lstat */
+ { 2, s(struct sys_pathconf_args),
+ sys_pathconf }, /* 191 = pathconf */
+ { 2, s(struct sys_fpathconf_args),
+ sys_fpathconf }, /* 192 = fpathconf */
+ { 0, 0,
+ sys_nosys }, /* 193 = unimplemented */
+ { 2, s(struct sys_getrlimit_args),
+ sys_getrlimit }, /* 194 = getrlimit */
+ { 2, s(struct sys_setrlimit_args),
+ sys_setrlimit }, /* 195 = setrlimit */
+ { 4, s(struct sys_getdirentries_args),
+ sys_getdirentries }, /* 196 = getdirentries */
+ { 7, s(struct sys_mmap_args),
+ sys_mmap }, /* 197 = mmap */
+ { 0, 0,
+ sys_nosys }, /* 198 = __syscall */
+ { 4, s(struct sys_lseek_args),
+ sys_lseek }, /* 199 = lseek */
+ { 3, s(struct sys_truncate_args),
+ sys_truncate }, /* 200 = truncate */
+ { 3, s(struct sys_ftruncate_args),
+ sys_ftruncate }, /* 201 = ftruncate */
+ { 6, s(struct sys___sysctl_args),
+ sys___sysctl }, /* 202 = __sysctl */
+ { 2, s(struct sys_mlock_args),
+ sys_mlock }, /* 203 = mlock */
+ { 2, s(struct sys_munlock_args),
+ sys_munlock }, /* 204 = munlock */
+ { 0, 0,
+ sys_nosys }, /* 205 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 206 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 207 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 208 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 209 = unimplemented */
+ { 0, 0,
+ sys_nosys }, /* 210 = unimplemented */
+};
+
diff --git a/sys/compat/bsdos/files.bsdos b/sys/compat/bsdos/files.bsdos
new file mode 100644
index 00000000000..bbca06e376a
--- /dev/null
+++ b/sys/compat/bsdos/files.bsdos
@@ -0,0 +1,11 @@
+# $OpenBSD: files.bsdos,v 1.1 1997/09/02 08:54:16 downsj Exp $
+#
+# Config file description for machine-independent BSD/OS compat code.
+# Included by ports that need it.
+
+# ports should define any machine-specific files they need in their
+# own file lists.
+
+file compat/bsdos/bsdos_exec.c compat_bsdos
+file compat/bsdos/bsdos_sysent.c compat_bsdos
+file compat/bsdos/bsdos_syscalls.c compat_bsdos
diff --git a/sys/compat/bsdos/syscalls.conf b/sys/compat/bsdos/syscalls.conf
new file mode 100644
index 00000000000..ee3429c77f6
--- /dev/null
+++ b/sys/compat/bsdos/syscalls.conf
@@ -0,0 +1,12 @@
+# $OpenBSD: syscalls.conf,v 1.1 1997/09/02 08:54:17 downsj Exp $
+
+sysnames="bsdos_syscalls.c"
+sysnumhdr="bsdos_syscall.h"
+syssw="bsdos_sysent.c"
+sysarghdr="bsdos_syscallargs.h"
+compatopts=""
+libcompatopts=""
+
+switchname="bsdos_sysent"
+namesname="bsdos_syscallnames"
+constprefix="BSDOS_SYS_"