Commit graph

1530 commits

Author SHA1 Message Date
Lionel Sambuc 6c61cd5665 Message type for VFS_FCHMOD
Change-Id: I933e5b5a214aa9e7ddb6546b459ef40688e8ca04
2014-07-28 17:05:34 +02:00
Lionel Sambuc 4635162db2 Message type for VFS_FCHDIR
Change-Id: Ie7de90d37a39e89f35438a5b01a9e878a06194b2
2014-07-28 17:05:34 +02:00
Lionel Sambuc 698d2bd2a1 Message type for VFS_{,F}CHOWN
Change-Id: Ieb8cef45bfab1e35ad8854038c72b59a4d7bbaad
2014-07-28 17:05:34 +02:00
Lionel Sambuc c869546226 Message type for VFS_CREAT
Change-Id: Ica111f1b2005a6ff42dc3bb59ac3158a2e12678c
2014-07-28 17:05:33 +02:00
Lionel Sambuc cef3ce969a Message type for path related calls.
- Updated system calls VFS_ACCESS, VFS_CHDIR, VFS_CHMOD, VFS_CHROOT,
                        VFS_MKDIR, VFS_OPEN, VFS_RMDIR, VSF_UNLINK

 - Removed M3_STRING and M3_LONG_STRING, which are tied to a specific
   "generic" message, and replaced where needed with M_PATH_STRING_MAX,
   which is tied to the mess_lc_vfs_path message.

Change-Id: If287c74f5ece937b9431e5d95b5b58a3c83ebff1
2014-07-28 17:05:33 +02:00
Lionel Sambuc 96b3577b2c Message type for VFS_MKNOD
Change-Id: Ief8c6664d79c320a70543c10b758b784fdfa7cfd
2014-07-28 17:05:33 +02:00
Lionel Sambuc 6d903b914c Message type for VFS_FCNTL
Change-Id: I079f3d7902cf5501fbc594a5610acd370abea095
2014-07-28 17:05:33 +02:00
Lionel Sambuc bb2b07940c Message type for VFS_FSTAT
Change-Id: Ibdedcac120fc4bf78e28291d9c97fe02df1928db
2014-07-28 17:05:33 +02:00
Lionel Sambuc cd0fd5e725 Message type for VFS_{,L}STAT
Change-Id: I61db8484c14f0371214a0495774dc0b1d97f2099
2014-07-28 17:05:33 +02:00
Lionel Sambuc c5b1fc6f0d Message type for VFS_READLINK
Change-Id: I5da187cd22147448daa5a82568f0bd8bdcc2906f
2014-07-28 17:05:32 +02:00
Lionel Sambuc 1db8ecf0e4 Message type for VFS_{LINK,SYMLINK,RENAME}
Change-Id: If4569bac4584e053b7c4816fe47338327175fd44
2014-07-28 17:05:32 +02:00
Lionel Sambuc 74b01e0c2c Message type for VFS_UMASK
Change-Id: Iaf8f83593adbbf50b82feecbe8fad004da2add72
2014-07-28 17:05:32 +02:00
Lionel Sambuc 3bae8fe45a Message type for VFS_PIPE2
Change-Id: I01c599cf035d8f103220baae54fefbc80d12fbd2
2014-07-28 17:05:32 +02:00
Lionel Sambuc befa020a9e Message type for VFS_TRUNCATE
Change-Id: I6f51c979c8986660883221d3acfa07d1c1b25dff
2014-07-28 17:05:32 +02:00
Lionel Sambuc 268d670a85 Message type for VFS_LSEEK
Change-Id: I592284078572e4abf2b181d3b4e8281c9baf8a7b
2014-07-28 17:05:32 +02:00
Lionel Sambuc 9ceebd7a4b Message type for VFS_FSYNC
Change-Id: Iae9d27dbf40bc5567de6c5960f5cbe174be00dbd
2014-07-28 17:05:31 +02:00
Lionel Sambuc feb9b541da Message type for VFS_MAPDRIVER
Change-Id: I979a8769b72cd06efbedf0c6735ac3cd0c4dd2e3
2014-07-28 17:05:31 +02:00
Lionel Sambuc 6fb0c605fd Message type for VFS_COPYFD
Change-Id: I7aff1b9551d3a60b2191de1bac3b695ea06b73ce
2014-07-28 17:05:31 +02:00
Lionel Sambuc 8830643ac3 Message type for VFS_CHECKPERMS
Change-Id: Ie97bb7362d108ebba268c719a6614fc2fe1392cf
2014-07-28 17:05:31 +02:00
Lionel Sambuc a57fc8f683 Message type for VFS_IOCTL
Change-Id: Ibea0fd2f443c1332bf1c9d138840d838bfc81d81
2014-07-28 17:05:31 +02:00
Lionel Sambuc a16ccbaaf8 Message type for VFS_UMOUNT
Change-Id: Ia3b8e818b45a31178215cad77fa0fa3e5325f18a
2014-07-28 17:05:31 +02:00
Lionel Sambuc ecc9010c4b Message type for VFS_MOUNT
Change-Id: I4114f5a1aa4f9efe49a12996722499b695c17230
2014-07-28 17:05:30 +02:00
Lionel Sambuc ad7e3e56c8 Message type for VFS_{,F}STATVFS1
Change-Id: Iaf71cdddb48f64d84773029da2c0666f5462f198
2014-07-28 17:05:30 +02:00
Lionel Sambuc ccdf11c7cf Message type for VFS_GETVFSSTAT
Change-Id: I27f1f6dc37832ee4adb9854c7306ce6153e31567
2014-07-28 17:05:30 +02:00
Lionel Sambuc 7332005370 Message type for VFS_SELECT
Change-Id: Ifd6cb7082dd528f1698a0ca070de447aad85ba60
2014-07-28 17:05:30 +02:00
Lionel Sambuc 58b67186c2 Some cleanup in IPC headers and documentation.
- Cleanup of unused macros for VFS - FS protocols
 - Update servers/vfs/README to reflect the new requests names.
 - Alphabetically re-order the message union, as well as minor
   formatting, for readability.

