]> Zhao Yanbai Git Server - minix.git/log
minix.git
10 years ago<sys/mount.h>, <sys/statvfs.h>
Ben Gras [Tue, 10 Dec 2013 20:21:49 +0000 (21:21 +0100)]
<sys/mount.h>, <sys/statvfs.h>

Change-Id: I98d4f90b6ca74d3898db158d95faf98605c7c1af

10 years ago<sys/mtio.h>
Ben Gras [Tue, 10 Dec 2013 20:06:43 +0000 (21:06 +0100)]
<sys/mtio.h>

Change-Id: I8629f90393c555f15208833d2b3f9fb6efc541c3

10 years ago<sys/{ipc,sem,shm}.h>
Ben Gras [Tue, 10 Dec 2013 19:19:45 +0000 (20:19 +0100)]
<sys/{ipc,sem,shm}.h>

Change-Id: I0cf021813cb73a01b1c9f9a1b302bde1a2b4ff7e

10 years ago<sys/ttydefaults.h>
Ben Gras [Tue, 10 Dec 2013 19:04:02 +0000 (20:04 +0100)]
<sys/ttydefaults.h>

Change-Id: I237e141e2a6409c7100db4adb14a90fbb46294b4

10 years ago<net/if_ether.h>
Ben Gras [Tue, 10 Dec 2013 18:34:19 +0000 (19:34 +0100)]
<net/if_ether.h>

Change-Id: I7425aae72ab43e3fcec8373f7c589273d36f7fcb

10 years ago<sys/param.h>
Ben Gras [Tue, 10 Dec 2013 17:49:14 +0000 (18:49 +0100)]
<sys/param.h>

Change-Id: I53d0ca207789f27e3a01acdd184ade24630d9a00

10 years ago<sys/ptrace.h>
Ben Gras [Tue, 10 Dec 2013 17:18:13 +0000 (18:18 +0100)]
<sys/ptrace.h>

Change-Id: Ib930c661c1e6de05b2e0d5fce4ffc1ae2269fc6a

10 years agoalign ARM cpu.h importing & using armreg.h
Ben Gras [Tue, 10 Dec 2013 18:51:07 +0000 (19:51 +0100)]
align ARM cpu.h importing & using armreg.h

Change-Id: I4793517d936f71b0bb7088fbfe67e73a65fafb11

10 years ago<vmparam.h>
Ben Gras [Tue, 10 Dec 2013 15:37:00 +0000 (16:37 +0100)]
<vmparam.h>

Change-Id: I941ea3111703ed089bfdaf87d26158ab8697a80d

10 years ago<machine/mcontext.h>
Ben Gras [Tue, 10 Dec 2013 13:55:46 +0000 (14:55 +0100)]
<machine/mcontext.h>

Change-Id: I2ad64018f3f402e7ccc5c4dc037dd0a3fe56a929

10 years agoalign <sys/ucontext.h> <sys/uio.h> <sys/un.h>
Ben Gras [Tue, 10 Dec 2013 08:57:38 +0000 (09:57 +0100)]
align <sys/ucontext.h> <sys/uio.h> <sys/un.h>

Change-Id: I70adf01fddf931a3a6931083adaa4bbe647ea6a3

10 years ago<sys/socket.h>, <netinet/{in,tcp,udp,udp_var}.h>
Ben Gras [Fri, 6 Dec 2013 14:56:45 +0000 (15:56 +0100)]
<sys/socket.h>, <netinet/{in,tcp,udp,udp_var}.h>

. add sa_len to sockaddr, sin_len to sockaddr_in
. rename SCM_CREDENTIALS to SCM_CREDS
. retire PF_FILE (same as PF_UNIX)

Change-Id: Id3ec63fe2556fc7ceb48de8ad4e80736df3ddfc7

10 years agodrop the minix_ prefixes for mmap and munmap
Ben Gras [Fri, 22 Nov 2013 15:38:29 +0000 (16:38 +0100)]
drop the minix_ prefixes for mmap and munmap

also cleanup of various minix-specific changes, cleanup of
mmap-related testing.

Change-Id: I289a4fc50cf8a13df4a6082038d860853a4bd024

10 years agoinclude/sched.h: merged
Lionel Sambuc [Tue, 3 Dec 2013 16:19:46 +0000 (17:19 +0100)]
include/sched.h: merged

Change-Id: Icb38da694db516279a1f45579a593e5369d064bb

10 years agoreduced diff in include/signal.h
Lionel Sambuc [Tue, 3 Dec 2013 12:56:34 +0000 (13:56 +0100)]
reduced diff in include/signal.h

Change-Id: I8df2199e6ac5a429f61079ca8c01fe58bd44ff36

10 years agoinclude/limits.h: merged
Lionel Sambuc [Tue, 3 Dec 2013 12:55:11 +0000 (13:55 +0100)]
include/limits.h: merged

