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.
- Switch all m68k-based ports over to __HAVE_SYSCALL_INTERN.
- Add systrace glue.
- Define struct mdproc in <m68k/proc.h> instead of <machine/proc.h>.
(They were all defined exactly the same anyway, other than a couple
of the MDP_* flags.)
format specific.
Struct emul has a e_setregs hook back, which points to emulation-specific
setregs function. es_setregs of struct execsw now only points to
optional executable-specific setup function (this is only used for
ECOFF).
Async I/O OS specifities should now handled in OS specific code. Linux
has been done, but other emulation should be handled. See case LINUX_F_SETFL
in sys/compat/linux/common/linux_file.c:linux_sys_fcntl() for more details.
The data that has been collected yet:
Net Free Open Linux SunOS AIX OSF1 Darwin
send SIGIO to write end of pipe Y N N N N N Y Y
send SIGIO to read end of pipe Y Y N N N ? Y ?
send SIGIO to write end of socket Y Y Y N N Y Y Y
send SIGIO to read end of socket Y Y Y Y Y ? Y ?
* __HAVE_SYSCALL_INTERN. If this is defined, e_syscall is replaced by
e_syscall_intern, which is called at key places in the kernel. This can be
used to set a MD syscall handler pointer. This obsoletes and replaces the
*_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL. If this is defined, certain (deprecated) elements in
struct emul are omitted.
*_emul_path variables
change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation
remove no longer needed header files
add e_flags and e_syscall to struct emul; these are unsed and empty for now
* move all exec-type specific information from struct emul to execsw[] and
provide single struct emul per emulation
* elf:
- kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
per emulation and contains pointer to respective probe function
- interp is allocated via MALLOC() rather than on stack
- elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
part of appropriate execsw[] entry
* constify couple of structures
A fair bit of this, the m68k core dump and exec goo, can probably be
made into a generic m68k hpux module, eventually.
More to be placed in hpux_machdep.c - keep your eyes peeled...
* 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.