Change-Id: Ief7c38489e93bcf5f795dccbf3a8e10b44b95af4
2014-07-28 17:05:30 +02:00
Lionel Sambuc b6aa3714a1 Remove protocol version of {mode,ino,uid,gid}_t
Now that we have enough room in the message, remove these types.

Change-Id: Ib734c6f0209b259a14a1189b3886b9c8474e1b9a
2014-07-28 17:05:29 +02:00
Lionel Sambuc 56350a991b Message types for VFS read, write & peek
All of these requests share the same message type as at least one server
manages those requests in the same handler, just by checking the actual
type of the request, and then acting upon it.

Change-Id: I17337b4c67ae209523574c22ccc108cf5f1e65e9
2014-07-28 17:05:29 +02:00
Lionel Sambuc 27baf1f58a Message types for VFS bread, bwrite & bpeek
These two request are handled by the same function in some FSes, which
prevents us from using two different kinds of messages.

Change-Id: Ib2fc80bdd56ef67db6b4c51cf8963353a761aab1
2014-07-28 17:05:29 +02:00
Lionel Sambuc a65bf37e3b Message types for VFS chown
Change-Id: I1dc50772fd28b0c698d85922ad0ad3b41dde006c
2014-07-28 17:05:29 +02:00
Lionel Sambuc fd32afa654 Message types for VFS statvfs
Change-Id: If84f53577510399aa1238cfcd0b8aa1fb13c2490
2014-07-28 17:05:29 +02:00
Lionel Sambuc ea84447ccd Message types for VFS chmod
Change-Id: I76e5df4c0a386682e863e640182c59e4ab7e30be
2014-07-28 17:05:29 +02:00
Lionel Sambuc f90ed467fc Message types for VFS mknod
Change-Id: I41772ffe0efc520b3cd204857c33c8c76d81a5a8
2014-07-28 17:05:28 +02:00
Lionel Sambuc 2dc27154ad Message types for VFS mkdir
Change-Id: I05ea5b5e14e28afdfab6edcabc1dc761389f2638
2014-07-28 17:05:28 +02:00
Lionel Sambuc 169e0314ea Message types for VFS unlink & rmdir
These two request are handled by the same function in some FSes, which
prevents us from using two different kinds of messages.