Replacing SYMLOOP_MAX, SYMLINK_MAX, by _POSIX_SYMLOOP_MAX,
_POSIX_SYMLINK_MAX respectively.

Change-Id: I020c20b0dbf6d44e777879d786a20811f23d1561

10 years agoinclude/time.h: merged
Lionel Sambuc [Tue, 3 Dec 2013 10:51:21 +0000 (11:51 +0100)]
include/time.h: merged

 - Defining CLOCKS_PER_SEC = 100, instead of 60.
   This define is here for legacy reasons, use sysconf(_SC_CLK_TCK) to
   retrieve the actual number of clock tick per second of the system in
   new code.

 - Moving stime prototype to minix/sysutil.h

Change-Id: I76a73cd53ac2361845f2917f62af4125adfc615d

10 years agoImporting external/bsd/less
Lionel Sambuc [Tue, 3 Dec 2013 10:35:03 +0000 (11:35 +0100)]
Importing external/bsd/less

Change-Id: I7999b23fbef86a9a5d8d6fe4e80b9bd23d5b9d87

10 years agoadding include/spawn.h, removing include/sa.h
Lionel Sambuc [Mon, 2 Dec 2013 21:07:54 +0000 (22:07 +0100)]
adding include/spawn.h, removing include/sa.h

Change-Id: Ieff4f5e51f98ef5105307e6b8c6ba1dd6f3c844a

10 years agoinclude/unistd.h: merged
Lionel Sambuc [Mon, 2 Dec 2013 19:03:35 +0000 (20:03 +0100)]
include/unistd.h: merged

Also removing lseek64, pread64, pwrite64.

Those functions have lost their "raison d'ĂȘtre", when off_t switched to
64bits.

Change-Id: I5aea35f01d6d10e3d6578a70323da7be5eca315a

10 years agoinclude/a.out.h: merged
Lionel Sambuc [Mon, 2 Dec 2013 17:45:21 +0000 (18:45 +0100)]
include/a.out.h: merged

Change-Id: I1216faaab1f283e1253155fda9e0fe5b821f09f6

10 years agoinclude/netdb.h: merged
Lionel Sambuc [Mon, 2 Dec 2013 17:17:49 +0000 (18:17 +0100)]
include/netdb.h: merged

Change-Id: I899e6ac611b671a78d6abd83a73eed484aa49595

10 years agoinclude/paths.h: merged
Lionel Sambuc [Mon, 2 Dec 2013 17:34:30 +0000 (18:34 +0100)]
include/paths.h: merged

Change-Id: I5e2aa0bc99a596f82ef4224f22623bcb83cb98b5

10 years agoalign include/paths: MAILDIR
Lionel Sambuc [Mon, 2 Dec 2013 17:09:47 +0000 (18:09 +0100)]
align include/paths: MAILDIR

Change-Id: Ieb50549f8f27af957f67fcb0757690db88fecc8b

10 years agoinclude/login_cap.h: merged
Lionel Sambuc [Mon, 2 Dec 2013 16:40:57 +0000 (17:40 +0100)]
include/login_cap.h: merged

Change-Id: Ic1e5189a89a1dae2a06b182a4af6a65a75c7e2ce

10 years agoinclude/stdlib.h: merged
Lionel Sambuc [Mon, 2 Dec 2013 15:49:00 +0000 (16:49 +0100)]
include/stdlib.h: merged

Change-Id: I26b032566d1d7a816df56254c5f9e6dc82626a70

10 years agoinclude/stdio.h: merged
Lionel Sambuc [Mon, 2 Dec 2013 15:25:06 +0000 (16:25 +0100)]
include/stdio.h: merged

Change-Id: I7d5869ce25dfe9f2944ceef86464829d08830d24

10 years agoremove special handling of rename()
Lionel Sambuc [Mon, 2 Dec 2013 15:24:13 +0000 (16:24 +0100)]
remove special handling of rename()

Change-Id: I69694e155250dc5f527dacbaf3f0ecbdc4873989

10 years agoinclude/arpa/nameser_compat.h: merged
Lionel Sambuc [Mon, 2 Dec 2013 15:03:29 +0000 (16:03 +0100)]
include/arpa/nameser_compat.h: merged

Removing compatibility macros, and updating the two tools still using
them.

Change-Id: I636f045d76a8f92440ebe1503f52f7e5d704a316

10 years agosys/sys/ctype_inline.h: merged
Lionel Sambuc [Mon, 2 Dec 2013 14:31:33 +0000 (15:31 +0100)]
sys/sys/ctype_inline.h: merged

Change-Id: I0a04b7729b2226ce601cadceebfb6878302c64d1

10 years agosys/arch/{arm,i386}/include: merges
Lionel Sambuc [Thu, 28 Nov 2013 16:38:55 +0000 (17:38 +0100)]
sys/arch/{arm,i386}/include: merges

