Commit Graph

72 Commits

Author SHA1 Message Date
manu 76084f5561 Added syssgi(PATHCONF), which implements pathconf(2), and syssgi(SETPGID)
which implements setpgid(2).
2002-03-25 20:42:50 +00:00
manu 0e9d73c741 Added support for IRIX kernel var emulation in kmem (not functionnal yet) 2002-03-25 18:43:59 +00:00
manu af187fe983 Added swapctl SC_ADD, SC_REMOVE and SC_SGIADD commands. 2002-03-18 20:34:54 +00:00
manu a8db9077cd Uses the recently introduced uvm_swap_stats() instead of
sys_swapctl(SWAP_STATS). This enable the use of a kernel based
buffer instead of using some temporary memory in the stackgap,
whereas we cannot make sure that the size os the struct swapent array
will fit in it. (it is not known at build time, but the stackgap len
is set at build time).
2002-03-18 17:21:24 +00:00
christos 381e6a7764 make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
2002-03-16 20:43:48 +00:00
manu 431e4d2b95 Added enough of swaptcl() command emulation to get swap -l working. This
is needed by acad (it exec's swap -l to check if swap is enabled)
2002-03-16 13:29:42 +00:00
manu cdab2861e2 Added the IRIX /dev/kmem emulation pseudodevice driver 2002-03-15 17:21:26 +00:00
manu eb3041b4dc I finnally identified syssgi(SGI_FDHI) as the implementation of the
getdtablehi(3) library call. Updated comments and removed the paranoid
diagnostics about this mysterious syssgixi() request.
2002-03-13 20:33:41 +00:00
manu 25f8840ca4 Implements syssgi(FDHI), which seems (it's not documented) to return the
higher open file descriptor plus one. This makes IRIX's find able to work.
2002-03-13 07:54:18 +00:00
manu b2ce645507 Added syssgi(GETGROUPS) and syssgi(SETGROUPS) 2002-03-10 22:36:28 +00:00
manu 911cceb1b7 Added statvfs/fstatvfs 2002-03-10 21:56:24 +00:00
manu 6a48d31676 Fix a bug in the way syssgi(MAPELF) handles relocation: we are supposed to
look for a block of free virtual memory big enough to hold all sections. The
blocks starts at the beginning of the first section and ends at the end of
the last section. In the previous version the block ended at the beginning
of the last section, hence creating situations where there was not enough
free space to map the section.
2002-03-10 19:03:08 +00:00
manu 339682e5f4 Fixed a problem in getmountid emulation: we use the address of a kernel
structure for the mountid, but it is 32/64 bits long only, whereas
mountid is 128 bits long. Because we did not initialize the unused bits to
zero, the mountid was not always unique within a filesystem.

This makes autocad 1.3 able to start up.
2002-03-09 16:05:21 +00:00
manu de4ff85b32 Fixed a bug in getdents64 emulation: we used a struct irix_dirent to hold
the result instead of a strruct irix_dirent64.
2002-03-09 13:32:12 +00:00
manu d77463efde Fixed typo 2002-03-09 13:13:09 +00:00
manu 3523a539eb Attempt to provide support to programs digging the load average out of
/dev/kmem (probably broken at the moment)
2002-03-09 10:52:21 +00:00
manu 28cae7e6d6 Added setreuid/setregid 2002-03-04 22:19:02 +00:00
manu cb99a5f48e Implements SIOCNREAD ioctl (some kind of FIONREAD for sockets only). This
makes X11 binaries able to actually work: most of them were previously hang
in infinite loop wiaiting for data from the X server because SIOCNREAD
reported that some data where to be read whereas the X server had nothing
to say.

Tested (and works): xlogo, xterm, ghostview (IRIX build). Things are getting
interesting...
2002-03-03 20:12:17 +00:00
manu 63b308a593 FIxed typo 2002-02-23 22:43:56 +00:00
manu d2e60e82f8 Fixed various sysconf() commands 2002-02-23 22:35:15 +00:00
manu a9c374ed26 Added munmap() and mprotect() 2002-02-21 22:15:28 +00:00
manu 89e46d8a99 Reworked the o32/n32 matching scheme. IRIX uses some e_flags in the ELF
header to distinguish between o32, n32 and n64 ABIs. We now use this.
This suppress the need of the mips_option test, which had some fake positive.
This also removes the mandatory ordering of n32 vs o32 in the exec switch
(exec_conf.c)
2002-02-21 21:53:00 +00:00
manu 9d16e4d12b Added gethostid/sethostid and the HOSTID command to systeminfo() 2002-02-21 11:09:43 +00:00
manu 25e8963ed3 Fixed typo 2002-02-20 21:18:18 +00:00
manu 457750dabf Implemented irix_sys_systeminfo() 2002-02-17 22:49:53 +00:00
manu d383f72720 reworked signal handling:
- do not save/and restore registers that should not be saved and restore
- do give an accurate sigcontext pointer to the signal handler
- do use the struct sigreturna from IRIX.
This eliminates panics and hangs in certain circonstances

Also some cosmetic changes with tabs usage
2002-02-17 20:50:06 +00:00
manu 853adfc30b - implement SGI_GETSID command for syssgi()
- reworked SGI_GETPGID implementation to use the getpgid() system call instead
  of duplicating it.
2002-02-17 20:44:17 +00:00
manu 5ad92b8294 Fixed irix_blkcnt_t size (was 64 bit, changed to 32). This caused alignment
troubles in struct stat, hence giving wrong st_blocks, st_blksize and st_size
values.
2002-02-12 23:11:58 +00:00
manu bd184209e6 Correctly translate the st_rdev field in struct stat 2002-02-12 07:17:18 +00:00
manu b778bba3d3 Added system calls: getdents64/ngetdents64 2002-02-04 20:26:34 +00:00
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
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
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
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
manu e398957bea more UNIMPL IRIX system calls in the table... 2001-12-23 20:57:30 +00:00