Change-Id: Iede3a0251d8d84ca7f121c56f30f42b045b0c737
2014-07-28 17:05:28 +02:00
Lionel Sambuc df7e2766c5 Message types for VFS stat
Change-Id: I1d40ae7c3c32a4f7b80c82bc2fa8b157b20a6837
2014-07-28 17:05:28 +02:00
Lionel Sambuc 88f2d881a1 Message types for VFS inhibread
Change-Id: I4ce20a4566033593e4784fd278d7ff7fda16dd9d
2014-07-28 17:05:28 +02:00
Lionel Sambuc 6a94be7e63 Message types for VFS putnode
Change-Id: I0802ccaaaa6ee1b4eb96d62b08f9795c790ce39b
2014-07-28 17:05:28 +02:00
Lionel Sambuc afcde4d208 Message types for VFS link
Change-Id: Ibe03e7c9fded7f3764ecbe3e35b92df3662e54a4
2014-07-28 17:05:27 +02:00
Lionel Sambuc 111969b623 Message types for VFS rdlink
Change-Id: Ic077e99fb140a3a1de849f7f761fdfd90961f5d8
2014-07-28 17:05:27 +02:00
Lionel Sambuc 591227dc38 Message types for VFS getdents
Change-Id: I7474d7547f1fd52f4da54754ccfe984ba1a2baa8
2014-07-28 17:05:27 +02:00
Lionel Sambuc 5fb3a3e7d3 Message types for VFS new_driver
Change-Id: If1b6ee2c5beb43e72a69c27dbc32b72525831962
2014-07-28 17:05:27 +02:00
Lionel Sambuc 0d1db99965 Message types for VFS slink
Change-Id: I13975474b924817553101c28591b4c04e8679173
2014-07-28 17:05:27 +02:00
Lionel Sambuc cadcb6d061 Message types for VFS utime
Change-Id: If7e5faa13a824528fd8ca02bd6982e04d48032e9
2014-07-28 17:05:26 +02:00
Lionel Sambuc 135346dfc3 Message types for VFS ftrunc
Change-Id: I593a4d91b1d974f632f6cb4eb23aabee5b65df7b
2014-07-28 17:05:26 +02:00
Lionel Sambuc a725c62a66 Message types for VFS rename
Change-Id: I48a4098c16519e9c104b287d7bdf95ed6a2a7323
2014-07-28 17:05:26 +02:00
Lionel Sambuc 5d682d17ee Message types for VFS flush
Change-Id: Ida7cbff4402bf876603a2153e2784699d93c03ea
2014-07-28 17:05:26 +02:00
Lionel Sambuc 16a3f23203 Message types for VFS mountpoint
Change-Id: I61c5729628b9b9262cc11415591b1b0f25ad04a8
2014-07-28 17:05:26 +02:00
Lionel Sambuc 83cd8ba616 Message types for VFS newnode
Change-Id: I5c0790fc1104182ab08bcae699c60a364833c360
2014-07-28 17:05:26 +02:00
Lionel Sambuc 3f567bdb11 Message types for VFS create
Change-Id: Ibeba338337eb16814b5b25f7135da958e8316a99
2014-07-28 17:05:25 +02:00
Lionel Sambuc 02dc6498da Message types for VFS lookup
Change-Id: Ic4d2a616ebc986c4b405b6b9ee0bd7c3b59e81d2
2014-07-28 17:05:25 +02:00
Lionel Sambuc 398af818df Message types for VFS readsuper
Change-Id: I7aea85d9842459ea454420bb1687d9b8eb597914
2014-07-28 17:05:25 +02:00
Lionel Sambuc 7ad108d1e7 servers/iso9660fs: drop unused function fs_access
As a consequence, remove protect.c which is now empty.

Change-Id: I675f9059510b3a22262f2bab4f18964a5356aa62
2014-07-28 17:05:25 +02:00
Lionel Sambuc 431911c1ff Use fixed size type for on-disk representation
Use fixed size for directory entries records, instead of semantic type
in the struct which is used to access on-disk records.

Change-Id: If8816d367eaa7070ccb17202ffc9047b5aee5d3e
2014-07-28 17:05:24 +02:00
Ben Gras 0b79eac642 mmap: accept non-PROT_WRITE MAP_SHARED mappings
Currently we don't accept writable file mmap()s, as there is no
system in place to guarantee dirty buffers would make it back to
disk. But we can actually accept MAP_SHARED for PROT_READ mappings,
meaning the ranges aren't writable at all (and no private copy is
made as with MAP_PRIVATE), as it turns out a fairly large class of
usage.

	. fail writable MAP_SHARED mappings at runtime
	. reduces some minix-specific patches
	. lets binutils gold build on minix without further patching