The follwoing file have been merged as far as reasonably possible:

 * sys/arch/arm/include/:
   - ansi.h
   - asm.h

 * sys/arch/arm/include/:
   - ansi.h
   - asm.h
   - cdef.h

Unlike on NetBSD, the definition of size_t, ssize_t and ptrdiff_t are
the same as the ones on intel.

Change-Id: I3b52e9c03991e575450ca42567877cd4fd14976a

10 years agoRemoving VFS_UTIMENS_* field macros.
Lionel Sambuc [Thu, 28 Nov 2013 18:33:53 +0000 (19:33 +0100)]
Removing VFS_UTIMENS_* field macros.

Change-Id: I3be1acfbb77b6e229d784d8dbc3ceec1b26abf90

10 years agoRemoving SYS_SIG_* field macros.
Lionel Sambuc [Thu, 28 Nov 2013 18:22:37 +0000 (19:22 +0100)]
Removing SYS_SIG_* field macros.

Change-Id: Ib4f1b48268d4539ae6d4502ad647ecb73ea87f79

10 years agoRenamed m_vm_vfs to m_vm_vfs_mmap.
Lionel Sambuc [Thu, 28 Nov 2013 17:59:46 +0000 (18:59 +0100)]
Renamed m_vm_vfs to m_vm_vfs_mmap.

Stay coherent with the naming scheme of the messages.

Change-Id: Icc0e13a88ec29263502166c0e6eec81cdb974663

10 years agoRemoving NOTIFY_* field macros.
Lionel Sambuc [Thu, 28 Nov 2013 17:37:06 +0000 (18:37 +0100)]
Removing NOTIFY_* field macros.

Change-Id: Idc8604dac9630ee2343476b906b45a115a89994e

10 years agoChanging the message union to anonymous.
Lionel Sambuc [Thu, 28 Nov 2013 17:17:38 +0000 (18:17 +0100)]
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

10 years agoPM_TIME_SEC into 64bit
Lionel Sambuc [Wed, 27 Nov 2013 11:01:26 +0000 (12:01 +0100)]
PM_TIME_SEC into 64bit

Change-Id: I609ee8cac7aae8af2c0c0381710433a5df0caebd

10 years agoUpdating usr.sbin/user
Lionel Sambuc [Fri, 20 Sep 2013 17:47:48 +0000 (19:47 +0200)]
Updating usr.sbin/user

Change-Id: I5968d25f0a0efd590e6d664d3a2d182a87755e3d

10 years agoExtending time_t to 64bits.
Lionel Sambuc [Fri, 20 Sep 2013 17:47:18 +0000 (19:47 +0200)]
Extending time_t to 64bits.

Change-Id: Ia96b8bfba19cb8179a0237a7d2122d415c24d73f

10 years agoFix genmap, always use headers from the sources.
Lionel Sambuc [Thu, 28 Nov 2013 18:42:38 +0000 (19:42 +0100)]
Fix genmap, always use headers from the sources.

This fixes the compilation failure when building on MINIX.

Change-Id: Iaa2ac5d73ce5f4a8219cacbe726e1398bcdb5740

10 years agoUse netbsd <sys/mman.h>
Ben Gras [Thu, 28 Nov 2013 16:51:21 +0000 (17:51 +0100)]
Use netbsd <sys/mman.h>

Change-Id: I80e9cffc80140383a6faf692248573c64d282b4a

10 years ago<sys/stat.h>
Ben Gras [Fri, 22 Nov 2013 15:24:28 +0000 (16:24 +0100)]
<sys/stat.h>

current version of <sys/stat.h> from netbsd repo is older than the minix
one; will be corrected on next netbsd re-import.

Change-Id: Ifc696581ef476cfecd9695a9f6e74b844131e584

10 years ago<sys/unistd.h>, <time.h>
Ben Gras [Fri, 22 Nov 2013 15:20:09 +0000 (16:20 +0100)]
<sys/unistd.h>, <time.h>

Change-Id: If0d0cd9115dec33d27e8e5644c0020021d8816b8

10 years ago<sys/wait.h>
Ben Gras [Fri, 22 Nov 2013 15:03:53 +0000 (16:03 +0100)]
<sys/wait.h>

Change-Id: I24605df209d012e99333065428a3ed2752799321

10 years agoReplaced common u64.h functions with operators.
Gerard [Thu, 21 Nov 2013 11:09:58 +0000 (12:09 +0100)]
Replaced common u64.h functions with operators.

Change-Id: I71b7b4879209eeff89ce5748d67102afebf871dc

10 years agoFix devman boot crash when using image scripts 77/1177/3
Lionel Sambuc [Fri, 22 Nov 2013 12:54:02 +0000 (13:54 +0100)]
Fix devman boot crash when using image scripts

This was caused by a missing line in the generated fstab.

Change-Id: If0590a27706bbb62e53d72f224ccb332e31421f6

