2003-01-18 10:36:56 +03:00
|
|
|
/* $NetBSD: hpux_exec.c,v 1.35 2003/01/18 07:36:56 thorpej Exp $ */
|
1997-10-05 22:26:38 +04:00
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Jason R. Thorpe.
|
|
|
|
*
|
|
|
|
* 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 NetBSD
|
|
|
|
* Foundation, Inc. and its contributors.
|
|
|
|
* 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
|
|
|
*/
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1993, 1994 Christopher G. Demetriou
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Glue for exec'ing HP-UX executables and the HP-UX execv() system call.
|
|
|
|
* Based on sys/kern/exec_aout.c
|
|
|
|
*/
|
|
|
|
|
2001-11-13 05:07:52 +03:00
|
|
|
#include <sys/cdefs.h>
|
2003-01-18 10:36:56 +03:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: hpux_exec.c,v 1.35 2003/01/18 07:36:56 thorpej Exp $");
|
2001-11-13 05:07:52 +03:00
|
|
|
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
#include <sys/proc.h>
|
1996-10-14 10:53:23 +04:00
|
|
|
#include <sys/exec.h>
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
#include <sys/malloc.h>
|
|
|
|
#include <sys/mount.h>
|
|
|
|
#include <sys/namei.h>
|
|
|
|
#include <sys/user.h>
|
|
|
|
#include <sys/vnode.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
|
|
#include <machine/cpu.h>
|
|
|
|
#include <machine/reg.h>
|
|
|
|
|
2003-01-18 10:36:56 +03:00
|
|
|
#include <sys/sa.h>
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
#include <sys/syscallargs.h>
|
|
|
|
|
|
|
|
#include <compat/hpux/hpux.h>
|
|
|
|
#include <compat/hpux/hpux_util.h>
|
|
|
|
#include <compat/hpux/hpux_syscall.h>
|
|
|
|
#include <compat/hpux/hpux_syscallargs.h>
|
|
|
|
|
1996-01-06 15:44:06 +03:00
|
|
|
#include <machine/hpux_machdep.h>
|
|
|
|
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
extern struct sysent hpux_sysent[];
|
2000-11-14 00:32:15 +03:00
|
|
|
extern const char * const hpux_syscallnames[];
|
2000-12-15 01:55:36 +03:00
|
|
|
extern char sigcode[], esigcode[];
|
1998-11-09 18:35:16 +03:00
|
|
|
extern int native_to_hpux_errno[];
|
2002-07-13 12:28:40 +04:00
|
|
|
#ifdef __HAVE_SYSCALL_INTERN
|
|
|
|
void hpux_syscall_intern __P((struct proc *));
|
|
|
|
#else
|
2000-12-09 15:38:23 +03:00
|
|
|
void syscall __P((void));
|
2002-07-13 12:28:40 +04:00
|
|
|
#endif
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
|
2000-11-21 03:37:49 +03:00
|
|
|
const struct emul emul_hpux = {
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
"hpux",
|
2000-12-01 15:28:30 +03:00
|
|
|
"/emul/hpux",
|
2002-11-10 23:59:03 +03:00
|
|
|
#ifndef __HAVE_MINIMAL_EMUL
|
2001-06-17 01:44:27 +04:00
|
|
|
0,
|
1998-10-24 23:04:19 +04:00
|
|
|
native_to_hpux_errno,
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
HPUX_SYS_syscall,
|
2002-11-01 22:26:21 +03:00
|
|
|
HPUX_SYS_NSYSENT,
|
2002-11-10 23:59:03 +03:00
|
|
|
#endif
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
hpux_sysent,
|
|
|
|
hpux_syscallnames,
|
2000-12-15 01:55:36 +03:00
|
|
|
hpux_sendsig,
|
2001-06-18 06:00:48 +04:00
|
|
|
trapsignal,
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
sigcode,
|
|
|
|
esigcode,
|
2001-09-18 23:36:32 +04:00
|
|
|
hpux_setregs,
|
2000-12-09 15:38:23 +03:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2002-07-13 12:28:40 +04:00
|
|
|
#ifdef __HAVE_SYSCALL_INTERN
|
- Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.
- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports
- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));
- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
2002-09-22 01:14:54 +04:00
|
|
|
hpux_syscall_intern,
|
2002-08-02 12:43:09 +04:00
|
|
|
#else
|
- Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.
- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports
- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));
- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
2002-09-22 01:14:54 +04:00
|
|
|
syscall,
|
2002-07-13 12:28:40 +04:00
|
|
|
#endif
|
- Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.
- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports
- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));
- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
2002-09-22 01:14:54 +04:00
|
|
|
NULL,
|
|
|
|
NULL,
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The HP-UX execv(2) system call.
|
|
|
|
*
|
|
|
|
* Just check the alternate emulation path, and pass it on to the NetBSD
|
|
|
|
* execve().
|
|
|
|
*/
|
|
|
|
int
|
2003-01-18 10:36:56 +03:00
|
|
|
hpux_sys_execv(l, v, retval)
|
|
|
|
struct lwp *l;
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
|
|
|
struct hpux_sys_execv_args /* {
|
1999-02-09 23:21:18 +03:00
|
|
|
syscallarg(const char *) path;
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
syscallarg(char **) argv;
|
|
|
|
} */ *uap = v;
|
2003-01-18 10:36:56 +03:00
|
|
|
struct proc *p = l->l_proc;
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
struct sys_execve_args ap;
|
|
|
|
caddr_t sg;
|
|
|
|
|
2002-03-16 23:43:48 +03:00
|
|
|
sg = stackgap_init(p, 0);
|
2000-12-01 15:28:30 +03:00
|
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
|
|
|
|
SCARG(&ap, path) = SCARG(uap, path);
|
|
|
|
SCARG(&ap, argp) = SCARG(uap, argp);
|
|
|
|
SCARG(&ap, envp) = NULL;
|
|
|
|
|
2003-01-18 10:36:56 +03:00
|
|
|
return sys_execve(l, &ap, retval);
|
Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
* Make use of "/emul/hpux" where applicable.
* Untangle a bit, pulling some funtions from the monolithic
hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
* Fix a couple of bugs.
Yet to do:
* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
* Make everything work properly (you laugh...)
These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends. Dynamically linked executables work, and
demand-paging _seems_ to work properly. Major problems:
* socket and/or signal handling appears to need some work yet.
* 99% sure I didn't do exactly the right thing adjusting for the
fact that "kstack" is gone now.
* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
causes the HP-UX executable to dump core with a SIGSEGV for an
as of yet unknown reason.
This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves. It's certainly
better off now than before.
1995-11-28 11:39:45 +03:00
|
|
|
}
|
1996-09-03 07:12:17 +04:00
|
|
|
|
|
|
|
int
|
2003-01-18 10:36:56 +03:00
|
|
|
hpux_sys_execve(l, v, retval)
|
|
|
|
struct lwp *l;
|
1996-09-03 07:12:17 +04:00
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
|
|
|
struct hpux_sys_execve_args /* {
|
1999-02-09 23:21:18 +03:00
|
|
|
syscallarg(const char *) path;
|
1996-09-03 07:12:17 +04:00
|
|
|
syscallarg(char **) argv;
|
|
|
|
syscallarg(char **) envp;
|
|
|
|
} */ *uap = v;
|
2003-01-18 10:36:56 +03:00
|
|
|
struct proc *p = l->l_proc;
|
1996-09-03 07:12:17 +04:00
|
|
|
struct sys_execve_args ap;
|
|
|
|
caddr_t sg;
|
|
|
|
|
2002-03-16 23:43:48 +03:00
|
|
|
sg = stackgap_init(p, 0);
|
2000-12-01 15:28:30 +03:00
|
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
|
1996-09-03 07:12:17 +04:00
|
|
|
|
|
|
|
SCARG(&ap, path) = SCARG(uap, path);
|
|
|
|
SCARG(&ap, argp) = SCARG(uap, argp);
|
|
|
|
SCARG(&ap, envp) = SCARG(uap, envp);
|
|
|
|
|
2003-01-18 10:36:56 +03:00
|
|
|
return sys_execve(l, &ap, retval);
|
1996-09-03 07:12:17 +04:00
|
|
|
}
|