Change-Id: If2896c0a555328ac5b324afa706063fc6d86519e
2014-07-28 17:05:20 +02:00
Lionel Sambuc 7d98eee859 usr.bin/make: -j fix
The job option enable the usage of pipes to communicate with sub-makes.

On MINIX, it seems that there is possibility of receiving an EAGAIN on
such reads, even when it had previously been tested for POLLIN using
poll().

This patch is a workaround, by wrapping the read operation within a
do {} while(errno == EAGAIN && ...) loop.

Change-Id: Ia184c4d600efe7218d197820df87761604120862
2014-07-28 17:05:15 +02:00
Lionel Sambuc ac9fa699bd Fix perl build hanging on pipe
Change-Id: Ic1ff95f45c6082b9310b27783190ce8f92c2afad
2014-07-28 17:05:14 +02:00
Ben Gras 013226c417 vfs: call pipe_check before reviving select()
. select callback on close() on a pipe
	  would falsely revive a read-select on
	  the pipe
	. the extra pipe_check catches it
	. fixes the new import of the netbsd
	  make in -j N mode (make jobs that communicate
	  with pipes)
2014-07-28 17:05:14 +02:00
Ben Gras 58b8ff5ffa VFS: add F_FLUSH_FS_CACHE fcntl
This fcntl requests all cached blocks associated with the minor device
number associated with the regular file are invalidated. If the file
is a block special, invalidate the blocks associated with that minor
device instead.

This is to be used for a test that tests unmapped file-mapped memory
ranges whose blocks are not in the cache and therefore must be fetched
from a FS.

Change-Id: Ide914b2e88413aa90bd731ae587ca06fa5f13ebc
2014-07-28 17:05:14 +02:00
Ben Gras 565f13088f make vfs & filesystems use failable copying
Change the kernel to add features to vircopy and safecopies so that
transparent copy fixing won't happen to avoid deadlocks, and such copies
fail with EFAULT.

Transparently making copying work from filesystems (as normally done by
the kernel & VM when copying fails because of missing/readonly memory)
is problematic as it can happen that, for file-mapped ranges, that that
same filesystem that is blocked on the copy request is needed to satisfy
the memory range, leading to deadlock. Dito for VFS itself, if done with
a blocking call.

This change makes the copying done from a filesystem fail in such cases
with EFAULT by VFS adding the CPF_TRY flag to the grants. If a FS call
fails with EFAULT, VFS will then request the range to be made available
to VM after the FS is unblocked, allowing it to be used to satisfy the
range if need be in another VFS thread.

Similarly, for datacopies that VFS itself does, it uses the failable
vircopy variant and callers use a wrapper that talk to VM if necessary
to get the copy to work.

	. kernel: add CPF_TRY flag to safecopies
	. kernel: only request writable ranges to VM for the
	  target buffer when copying fails
	. do copying in VFS TRY-first
	. some fixes in VM to build SANITYCHECK mode
	. add regression test for the cases where
	  - a FS system call needs memory mapped in a process that the
	    FS itself must map.
	  - such a range covers more than one file-mapped region.
	. add 'try' mode to vircopy, physcopy
	. add flags field to copy kernel call messages
	. if CP_FLAG_TRY is set, do not transparently try
	  to fix memory ranges
	. for use by VFS when accessing user buffers to avoid
	  deadlock
	. remove some obsolete backwards compatability assignments
        . VFS: let thread scheduling work for VM requests too
          Allows VFS to make calls to VM while suspending and resuming
          the currently running thread. Does currently not work for the
          main thread.
        . VM: add fix memory range call for use by VFS

Change-Id: I295794269cea51a3163519a9cfe5901301d90b32
2014-07-28 17:05:14 +02:00
Ben Gras 8c277f99f4 PFS: when copy fails, don't change state
. makes it safe to transparently repeate i/o operation on
	  EFAULT
	. needed for future re-issued i/o operation change in VFS

Change-Id: Iea6b29f3bff19002dcd69b30569671768ac17e21
2014-07-28 17:05:13 +02:00
David van Moolenbroek b539f91aba RS: also wait for VM's RS_INIT message
Bug reported by JD Begin.