10 years agoAligning dev_t to 64bits. 69/1169/5
Lionel Sambuc [Fri, 15 Nov 2013 18:01:25 +0000 (19:01 +0100)]
Aligning dev_t to 64bits.

Change-Id: I630f72f8530dd4aaf05c35ca23683ae12c9f8328

10 years agolibc/sys-minix/mount.c: fix overflow 68/1168/4
Lionel Sambuc [Tue, 19 Nov 2013 14:26:47 +0000 (15:26 +0100)]
libc/sys-minix/mount.c: fix overflow

Fix a bug where a filesystem label could overflow the reserved buffer.
This was already possible with 32 bits values, but is more proeminent
with dev_t being 64 bits.

Change-Id: Idc04ed355d1dd92b7a8ce4699de832661a5c4ccd

10 years agoAligning makedev macros, dev_t still 32bits 67/1167/4
Lionel Sambuc [Fri, 25 Oct 2013 14:59:54 +0000 (16:59 +0200)]
Aligning makedev macros, dev_t still 32bits

Change-Id: Ib343d9b459ff0eeac70c4e54c23fe2e82a137100

10 years agoAdd a compile-time check for IPC messages size 66/1166/4
Lionel Sambuc [Mon, 18 Nov 2013 14:18:18 +0000 (15:18 +0100)]
Add a compile-time check for IPC messages size

This patch adds compile-time check for each message type to ensure the
size is within the IPC assumptions.

This will allow messages specific to a protocol to use from now on the
proper types for each fields, while preventing from any unsuspected
side effect when updating type definitions.

Change-Id: Iad64f81a6b6726321fbc492ac37ceeaaa57aa6cd

10 years agoRemove sys/stdlib.h
Lionel Sambuc [Tue, 12 Nov 2013 15:07:41 +0000 (16:07 +0100)]
Remove sys/stdlib.h

This file was copied over to allow for the compilation of some
of the arch/i386 code, due to a bug in lib/libc/compat/Makefile.inc.

This patch fixes the situation, and removes the now useless header, as
well as remove a patch in lib/libc/stdlib/putenv.c

Change-Id: Ic5e4c4bb967f58f6e874c091788e1dd5ecaebe5e

10 years agouse netbsd <sys/signal.h> and sigset_t
Ben Gras [Tue, 22 Oct 2013 15:08:15 +0000 (17:08 +0200)]
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

10 years agoswitch to netbsd <sys/errno.h>
Ben Gras [Fri, 6 Sep 2013 10:07:47 +0000 (12:07 +0200)]
switch to netbsd <sys/errno.h>

not entirely clean; _SIGN hack remains for now.  also leave in
minix-specific stuff like minix-specific errno's and OK.

Change-Id: I035efc52e27b92f58ae0d88dab19dec263edb6e3

10 years agobigger message
Ben Gras [Thu, 31 Oct 2013 16:29:05 +0000 (17:29 +0100)]
bigger message

Change-Id: Ie770140c55799bdc3bb8f0ad6994d59938155a1a

10 years agodrop <minix/termios.h>, use clean <sys/termios.h>
Ben Gras [Tue, 10 Sep 2013 21:36:48 +0000 (21:36 +0000)]
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

10 years agobig <utmp.h>-inspired netbsd switch
Ben Gras [Mon, 9 Sep 2013 13:20:18 +0000 (13:20 +0000)]
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

10 years agoFix testsh2 for OD on arm.
Lionel Sambuc [Wed, 6 Nov 2013 15:25:23 +0000 (16:25 +0100)]
Fix testsh2 for OD on arm.

Change-Id: I4bbed3b6dcb62e85e75887b9522734abae7307e4

10 years agoAdding ipc_ prefix to ipc primitives
Lionel Sambuc [Fri, 1 Nov 2013 12:34:14 +0000 (13:34 +0100)]
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

10 years agoRemove some legacy support in rc scripts & some cleanup
Lionel Sambuc [Wed, 30 Oct 2013 17:12:35 +0000 (18:12 +0100)]
Remove some legacy support in rc scripts & some cleanup

 * Remove support for the Poor Man fstab
 * Remove checks for the missing ARCH kernel variable
 * Remove .ashrc which is anyway only read once per login
 * Cleanup PATH variable

Change-Id: Ic32e5749fba502dfa38d4d538860e717580bad60

10 years agoRemoving MK{GCCCMDS,BINUTILS}=yes in image scripts
Lionel Sambuc [Wed, 16 Oct 2013 13:12:30 +0000 (15:12 +0200)]
Removing MK{GCCCMDS,BINUTILS}=yes in image scripts

MKGCCCMDS=yes and MKBINUTILS=yes where added on the build command line
while they should have been left to the developer's discretion.

