Commit Graph

2271 Commits

Author SHA1 Message Date
manu 26aff33a7d Typo fix 2002-02-03 17:41:03 +00:00
manu 5c72031257 Added system calls: gettimeofday, getitimer, setitimer 2002-02-03 17:39:54 +00:00
manu 5b436803dd Removed the hack in mapelf to get libX11 loading. The new version assumes
that the load addresses in the section array are increasing, and that no
section in the array overlap with each other. IRIX proably makes the same
assumptions, but this has not been tested.

The key point with relocation is to always use the same offset for each
section. Because userland gets only the load address off the first section, it
has to assume that all the remaining sections kept the same offset with
respect to the first section. By using fixed offset instead of finding
some free space for each section, we can eliminate the libX11 load hack.
2002-02-03 17:28:19 +00:00
manu 98f3287e7d Added some system calls: gethostname, sethostname, getdomainname,
setdomainname, alarm
2002-02-03 01:21:47 +00:00
manu 4aa2e3fde7 Fixed the X11 load bug. dynamic linking now seems to be fully functionnal,
even for program with a DSO using overlapping load virtual addresses.

The fix is a mean hack, see the comments in irix_syssgi.c. It would be nice to
get uvm_map_findspace() to return the page we suggest instead of the page which
is 16384 bytes away.
2002-02-02 19:27:18 +00:00
bjh21 043db35f0a cpu_cache_syncI_rng -> cpu_icache_sync_range 2002-02-02 16:53:39 +00:00
bjh21 c738201135 We shouldn't need an icache sync when catching a signal, so don't bother. 2002-02-02 16:52:45 +00:00
bjh21 2667358f8e Get rid of "unused variable" warnings on arm26. 2002-02-02 16:30:28 +00:00
bjh21 70017578a1 Regen (breakpoint() implemented). 2002-01-27 15:28:22 +00:00
bjh21 8c36606f84 Add support for breakpoints to ARMLinux emulation. 2002-01-27 15:27:33 +00:00
bjh21 4929dc576f Add support for PTRACE_GETREGS and PTRACE_SETREGS in ARMLinux emulation. 2002-01-27 15:11:38 +00:00
bjh21 bf73a232ce Regen (prototype for linux_sys_nosys()). 2002-01-27 14:09:38 +00:00
bjh21 71953fb155 Make syscall 0 an explicit call of linux_sys_nosys, as it is on i386. This
is necessary to get a prototype for linux_sys_nosys generated in syscallargs.h.
2002-01-27 14:08:56 +00:00
bjh21 3985634329 Regen (sys_nosys -> linux_sys_nosys). 2002-01-23 16:14:45 +00:00
bjh21 6add1ec812 sys_nosys="linux_sys_nosys", since that's how it should be. 2002-01-23 16:14:20 +00:00
bjh21 6b940e1484 Regen (cacheflush() and remove syscall 0). 2002-01-23 15:55:51 +00:00
bjh21 8b78e49ada Syscall 0 isn't syscall() on ARMLinux. Mark it UNIMPL instead. 2002-01-23 15:54:34 +00:00
bjh21 8a3c27fbf7 Add support for the ARM-specific syscalls in ARMLinux. These are invoked
by SWI numbers above 0x9f0000, but we re-map them down to somewhere just
after the end of the usual syscall range, since NetBSD doesn't handle
sparse syscall arrays well.

The only syscall I've actually implemented in this range is cacheflush(),
which was previously being mapped to fork(), causing ... interesting results.
2002-01-23 15:52:58 +00:00
manu 5e54c68a88 Fixed a bug introduced in the previous fix to mapelf:
we used load_psection, then ran each vmcmd and tried to relocate the failing
ones. This fails if there is two vmcmd for one section, and the second is
not a mapping (for instance a map_pagedvn and a map_zero), because the first
one gets relocated, but not the second one.

Additionnaly, it was not necessary to update the userlevel psection array:
libc stubs seems to do the job themselves.
2002-01-21 21:51:31 +00:00
manu ddd039179b Fixes the problem with libX11.so mapping by syssgi(MAPELF): the load address
for the text section of libx11.so was overlapping with other ELF sections
aloready loaded, and this resulted into an ENOMEM error.