Change-Id: Idd8c4299f20253fe2d982af319002bfb67af27c6
2014-07-28 17:05:13 +02:00
David van Moolenbroek f199fc0bfe VM: fix corruption from recursive PDE allocation
Change-Id: I6176b849fefca4bed3e92648b0d72ff47658915c
2014-07-28 17:05:13 +02:00
Ben Gras 273c51a7d1 64-bit CDEV_POS
Change-Id: Iecdadf3dd92cc14525961976f51a9eb16a996d62
2014-07-28 17:05:11 +02:00
Ben Gras 3f3e78ef59 64-bit REQ_TRC_START, REQ_TRC_END
Change-Id: I567804209695b5ec0d83a453d93e36cbf8900f1a
2014-07-28 17:05:11 +02:00
Ben Gras e6daf20a69 64-bit VFS_LSEEK_OFF
Change-Id: Ic0b6d65cbde1033462b909436efa92464094f1ec
2014-07-28 17:05:11 +02:00
Ben Gras ed9076ccb4 64-bit VFS_VMCALL_OFFSET
Change-Id: I29725365a199f850420cd0e4e3902cf70dffe9ad
2014-07-28 17:05:10 +02:00
Ben Gras 188a5fde1f 64-bit VFS_TRUNCATE_OFF
Change-Id: I4bd5cc57ddda2525b0bec6f044f35196a2c21f2e
2014-07-28 17:05:10 +02:00
Ben Gras 4694fcc1d5 64-bit RES_FILE_SIZE
Change-Id: Ia17b4b4722f87fb35142948b62d4a8392ded5f73
2014-07-28 17:05:10 +02:00
Ben Gras fdd85c4d08 64-bit RES_SEEK_POS
Change-Id: Id13f06417f2f600db167bec7b33bc825742cae79
2014-07-28 17:05:10 +02:00
Ben Gras 978082bb0d 64-bit REQ_SEEK_POS
Change-Id: I2e51a188b171af0f0a02349e4eccbe78e7cc2e0c
2014-07-28 17:05:10 +02:00
Lionel Sambuc d3d33afe9f Experimental pthread compatibility library
This patch adds pthread compatibility by using libmthread.

To use this with a program using pthreads, you have to replace
  #include <pthread>
with
  #define _MTHREADIFY_PTHREADS
  #include <minix/mthreads>

This also changes the initialization function to be a constructor, which
is implicitly called before the call to main. This allows for
conformance with pthreads, while not paying a high price by checking on
each mthread_* call whether the library has been initialized or not.

As mthread_init is now a constructor, it also has been set as static, and
relevent calls removed from programs using it.

Change-Id: I2aa375db557958d2bee9a70d285aabb990c88f00
2014-07-28 17:05:08 +02:00
Lionel Sambuc 84d9c625bf Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
2014-07-28 17:05:06 +02:00
Ben Gras aae07bc777 <sys/ioccom.h>, <sys/ioctl.h>
. use <sys/ioccom.h> to make ioctls
	. use netbsd <sys/ioctl.h>, include minix ioctls
	. convert to varargs ioctl() like netbsd

Change-Id: Id5165780df48172b28bf0003603516d30d7c1abb
2014-03-03 20:47:06 +01:00
Ben Gras a1e1ae5ade <sys/fcntl.h>, remove O_REOPEN
Change-Id: Id6493f30bb0fec7460d01f357ada9b2c2a4f5eb7
2014-03-03 20:47:06 +01:00
Ben Gras be9fe09e97 x86 multiboot.h
Change-Id: I245564a98fb9e2572b88f8feb7411ad6800a543c
2014-03-03 20:47:05 +01:00
Ben Gras 17587738d3 align <sys/ucontext.h> <sys/uio.h> <sys/un.h>
Change-Id: I70adf01fddf931a3a6931083adaa4bbe647ea6a3
2014-03-03 20:47:03 +01:00
Ben Gras dda632a24f drop the minix_ prefixes for mmap and munmap
also cleanup of various minix-specific changes, cleanup of
mmap-related testing.