To build and install binutils and gcc do the following:

 $ BUILDVARS='-V MKBINUTILS=yes -V MKGCC=yes -V MKGCCCMDS=yes' \
    ./releasetools/arm_sdimage.sh
or

 $ BUILDVARS='-V MKBINUTILS=yes -V MKGCC=yes -V MKGCCCMDS=yes' \
    ./releasetools/x86_hdimage.sh

Change-Id: Icb46a3422f527747768fa107d14fc19ff3ac0a63

10 years agotoproto: use NetBSD names/types for device numbers
David van Moolenbroek [Thu, 7 Nov 2013 16:51:21 +0000 (16:51 +0000)]
toproto: use NetBSD names/types for device numbers

This should unbreak crossbuilding from Ubuntu 32-bit

Change-Id: I6ead9f8289dba6271c52dace81abffaabe6c8869

10 years agoClean up interface to PM and VFS
David van Moolenbroek [Mon, 4 Nov 2013 21:48:08 +0000 (22:48 +0100)]
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

10 years agoVFS: store m_out as part of worker thread state
David van Moolenbroek [Tue, 29 Oct 2013 22:15:15 +0000 (23:15 +0100)]
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

10 years agoRename VFS_BASE to FS_BASE
David van Moolenbroek [Sat, 2 Nov 2013 15:39:03 +0000 (16:39 +0100)]
Rename VFS_BASE to FS_BASE

The recipients of these requests are file systems, not VFS.

Change-Id: I49211cfe4289df25b0c07171c7f8c321fc3731d6

10 years agoPM/VFS protocol: prefix with VFS_PM_
David van Moolenbroek [Mon, 28 Oct 2013 21:19:40 +0000 (22:19 +0100)]
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

10 years agoFor common calls, give servers unique call numbers
David van Moolenbroek [Mon, 28 Oct 2013 21:30:41 +0000 (22:30 +0100)]
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

10 years agolibsys: various updates
David van Moolenbroek [Sun, 3 Nov 2013 21:33:44 +0000 (22:33 +0100)]
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

10 years agoPM: send replies immediately
David van Moolenbroek [Sun, 27 Oct 2013 17:37:16 +0000 (18:37 +0100)]
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

10 years agoPM: resolve fork/kill race condition
David van Moolenbroek [Tue, 29 Oct 2013 23:39:55 +0000 (00:39 +0100)]
PM: resolve fork/kill race condition

When a process forks, VFS is informed on behalf of the child. This is
correct, because otherwise signals to the new child could get lost.
However, that means that the parent is not blocked from being killed
by a signal while the child is blocked on this VFS call. As a result,
by the time that the VFS reply comes in, the parent may already be
dead, and the child may thus have been assigned a new parent: INIT.

Previously, PM would blindly reply to the parent when the VFS reply
for the fork came in. Thus, it could end up sending a reply to INIT,
even though INIT did not issue the fork(2) call. This could end up
satisfying a different call from INIT (typically waitpid(2)) and then
cause an error when that other call was complete.

It would be possible to set VFS_CALL on both forking parent and child.
This patch instead adds a flag (NEW_PARENT) to note that a process's
parent has changed during a VFS call.

Change-Id: Iad930b2e441db54fe6f7d2fd011f0f6a26e2923d

10 years agoPM: rework signal handling
David van Moolenbroek [Sun, 27 Oct 2013 12:47:45 +0000 (13:47 +0100)]
PM: rework signal handling

- introduce PROC_STOPPED flag, which tracks whether the process is
  stopped on PROC_STOP in the kernel, rather than implicitly deriving
  this from PM_SIG_PENDING;
- make the process resumption test based on current state rather than
  state transitions;
- add and clarify several flag checks in the signal handling code;
- add test79 to test signal handling robustness.

Change-Id: Ic8c7527095035b300b56f2ab1b9dd190bd4bf001

10 years agoPM: remove obsolete ALARM, PAUSE, TIMES calls
David van Moolenbroek [Sat, 26 Oct 2013 23:24:15 +0000 (01:24 +0200)]
PM: remove obsolete ALARM, PAUSE, TIMES calls

NetBSD libc implements these as wrappers around setitimer(2),
sigsuspend(2), and getrusage(2), respectively.

Change-Id: I0c5e725b3e1316bddd3a3ff7ef65d57d30afd10d

10 years agoRemove support for MKTRACE, MKMCONTEXT, MKSTATECTL
David van Moolenbroek [Sat, 26 Oct 2013 23:54:37 +0000 (01:54 +0200)]
Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL

Change-Id: Ib5fa53913ecb7b46d30d391dbdd3e8ef21eb2254

10 years agotest56: fix race condition
David van Moolenbroek [Sun, 27 Oct 2013 18:00:54 +0000 (19:00 +0100)]
test56: fix race condition

Change-Id: Ib8f435f2272fed96e99698ab5030531e733577ca