syssgi(MAPELF) uses elf32_load_psection() from syssrc/sys/kern/exec_subr.c
The problem was never experienced with load_psection() because it only has
to load one section, hence the requested address are not already allocated.

The fix is done when the initial mapping at the default address fails by
finding a free location in the VM space using uvm_map_findspace(), and then
retrying to load the section.

Other details:
- once the ELF section has been relocated, the ELF program header must be
updated with the new address and copied back to userland. For now we always
do it, maybe we could copy it only when it was modified.
- We are able to emulate the exact address where IRIX loads libX11.so instead
of the default location
2002-01-19 14:56:02 +00:00
bjh21 6ad60873c2 More-or-less working signal handling for Linux processes on ARM. 2002-01-17 22:50:38 +00:00
bjh21 72e7652233 Fix typo in last commit. 2002-01-17 21:19:22 +00:00
bjh21 934715db90 Fix unterminated #ifdef. 2002-01-17 21:17:57 +00:00
bjh21 16ee93eb67 On platforms that don't __HAVE_SYSCALL_INTERN, define LINUX_SYSCALL_FUNCTION
to be the value of emul_linux.e_syscall that we want.  This allows it to differ
between machines, so I can have a separate linux_syscall() on arm.
2002-01-17 17:19:03 +00:00
rjs 01529df446 Include arch/arm/linux_errno.h for arm build. 2002-01-17 15:11:38 +00:00
rjs 0046c56309 Add arm to #endif comment. 2002-01-17 15:10:26 +00:00
rjs 77f9569791 Add extra error codes from Linux. 2002-01-17 15:08:44 +00:00
bjh21 4a4d63e6c0 Regen. 2002-01-15 10:23:35 +00:00
bjh21 9f08648c7d Shuffle uname calls around. It turns out we don't use the same names as
Linux does, so:
sys_olduname -> linux_sys_oldolduname
sys_uname    -> linux_sys_olduname
sys_newuname -> linux_sys_uname
2002-01-15 10:21:46 +00:00
bjh21 2fdddc2550 Generated files for ARMLinux binary compatibility. 2002-01-14 23:17:16 +00:00
bjh21 23a5fe8d9b Remove old ARMLinux binary compatibility fragment. As far as I know, this
was never used.
2002-01-14 23:15:58 +00:00
bjh21 6462506466 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
2002-01-14 23:14:32 +00:00
manu c8d430d60d missing include 2002-01-07 23:12:30 +00:00
manu 0b98511d4a Added code to match and launch n32 binaries (there is no N32 support in the
kernel yet)
2002-01-07 22:05:03 +00:00
manu 3b176652b8 Fixed wrong file name. 2002-01-06 21:43:10 +00:00
manu 365eb49355 Added compat/irix/irix_syscallnames.c 2002-01-06 21:34:30 +00:00
mrg 9191aacdb4 regen 2002-01-03 15:30:08 +00:00
mrg 5d231c5624 ooops, socket() and socketpair() need args now. 2002-01-03 15:28:43 +00:00
mrg fa38881ffa fix error in previous; pointed out by andrew brown. 2002-01-03 15:28:13 +00:00
mrg 3f49c27162 clean up 2002-01-03 06:43:23 +00:00
mrg 5d06ed3c94 move sparc specific ioctl handling (fb & openprom) into arch/sparc64. 2002-01-03 02:29:39 +00:00
mrg af640de164 move the COMPAT_SUNOS SO_BROADCAST hack out of uipc_socket.c into the
compat/sunos code.  besides being cleaner this allows the sunos LKM
to properly work without any special kernel hacks.
2002-01-03 00:59:00 +00:00
manu daf979dbeb Added symlink, rename and readlink 2001-12-27 11:07:23 +00:00
manu a965f74abe getpgid implemented 2001-12-27 09:31:09 +00:00
manu 2faf78e180 Reworked irix_syssgi_mapelf. It now uses elf_load_psection, and this
remove the odd bug which caused INSANE_DEBUG_IRIX to be mandatory in
order to avoid a panic when mapping libraries.
2001-12-26 22:18:25 +00:00
manu 945d746288 integrated a copy of svr4_waitsys(), which should be merged later.
This has not been fully tested, but it makes IRIX's /bin/sh able to survive
running an external command such as ls.
2001-12-26 11:04:20 +00:00
manu aeeecdfad1 Updated copyright (getdents code is from Christos, written in 1994) 2001-12-26 10:54:56 +00:00
manu 9423df444f Added accept, bind, connect, getpeername, getsockname, listen, recv, recvfrom,
recvmsg, select, send, sendmsg, sendto, setsockopt, shutdown, socket, readv,
and writev. IRIX's telnet now works.
2001-12-25 21:32:30 +00:00
manu ae9b01a907 Added getcontext/setcontext. This has not been fully tested, but it seems to
work enough for binaries that use it (eg: telnet).
Problems:
- what should we do with uc_filler?
- how to handle FP regs?
2001-12-25 19:04:18 +00:00
manu 0d7961013d Added irix_sys_lseek64() 2001-12-25 16:40:48 +00:00
mycroft cbfac6596e Make SNDCTL_DSP_POST a nop. It's explicitly *not* supposed to sleep, and as
it's merely advisory (and in fact is implemented as a nop in the OSS->ALSA
shim), it should be safe to ignore it.
2001-12-24 00:10:46 +00:00
manu e398957bea more UNIMPL IRIX system calls in the table... 2001-12-23 20:57:30 +00:00
manu b8f46be2f6 Added getdents/ngetdents. 2001-12-23 20:15:03 +00:00
manu aa8fce41ef implemented enough of getmountid to make commands using IRIX Universal Name
Service happy. Code in libc attempts to open files in the ns filesystem, and
then uses getmountid on failure to ensure that the ns filesystem is really
mounted. We don't emulate the ns filesystem yet, but getmountid now correctly
reports that ns is not present.
Note: It seems that the mountid of the ns filesystem should always be
00000005 00000000 00000000 7fff3000
2001-12-22 14:43:43 +00:00
manu cc381b2d11 implemented fxstat and lxstat. Fixed a bug in xstat (ino_t was wrong) 2001-12-22 12:09:20 +00:00
manu 7b2952c16e More TrustedIRIX stuff (not emulated, but we don't return EINVAL anymore) 2001-12-22 09:35:11 +00:00
augustss fa18fdc168 Add some missing ioctl()s. From Tommy Bohlin in PR kern/14414. 2001-12-19 15:20:16 +00:00
elric 0260906a88 Fixed compiler warnings that would occur if DEBUG_MACH was not defined. 2001-12-18 19:43:24 +00:00
tv 8e6f7afb5b MKfoo=no -> NOfoo 2001-12-12 01:48:43 +00:00
thorpej 7767121514 I can't win today -- make this link. 2001-12-10 04:05:23 +00:00
thorpej 06920aef28 Move the code that walks the process's VM map during a coredump
into uvm_coredump_walkmap(), and use callbacks into the coredump
routine to do something with each section.
2001-12-10 01:52:26 +00:00
thorpej d0e51ba7da Fix compilation problems. 2001-12-09 23:08:34 +00:00
chs 8e9cdbbd63 replace "vnode" and "vtext" with "file" and "exec" in uvmexp field names. 2001-12-09 03:07:43 +00:00
manu cebd826075 more sysconf... 2001-12-08 19:29:03 +00:00
manu 4d54359755 Implemented irix_sys_xstat(). This duplicates some code already present
for svr4 compat, maybe these should be merged..
2001-12-08 18:08:04 +00:00
manu e3824c6c59 Added IRIX signal delivery 2001-12-08 11:17:37 +00:00
thorpej 205c159f0e Make the coredump routine exec-format/emulation specific. Split
out traditional NetBSD coredump routines into core_netbsd.c and
netbsd32_core.c (for COMPAT_NETBSD32).
2001-12-08 00:35:25 +00:00
manu 9dfecbefdb Fixed stack setup for argument passing. argc and **argv need to be aligned
on a 16 bytes boundary. To get things done, we currently duplicate a lot of
code from copyargs(), this should be done in a nicer way.
2001-12-04 22:13:41 +00:00
kent 97a959ad4a pecoff_copyargs(): Fix incorrect pointer type of the variable `ap'. 2001-12-03 06:11:33 +00:00
manu 3225f7c7c3 One more thread related command in prctl to make dynamic linking happy 2001-12-02 18:06:59 +00:00
manu 77fa6038d9 Added errno translation 2001-12-02 16:16:57 +00:00
manu ef711afc33 Added enough of prctl emulation so that program do not crash on exit 2001-12-02 09:23:58 +00:00
manu 427b57c20e Added SGI_USE_FP_BCOPY and SGI_TOSSTSAVE commands that are also needed
for dynamic linking
2001-12-02 09:22:39 +00:00
manu cfcac1c4fb Uses svr4_mmap for mmap32 emulation. This will not implement all the
IRIX functionnality, but it should be enough to get dynamic linking working
2001-12-02 08:47:17 +00:00
manu e2898fe96b Added a bit of sysmp() emulation necessary for dynamic linking. 2001-12-02 08:30:10 +00:00
jdolecek 2ff8a38d00 nuke the #include "opt_compat_irix.h", too 2001-12-02 00:46:03 +00:00
tsutsui 1011f9fbcc Don't define COMPAT_SUNOS here. It is defined in opt_compat_sunos.h
and <sys/ioctl.h> and <sys/tty.h> include it properly.

XXX Is this needed for LKM?
2001-12-02 00:35:25 +00:00
manu 0e18d4c1b0 Fixed a typo 2001-12-01 22:19:38 +00:00
manu 11ea5b82d7 Fixed a bug in vmcmdset reuse. IRIX binaries seems to pass syssgi(ELFMAP)
without crashing now.
2001-12-01 22:14:15 +00:00
manu cde20c2503 First implementation of syssgi(SGI_ELFMAP). 2001-11-30 21:56:03 +00:00
briggs 9a0fda91f4 SUNOS_M_NATIVE is now a macro that takes an arg, not a constant. 2001-11-29 18:53:50 +00:00
christos 8fc71f4259 include ioctl_compat.h unconditionally. 2001-11-28 13:46:06 +00:00
manu 2f3a7bf5f8 Need to include <sys/ioctl_compat.h> to build this with COMPAT_IRIX.
Maybe this is needed for COMPAT_SVR4 too, I'm not sure.
2001-11-28 12:02:59 +00:00
manu 7839e13a9c On IRIX, the first 88 system calls are quite plain SVR4, and the 137
remaining are IRIX specific. We know use SVR4 emulation for the first 88
system calls.
2001-11-28 12:00:53 +00:00
oki 3936fc4740 Fixed forgot map .idata section for some binaries. 2001-11-27 17:59:49 +00:00
manu 46f63b37c1 Removed an unused line 2001-11-26 21:44:53 +00:00
manu be8254f3a8 Added code to match IRIX N32 binaries 2001-11-26 21:36:24 +00:00
fredette 7eac246b74 Added support for running 68010 SunOS executables. 2001-11-26 18:15:16 +00:00
jdolecek bf7f67be85 if the LKM support is not compiled in, don't bother using exec_lock
at all, it's only needed in LKM case

use #if defined(LKM) || defined(_LKM) condition for netbsd32_execve.c,
to DTRT when either compiled statically into kernel with LKM support,
or compiled as a LKM
2001-11-23 22:02:39 +00:00
manu 482b5bcec3 Removed unused (commented out) code 2001-11-20 21:50:13 +00:00
manu 675946fd1c Fixed the Linux signal trampoline and linux_sys_sigreturn(). Linux signal
delivery now seems fully functionnal.
2001-11-20 21:37:50 +00:00
jdolecek bf65eb50af add appropriate cast to debug printf 2001-11-18 13:29:29 +00:00
manu 86349adc0d Make it build again after recent MIPS cache code changes 2001-11-17 22:13:38 +00:00
manu cb5cba1cf3 Fixed typos 2001-11-17 20:49:14 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
tv 4dec0efa0b Preload <bsd.own.mk> before .undef DESTDIR. 2001-11-14 22:00:42 +00:00
tv 4446c00002 Undefine DESTDIR; we don't want the special DESTDIR <bsd.lib.mk>
handling for kernel libraries.

XXX this build method should be replaced by something more sane
2001-11-14 21:59:31 +00:00
lukem dab6ef8b56 add RCSIDs (including regeneration of files as appropriate) 2001-11-13 02:07:52 +00:00
atatat 23b1a14d0d compile in the absense of SYSVSHM and SYSVSEM. 2001-11-12 01:23:51 +00:00
christos 50a347501a compile in the absense of SYSVSHM and SYSVSEM. pointed out by @@@. 2001-11-11 21:21:02 +00:00
thorpej e8ee04475d - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings.  Stop overloading VTEXT for this purpose (VTEXT
  also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
  mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
  than making a function call to do this (it no longer makes sense to
  use a function call, since we no longer overload VTEXT with VEXECMAP's
  meaning).

VEXECMAP suggested by Chuq Silvers.
2001-10-30 15:32:01 +00:00
christos 2a64b3cc60 use the copy of path stashed in pack->ep_emul_arg and free it.
also don't allocate the emul path, because it is causing a memory leak.
2001-10-28 04:47:27 +00:00
jdolecek 9f2548a603 Regen:
Hook in minherit(2), fhstatfs(2), fhopen(2), fhstat(2).
Adresses kern/8622 by Paul Shupak.
2001-10-27 10:02:57 +00:00
jdolecek 084e319b3f Hook in minherit(2), fhstatfs(2), fhopen(2), fhstat(2).
Adresses kern/8622 by Paul Shupak.
2001-10-27 10:00:55 +00:00
jdolecek dab7dee0f2 Add a comment regarding the ELFOSABI_FREEBSD thing,
and reformat the condition a bit to avoid nested if
2001-10-27 09:50:22 +00:00
christos 8101253d41 KNF. 2001-10-23 16:43:33 +00:00
christos 9c0bd73ac9 PR/14332: Shingo WATANABE: Regognize new ELFOSABI_FREEBSD branded executables. 2001-10-23 16:41:36 +00:00
manu 948a7fa8ef Fixed some mistakes in signal handling (this is still broken)
Added some code to set linux's uname kernel version to 2.4.0 (usefull for
testing with glibc-2.2). This is currently guarded by a #if 0.
2001-10-14 17:21:47 +00:00
manu abcf0c8406 Fixed a minor problem so that it builds 2001-10-14 17:15:58 +00:00
manu c4210f055f Added Mips 2001-10-14 17:14:07 +00:00
manu aa5da496fa Added socket operations to Linux Mips emulation 2001-10-06 13:32:58 +00:00
manu 2d38e85044 Implements ATOMIC_SET in linux_sys_sysmips 2001-10-06 13:32:18 +00:00
manu 801da94626 Implements parts of sysmips() and fctnl64() emulation 2001-09-30 20:52:40 +00:00
manu a9c8120ff3 Fixes my last commit: only mips really need fcntl64 to work now. i386 and
powerpc could use it later if needed. m68k and alpha should never need it.
2001-09-30 20:44:49 +00:00
martin 62aaf2691e Make i386 kernels compile again.
fcntl64 was still marked UNIMPL, but the implementation existed, causing
a missing prototype warning.
XXX I have no clue if this is the correct fix - someone able to test this
please review it!
2001-09-30 18:57:43 +00:00
manu 238328fb7a Added initial support for fcntl64 system call (file locking is not
implemented)
2001-09-30 16:04:03 +00:00
simonb 8aec0ac7d5 DEBUG kernels fill the registers with garbage on process startup and
Linux program don't like that.  Explicitly zero out the registers for
DEBUG kernels.
2001-09-30 02:36:42 +00:00
simonb 0b8f86120f Define LINUX_ATEXIT_SIGNATURE to enable the atexit_signature test; needed
to run Linux/Alpha binaries.
2001-09-30 02:35:23 +00:00
jdolecek d08f6c6e2e pull <sys/exec.h> to get setregs prototype.
problem noted by Chuck Silvers
2001-09-23 19:32:10 +00:00
manu c56e2ccc5d I'm working on Mips 2001-09-22 21:26:40 +00:00
manu 75e9ab7f5f Enabled Mips Linux emul in header files 2001-09-22 21:25:49 +00:00
manu e302bb5bc5 Enable Mips Linux emulation in header files 2001-09-22 21:24:16 +00:00
manu 40a2d61d92 Fixes for mips support 2001-09-22 21:22:57 +00:00
manu 63d1ca8449 Initial support for running Linux binaries on the Mips. Both static and
dynamic binaries work on 32 bit mips. Signals are completely broken yet,
and ptrace is not supported.
2001-09-22 21:19:10 +00:00
manu a0cca8f7f6 One file that was missing from a previous commit 2001-09-22 21:17:55 +00:00
manu 2207c50687 Fixed errors in header files 2001-09-22 21:15:18 +00:00
manu 84d266e55c More work on Linux compat for Mips: system calls mapping. 2001-09-22 21:14:37 +00:00
manu e7a3ba084e Empty framework for upcoming work on IRIX_COMPAT 2001-09-22 18:51:35 +00:00
thorpej bfaf142ff6 Add sunos32_setregs(), thus making sunos32 compile again. 2001-09-20 20:52:26 +00:00
thorpej 2708743345 Make this compile again. 2001-09-20 20:28:41 +00:00
thorpej e38a2e561a machine/fbio.h -> dev/sun/fbio.h 2001-09-19 18:10:32 +00:00
jdolecek ef8abe0767 Make the setregs hook emulation-specific, rather than executable
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).
2001-09-18 19:36:32 +00:00
jdolecek 9edaceed67 g/c dead code 2001-09-17 17:47:47 +00:00
jdolecek 6b213f8761 remove superfluous cpu_exec_ecoff_setregs() prototype 2001-09-17 17:46:16 +00:00
wiz 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
fvdl 2c344fe7d9 Allow the old-style sockaddr_in6 for v6 addresses for which the
scope id is irrelevant. Makes netscape6 for Linux work again,
which uses v4-mapped addresses to connect to v4 sites.
2001-09-08 14:19:09 +00:00
chuck 1c06d68731 only include opt_compat_43.h if _KERNEL_OPT defined so lkm compiles 2001-09-08 13:23:09 +00:00
manu 421be662fc Forgotten file in my last commit for removing PowerPC mmap hack in Linux
emulation
2001-09-08 07:13:04 +00:00
manu 6bbacb9d3f Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
2001-09-08 07:09:43 +00:00
wiz 08d1db8111 Fix typo in variable name. 2001-09-08 02:35:25 +00:00
jdolecek a065626465 change LINUX_F_SETFL so that SIGIO handling for sockets
matches more closely
add support for NEW_PIPE to the SIGIO hack
2001-09-04 20:27:29 +00:00
manu 11736debb0 Fixed indent 2001-09-03 21:10:56 +00:00
manu 27d1edf719 Added 64 bits support in header files.
All headers should be common to 32 bits MIPS and 64 bits MIPS now.
2001-09-02 08:39:37 +00:00
manu f914316a09 Fixed indent problems 2001-09-02 07:56:11 +00:00
manu 220d274aa6 Fixed indent problems 2001-09-02 07:27:33 +00:00
manu 54eff3d533 Added some comments 2001-09-02 07:25:58 +00:00
manu b9581b43a2 Fixed an error in a define 2001-09-02 07:24:49 +00:00
manu fbdc500a69 Fixed indent problems 2001-09-02 06:51:15 +00:00
chuck 31ae40ba15 confirmed the code for MID_VAX1K NMAGIC binaries was wrong,
you've got to pad the text just like with 4.3BSD binaries.
fix it.

i have now successfully tested compat-vax1k with real
o/m/z magic binaries from both 4.3BSD and netbsd 1.3.
2001-08-31 18:44:12 +00:00
manu 8e1033bfc3 Enable the GCC signature test so that ld.so will be executable (needed for
Linux's ldd)
2001-08-30 20:41:36 +00:00