Change-Id: I289a4fc50cf8a13df4a6082038d860853a4bd024
2014-03-03 20:47:03 +01:00
Lionel Sambuc 3053b27247 include/limits.h: merged
Replacing SYMLOOP_MAX, SYMLINK_MAX, by _POSIX_SYMLOOP_MAX,
_POSIX_SYMLINK_MAX respectively.

Change-Id: I020c20b0dbf6d44e777879d786a20811f23d1561
2014-03-03 20:47:03 +01:00
Lionel Sambuc b33edbfe7a Removing VFS_UTIMENS_* field macros.
Change-Id: I3be1acfbb77b6e229d784d8dbc3ceec1b26abf90
2014-03-03 20:47:00 +01:00
Lionel Sambuc 301f5f87f0 Renamed m_vm_vfs to m_vm_vfs_mmap.
Stay coherent with the naming scheme of the messages.

Change-Id: Icc0e13a88ec29263502166c0e6eec81cdb974663
2014-03-03 20:47:00 +01:00
Lionel Sambuc 175d3e7eae Changing the message union to anonymous.
This allows us to write things like this:
  message m;
  m.m_notify.interrupts = new_value;

or
  message *mp;
  mp->m_notify.interrupts = new_value;

The shorthands macro have been adapted for the new scheme, and will be
kept as long as we have generic messages being used.

Change-Id: Icfd02b5f126892b1d5d2cebe8c8fb02b180000f7
2014-03-03 20:46:47 +01:00
Lionel Sambuc 4a0199d66d PM_TIME_SEC into 64bit
Change-Id: I609ee8cac7aae8af2c0c0381710433a5df0caebd
2014-03-03 20:45:28 +01:00
Lionel Sambuc 55d9e9954b Extending time_t to 64bits.
Change-Id: Ia96b8bfba19cb8179a0237a7d2122d415c24d73f
2014-03-03 20:45:28 +01:00
Ben Gras 88be7bd333 Use netbsd <sys/mman.h>
Change-Id: I80e9cffc80140383a6faf692248573c64d282b4a
2014-03-03 20:37:27 +01:00
Ben Gras 256829c7e8 <sys/wait.h>
Change-Id: I24605df209d012e99333065428a3ed2752799321
2014-03-02 12:28:32 +01:00
Gerard 78da142dab Replaced common u64.h functions with operators.
Change-Id: I71b7b4879209eeff89ce5748d67102afebf871dc
2014-03-02 12:28:32 +01:00
Lionel Sambuc 37598dccf1 Aligning dev_t to 64bits.
Change-Id: I630f72f8530dd4aaf05c35ca23683ae12c9f8328
2014-03-02 12:28:32 +01:00
Ben Gras 8ccb12bb5a use netbsd <sys/signal.h> and sigset_t
. create signals-related struct message type to store sigset_t
	  directly
	. create notify-specific message types, so the generic NOTIFY_ARG
	  doesn't exist anymore
	. various related test expansions, improvements, fixes
	. add a few error-checks to sigismember() calls
	. rename kernel call specific signals fields to SYS_*

Change-Id: I53c18999b5eaf0cfa0cb25f5330bee9e7ad2b478
2014-03-02 12:28:31 +01:00
Ben Gras 25719b5d92 bigger message
Change-Id: Ie770140c55799bdc3bb8f0ad6994d59938155a1a
2014-03-02 12:28:31 +01:00
Ben Gras 7120f34ec1 drop <minix/termios.h>, use clean <sys/termios.h>
. also implement some netbsd-style tty ioctls
	. also implement SIGINFO
	. also import netbsd stty
	. rename keymap minix CMIN (for ctrl+minus on numeric keypad)
	  to CNMIN; to keep unchanged control character default CMIN in
	  new <sys/ttydefaults.h>
	. convert CS[5678] logic in rs232 driver to explicit setting of LC
	  bits

Change-Id: I9b7d2963fe9aec00fb6e7535ef565b3191fc1c1d
2014-03-02 12:28:20 +01:00
Ben Gras a06e2ab395 big <utmp.h>-inspired netbsd switch
import/switch of:
init, getty, reboot, halt, shutdown, wall, last

changes:
	. change reboot() call to netbsd prototype and args
	. allows pristine <utmp.h>
	. use clean <sys/reboot.h> instead of <minix/reboot.h>
	. implement TIOCSCTTY for use by getty so getty can get
	  controlling terminal from init's child(ren)
	. allow NULL envp for exec