10 years agoFix missing nm.1 file
Lionel Sambuc [Wed, 6 Nov 2013 17:56:27 +0000 (18:56 +0100)]
Fix missing nm.1 file

Change-Id: Ic0f2a364df5251b4d349c15ea671c6705dada3a9

10 years agonetbsd dirent.h, import sys/sys *.h, mfs cleanup
Ben Gras [Mon, 16 Sep 2013 20:52:36 +0000 (22:52 +0200)]
netbsd dirent.h, import sys/sys *.h, mfs cleanup

. add all sys/sys headers not already present to help compiling
. take netbsd dirent.h and struct dirent; main result is
  introducing d_type and d_namlen that have to be set by getdents()
  in all FS code implementing it
. d_off is gone
. alignment of the struct has become 8 bytes instead of 4
. remove _MAX_BLOCK_SIZE, _MIN_BLOCK_SIZE, _STATIC_BLOCK_SIZE
. libminlib: cleanup unused yet duplicate code
. mfs: throw out the long-broken v1, v2 support
. new test for dirent contents filled by getdents()

Change-Id: I1459755c7ba5e5d1c9396d3a587ce6e63ddc283e

10 years agoVFS: further cleanup of device code
David van Moolenbroek [Sun, 6 Oct 2013 13:58:54 +0000 (15:58 +0200)]
VFS: further cleanup of device code

- all TTY-related exceptions have now been merged into the regular
  code paths, allowing non-TTY drivers to expose TTY-like devices;
- as part of this, CTTY_MAJOR is now fully managed by VFS instead of
  being an ugly stepchild of the TTY driver;
- device styles have become completely obsolete, support for them has
  been removed throughout the system; same for device flags, which had
  already become useless a while ago;
- device map open/close and I/O function pointers have lost their use,
  thus finally making the VFS device code actually readable;
- the device-unrelated pm_setsid has been moved to misc.c;
- some other small cleanup-related changes.

Change-Id: If90b10d1818e98a12139da3e94a15d250c9933da

10 years agoIS: dump number of in-use FDs for VFS
David van Moolenbroek [Sat, 5 Oct 2013 12:59:59 +0000 (14:59 +0200)]
IS: dump number of in-use FDs for VFS

Change-Id: If0e2092d5a8c384c31b1f44cc0591bb119c6d8de

10 years agoTTY: fix earlier PTY select "improvement"
David van Moolenbroek [Fri, 4 Oct 2013 23:40:58 +0000 (01:40 +0200)]
TTY: fix earlier PTY select "improvement"

It was just plain wrong.

Change-Id: Ieab4b4f01d9461e05e0d0ba6427a99d863d6b98d

10 years agoExtend dupfrom(2) into copyfd(2)
David van Moolenbroek [Sat, 5 Oct 2013 14:31:35 +0000 (16:31 +0200)]
Extend dupfrom(2) into copyfd(2)

This single function allows copying file descriptors from and to
processes, and closing a previously copied remote file descriptor.
This function replaces the five FD-related UDS backcalls. While it
limits the total number of in-flight file descriptors to OPEN_MAX,
this change greatly improves crash recovery support of UDS, since all
in-flight file descriptors will be closed instead of keeping them
open indefinitely (causing VFS to crash on system shutdown). With the
new copyfd call, UDS becomes simpler, and the concept of filps is no
longer exposed outside of VFS.

This patch also moves the checkperms(2) stub into libminlib, thus
fully abstracting away message details of VFS communication from UDS.

Change-Id: Idd32ad390a566143c8ef66955e5ae2c221cff966

10 years agoVFS: better dupfrom(2) deadlock detection
David van Moolenbroek [Sat, 5 Oct 2013 10:50:44 +0000 (12:50 +0200)]
VFS: better dupfrom(2) deadlock detection

Change-Id: I29f00075698888c7c8ca60b47ab82fba8c606f4e

10 years agoUDS: sendmsg/recvmsg fixes
David van Moolenbroek [Fri, 4 Oct 2013 19:10:01 +0000 (21:10 +0200)]
UDS: sendmsg/recvmsg fixes

- sendmsg: the accumulation of multiple in-flight file descriptors was
  already described in the comments; now the code actually does what
  the comments say :) -- also, added robustness in case of a failure;
- recvmsg: only create a socket rights message if there are file
  descriptors pending at all;
- recvmsg: copy back the control message length;
- recvmsg: use CMSG_SPACE instead of CMSG_LEN to compute sizes.

Not sure if all of this is now working according to specification,
but at least tmux seems to be happy with it.

Change-Id: I8d076c14c3ff3220b7fea730e0f08f4b4254ede5

10 years agoUDS: add support for FIONREAD
David van Moolenbroek [Fri, 4 Oct 2013 16:41:21 +0000 (18:41 +0200)]
UDS: add support for FIONREAD

Change-Id: I50030012b408242a86f8c55017429acdadff49d1

10 years agoUDS: align struct sockaddr_un with NetBSD
David van Moolenbroek [Fri, 4 Oct 2013 16:00:42 +0000 (18:00 +0200)]
UDS: align struct sockaddr_un with NetBSD

Well, make a start, anyway. Our copy was missing a legacy field from
the structure, that could very well cause applications to fail trying
to set, clear, or check it. As a consequence, SUN_LEN now yields the
same result as on NetBSD.

Change-Id: I80f6aff7769be402b3bd3959f64d314509ed138c

10 years agoUDS: support for nonblocking sockets
David van Moolenbroek [Fri, 4 Oct 2013 15:57:42 +0000 (17:57 +0200)]
UDS: support for nonblocking sockets

This patch includes several other fixes, which are now tested in the
test56 test set.

Change-Id: I9535d5a6c072abf966252838522c5f65b353c6c2

10 years agoUDS: clean up source code
David van Moolenbroek [Fri, 4 Oct 2013 14:46:18 +0000 (16:46 +0200)]
UDS: clean up source code

- move VFS calls to a separate source file;
- solve a few subtle bugs, mostly in error handling;
- simplify debug reporting code;
- make a few definitions more independent;
- restyle to something closer to KNF.

Change-Id: I7b0537adfccac8b92b5cc3e78dac9f5ce3c79f03

10 years agoUDS: split off from PFS
David van Moolenbroek [Fri, 4 Oct 2013 14:29:40 +0000 (16:29 +0200)]
UDS: split off from PFS

Change-Id: I769cbd64aa6e5e85a797caf0f8bbb4c20e145263

10 years agoat_wini: PCI-only now; one controller per instance
David van Moolenbroek [Wed, 2 Oct 2013 17:37:00 +0000 (19:37 +0200)]
at_wini: PCI-only now; one controller per instance

- remove non-PCI support, since all supported platforms with at_wini
  devices also have PCI support by now;
- correspondingly, stop using information from the BIOS altogether;
- limit each driver instance to one controller, to be in line with
  the general MINIX3 one-instance-per-controller driver model; this
  limits the number of disks per at_wini instance to four;
- go through the controllers by the order of their occurrence in the
  PCI table, thus removing the exception for compatibility devices;
- let the second at_wini instance shut down silently if there is only
  one IDE controller;
- clean up some extra code we don't need anymore, and resolve some
  WARNS=5 level warnings.

Overall, these changes should simplify automatic loading of the right
disk drivers at boot time in the future.

Change-Id: Ia64d08cfbeb9916abd68c9c2941baeb87d02a806

10 years agosystem.conf: subsystem VID/DID matching support
David van Moolenbroek [Mon, 30 Sep 2013 22:42:41 +0000 (00:42 +0200)]
system.conf: subsystem VID/DID matching support

- change "vid/did" to "vid:did", old form still supported for now;
- allow "vid:did/subvid:subdid" specification in system.conf, in
  which case a device will be visible to a driver if the subsystem
  VID/DID also match.

Change-Id: I7aef54da1b0bc81e24b5d98f1a28416f38f8b266

10 years agoUpdating saved configure line in gcc
Lionel Sambuc [Mon, 14 Oct 2013 11:19:37 +0000 (13:19 +0200)]
Updating saved configure line in gcc

GCC embeddeds in a string the configuration used when building itself,
this patches just updates that string to match the configuration
actually used.

Change-Id: Ife8f61570b94eb17ce5808b5b58cc5e75e9dc64f

10 years agousr.bin/man: Update
Lionel Sambuc [Tue, 8 Oct 2013 17:00:16 +0000 (19:00 +0200)]
usr.bin/man: Update

Change-Id: I0c5d2115ba384687032f7b2af50d99dedc323b7a

10 years agoexternal/bsd/mdocml: Update
Lionel Sambuc [Tue, 8 Oct 2013 16:05:29 +0000 (18:05 +0200)]
external/bsd/mdocml: Update

Change-Id: I17b54e52e8322676d83ed4386f586f8ef3029f72

10 years agoRemove obsolete compatibility links
Lionel Sambuc [Fri, 4 Oct 2013 13:41:18 +0000 (15:41 +0200)]
Remove obsolete compatibility links

 * /usr/bin/strip would be replaced by a link, even when compiling
    binutils.
 * Updated minix-spec.h to use the correct dynamic linker, and removed
    the previously used symlinks.
 * Removed the patch to the builtin PATH of ld.elf_so.

Change-Id: I4dc8a7fb77a11638f5105a4e15b6c9be5add750e

10 years agoSplitting commands/cd/cd.sh
Lionel Sambuc [Thu, 3 Oct 2013 20:39:47 +0000 (22:39 +0200)]
Splitting commands/cd/cd.sh

As the situation is right now, importing one of the commands the
script replaces, requires a doc/UPDATING step.