Change-Id: I5ca02cb4230857140c08794bbfeba7df982c58a3
2014-03-01 09:05:02 +01:00
Lionel Sambuc c3fc9df84a Adding ipc_ prefix to ipc primitives
* Also change _orig to _intr for clarity
 * Cleaned up {IPC,KER}VEC
 * Renamed _minix_kernel_info_struct to get_minix_kerninfo
 * Merged _senda.S into _ipc.S
 * Moved into separate files get_minix_kerninfo and _do_kernel_call
 * Adapted do_kernel_call to follow same _ convention as ipc functions
 * Drop patches in libc/net/send.c and libc/include/namespace.h

Change-Id: If4ea21ecb65435170d7d87de6c826328e84c18d0
2014-03-01 09:05:01 +01:00
David van Moolenbroek 24ec0d73b5 Clean up interface to PM and VFS
- introduce new call numbers, names, and field aliases;
- initialize request messages to zero for all ABI calls;
- format callnr.h in the same way as com.h;
- redo call tables in both servers;
- remove param.h namespace pollution in the servers;
- make brk(2) go to VM directly, rather than through PM;
- remove obsolete BRK, UTIME, and WAIT calls;
- clean up path copying routine in VFS;
- move remaining system calls from libminlib to libc;
- correct some errno-related mistakes in libc routines.

Change-Id: I2d8ec5d061cd7e0b30c51ffd77aa72ebf84e2565
2014-03-01 09:05:01 +01:00
David van Moolenbroek 2c8310fce6 VFS: store m_out as part of worker thread state
There is no need to pass pointers around when there is a structure
available that already stores other similar state, such as m_in.

Change-Id: I3164c5c55c71f443688103d1f0756c086eb05974
2014-03-01 09:05:00 +01:00
David van Moolenbroek d8106f7f1d Rename VFS_BASE to FS_BASE
The recipients of these requests are file systems, not VFS.

Change-Id: I49211cfe4289df25b0c07171c7f8c321fc3731d6
2014-03-01 09:05:00 +01:00
David van Moolenbroek 87c599da2d PM/VFS protocol: prefix with VFS_PM_
These calls are sent to VFS, and thus should be prefixed with VFS_.
Clean up the protocol and PM's main function a bit.

Since the protocol is substantially big and different from normal VFS
requests, this protocol retains its own numbering range for now.

Change-Id: Ia62104b5c5c929ed787144816d2e4cc70bed3b0b
2014-03-01 09:05:00 +01:00
David van Moolenbroek 44d3230e40 For common calls, give servers unique call numbers
The getsysinfo(2), getrusage(2), and svrctl(2) calls used the same
call number to different services. Since we want to give each service
its own call number ranges, this is no longer tenable. This patch
introduces per-service call numbers for these calls.

Note that the remainder of the COMMON_ range is left intact, as these
the remaining requests in it are processed by SEF and thus server-
agnostic. The range should really be prefixed with SEF_ now.

Change-Id: I80d728bbeb98227359c525494c433965b40fefc3
2014-03-01 09:05:00 +01:00
David van Moolenbroek 80bd109cd3 libsys: various updates
- move system calls for use by services from libminlib into libsys;
- move srv_fork(2) and srv_kill(2) from RS and into libsys;
- replace getprocnr(2) with sef_self(3);
- rename previous getnprocnr(2) to getprocnr(2);
- clean up getepinfo(2);
- change all libsys calls that used _syscall to use _taskcall, so as
  to avoid going through errno to pass errors; this is already how
  most calls work anyway, and many of the calls previously using
  _syscall were already assumed to return the actual error;
- initialize request messages to zero, for future compatibility
  (note that this does not include PCI calls, which are in need of a
  much bigger overhaul, nor kernel calls);
- clean up more of dead DS code as a side effect.

Change-Id: I8788f54c68598fcf58e23486e270c2d749780ebb
2014-03-01 09:05:00 +01:00
David van Moolenbroek efd3487bc5 PM: send replies immediately
The original delayed reply functionality was there to support swapping
in processes as they are unblocked, but swap support is long gone.
These days, this code only incurs overhead and hides bugs.

Change-Id: I4aebcd80719daa1bec45ac91975ddc9a460d74d4
2014-03-01 09:05:00 +01:00