By moving the script to a shared folder, and symlinking it once per
command, this allows for separatly installed files on the system,
instead of one file being symlinked multiple times.

Change-Id: I0dae96982bca5168b852ed70fff61442441b929f

10 years agoAdapting build system to call MAKEDEV for /dev 13/1013/3
Lionel Sambuc [Thu, 3 Oct 2013 16:26:21 +0000 (18:26 +0200)]
Adapting build system to call MAKEDEV for /dev

 * Remove static proto.dev
 * Update releasetools/*image.sh not to use proto.dev, as well as
   minor comments cleanup
 * Add TOOL_TOPROTO

Change-Id: If7dc16d4ebb3b0c4e859786fad25d4af000c999f

10 years agoMAKEDEV: Add mtree output, and ramdisk set.
Lionel Sambuc [Thu, 3 Oct 2013 11:54:24 +0000 (13:54 +0200)]
MAKEDEV: Add mtree output, and ramdisk set.

Change-Id: I36cb7e9451960189a33a04a5c2e3ddb19c7be75e

10 years agokeymaps: improve keypad slash support
David van Moolenbroek [Wed, 2 Oct 2013 11:37:49 +0000 (13:37 +0200)]
keymaps: improve keypad slash support

Now that the keymaps can distinguish between the regular slash key
and the slash key on the numeric keypad, we can avoid localization
of the latter.

Change-Id: I20ead7d26a9baa82f5a522562524fd75d44efb42

10 years agoNorwegian keymap
Mikal Villa [Wed, 2 Oct 2013 10:30:03 +0000 (12:30 +0200)]
Norwegian keymap

Change-Id: I181234afc8f1a058e92af6c1fe88979463aaff45

10 years agoInput infrastructure, INPUT server, PCKBD driver
David van Moolenbroek [Sat, 28 Sep 2013 12:46:21 +0000 (14:46 +0200)]
Input infrastructure, INPUT server, PCKBD driver

This commit separates the low-level keyboard driver from TTY, putting
it in a separate driver (PCKBD). The commit also separates management
of raw input devices from TTY, and puts it in a separate server
(INPUT). All keyboard and mouse input from hardware is sent by drivers
to the INPUT server, which either sends it to a process that has
opened a raw input device, or otherwise forwards it to TTY for
standard processing.

Design by Dirk Vogt. Prototype by Uli Kastlunger.

Additional changes made to the prototype:

- the event communication is now based on USB HID codes; all input
  drivers have to use USB codes to describe events;
- all TTY keymaps have been converted to USB format, with the effect
  that a single keymap covers all keys; there is no (static) escaped
  keymap anymore;
- further keymap tweaks now allow remapping of literally all keys;
- input device renumbering and protocol rewrite;
- INPUT server rewrite, with added support for cancel and select;
- PCKBD reimplementation, including PC/AT-to-USB translation;
- support for manipulating keyboard LEDs has been added;
- keyboard and mouse multiplexer devices have been added to INPUT,
  primarily so that an X server need only open two devices;
- a new "libinputdriver" library abstracts away protocol details from
  input drivers, and should be used by all future input drivers;
- both INPUT and PCKBD can be restarted;
- TTY is now scheduled by KERNEL, so that it won't be punished for
  running a lot; without this, simply running "yes" on the console
  kills the system;
- the KIOCBELL IOCTL has been moved to /dev/console;
- support for the SCANCODES termios setting has been removed;
- obsolete keymap compression has been removed;
- the obsolete Olivetti M24 keymap has been removed.

Change-Id: I3a672fb8c4fd566734e4b46d3994b4b7fc96d578

10 years agoTTY: allow selecting on translated minors 98/998/2
David van Moolenbroek [Fri, 27 Sep 2013 11:56:29 +0000 (11:56 +0000)]
TTY: allow selecting on translated minors

Due to the existence of /dev/console and /dev/log, and the new
"console=" setting, it is now possible that a single non-PTY object
(e.g. serial) is accessible through two different minor numbers.  This
poses a problem when sending late select replies (CDEV_SEL2_REPLY),
because the object's minor number can not be used to identify the
device.  Since selecting on such objects through translated minor
numbers is actually required, we now save the minor number used to
initiate the select query in order to send a late reply.

The solution is suboptimal, as it is not possible to use two different
minors to select on the same object at once.  In the future, there
should be at least one select record for each minor that can be used
with each object.

Change-Id: I4d39681d2ffd68b4047daf933d45b7bafe3c885e

10 years agoEnable sys-root support in the native binutils 97/997/2
Lionel Sambuc [Thu, 26 Sep 2013 09:52:57 +0000 (11:52 +0200)]
Enable sys-root support in the native binutils

sysroot support was enabled only for cross versions of the binutils
tools.

This patch also activate it for the native tools which are installed
on the target system.

Change-Id: Ica5de7e20719a63f3b695477b767c30d0a93490c