]> Zhao Yanbai Git Server - minix.git/log
minix.git
9 years agoatl2: use new libnetdriver 15/2915/1
David van Moolenbroek [Tue, 2 Dec 2014 14:00:04 +0000 (14:00 +0000)]
atl2: use new libnetdriver

Change-Id: I65de5d29a75d5f3101b2c5ab16a4b0d79bd77cc3

9 years agolibnetdriver: turn into network driver framework 14/2914/1
David van Moolenbroek [Tue, 2 Dec 2014 13:16:14 +0000 (13:16 +0000)]
libnetdriver: turn into network driver framework

The new implementation of this library provides abstractions for
network drivers, and should be used for all network drivers from now
on.  It provides the following functionality:

  - a function call table abstraction, hiding the details of the
    datalink protocol with simple parameters;
  - a state machine for sending and receiving packets, freeing the
    actual driver from keeping track of pending requests;
  - an abstraction for copying data from and to the network driver,
    freeing the actual driver from dealing with I/O vectors while at
    the same time providing a copy implementation which is more
    efficient than most current driver implementations;
  - a generalized implementation of zero-copy port-based I/O;
  - a clearer set of policies and defaults.

While the concept is very similar to lib{block,char,fs,input}driver,
one main difference is that libnetdriver now also takes care of SEF
initialization, mainly so that aspects such as recovery policies and
live-update aspects can be changed for all network drivers in a
single place.  As always, for the case that the provided message loop
is too restrictive, a set of more low-level message processing
functions is provided.

The netdriver API has been designed so as to allow alleviation of one
current protocol bottleneck: the fact that at most one send request
and one receive request may be pending at any time.  Changing this
aspect will however require a significant rewrite of libnetdriver,
and possibly debugging of drivers that are not able to cope with (in
particular) queuing multiple packets for transmission at once.

Beyond that, the design of the new API is based on the current
protocol, and may be changed/extended later to allow for non-ethernet
network drivers, exposure of link status, multicast address
configuration, suspend and resume, and any other features that are in
fact long overdue.

Change-Id: I47ec47e05852c42f92af04549d41524f928efec2

9 years agoe1000: convert to KNF 13/2913/1
David van Moolenbroek [Mon, 1 Dec 2014 17:00:04 +0000 (17:00 +0000)]
e1000: convert to KNF

Change-Id: Ibd156c2e0a58fed70895080d4b230b26c500fa11

9 years agoatl2: convert to KNF 12/2912/1
David van Moolenbroek [Thu, 27 Nov 2014 12:59:57 +0000 (12:59 +0000)]
atl2: convert to KNF

Change-Id: Ie4b979aab3127a91a12b8086326da0eb1f9a860b

9 years agolibvirtio: expose result size on packet dequeue 11/2911/1
David van Moolenbroek [Mon, 1 Dec 2014 17:30:45 +0000 (17:30 +0000)]
libvirtio: expose result size on packet dequeue

Change-Id: I49304678895779849abc2528a9f78730f968e712

9 years agoorinoco: restore register memory mapping 10/2910/1
David van Moolenbroek [Mon, 1 Dec 2014 17:21:17 +0000 (17:21 +0000)]
orinoco: restore register memory mapping

Untested.

Change-Id: I439f0e711e16ba478dadf57ffc8ad74ec19ea1b9

9 years agofxp: enable bus mastering if needed 09/2909/1
David van Moolenbroek [Mon, 1 Dec 2014 17:11:44 +0000 (17:11 +0000)]
fxp: enable bus mastering if needed

This is required for at least QEMU.  However, as of writing, QEMU also
requires fixes in its epro100 emulator before this driver can use it.

Change-Id: Ie5c5ffe4311b1a0e581bc687f1c15de3a85f4a30

9 years agoe1000: fix unaligned register access 08/2908/1
David van Moolenbroek [Mon, 1 Dec 2014 17:04:49 +0000 (17:04 +0000)]
e1000: fix unaligned register access

This resolves a guru meditation in recent VirtualBox versions.

Change-Id: I5034d8af1fe885adda3c027cb23563bffaccf97e

9 years agodp8390: update, allow default port and IRQ 07/2907/1
David van Moolenbroek [Mon, 1 Dec 2014 17:50:59 +0000 (17:50 +0000)]
dp8390: update, allow default port and IRQ

Bochs has switched from port base 0x240 to 0x300 for its default
NE2000 ISA configuration, and QEMU is using the same settings.

Change-Id: Ide6cdb14321eb4324d0bf6d6314c5970b3493e95

9 years agoetc/usr/rc: fix argument passing for net drivers 06/2906/1
David van Moolenbroek [Mon, 1 Dec 2014 17:35:21 +0000 (17:35 +0000)]
etc/usr/rc: fix argument passing for net drivers

The expected argument name would include the instance number, which
is not only redundant in many cases (FOOETHn_n=arg.., "n" being the
instance number) and conflicted with what netconf(8) does, but some
drivers need to be able to see the arguments for all instances of its
driver type--for example, dp8390 needs to know how many earlier
instances have been configured to use PCI.

Change-Id: I4830b823352722f554a032979464aba8b08fc166

9 years agoUDS: move from drivers/net/ to net/ 05/2905/1
David van Moolenbroek [Mon, 1 Dec 2014 17:58:20 +0000 (17:58 +0000)]
UDS: move from drivers/net/ to net/

Change-Id: I53992b205e767a77c7b3c868a38c7f3d772a4ed3

9 years agominix/ changes for arm llvm build 03/2903/3
Ben Gras [Tue, 2 Dec 2014 20:31:08 +0000 (21:31 +0100)]
minix/ changes for arm llvm build

. fixes needed to build Minix/ARM with LLVM without errors,
  mostly size_t cleanness

Change-Id: If4dd0a23bc5cb399296073920a8940c34b4caef4

9 years agoFix for TOOL_CPP 02/2902/2
Ben Gras [Tue, 25 Nov 2014 17:15:45 +0000 (17:15 +0000)]
Fix for TOOL_CPP

. needed for xorg build from /usr/xsrc

Change-Id: I632c9d09d4cfecfbf454820551f6d618ac4f4ebe

9 years agoImport a few manpages 97/2897/2
Lionel Sambuc [Wed, 19 Nov 2014 09:54:14 +0000 (10:54 +0100)]
Import a few manpages

The following manpages where contributed by
Jacob Adams <tookmund@gmail.com>:
 - atnormalize.8
 - autopart.8
 - decomp16.1
 - devsize.8
 - rawspeed.8
 - rotate.8
 - update_bootcfg.8
 - updateboot.8

Change-Id: Ide3abf0962083b83e37426e2d47f3a9391d6315e

9 years agofor pkgsrc without base clang from sambuc@ 01/2901/1
Ben Gras [Mon, 24 Nov 2014 12:54:36 +0000 (12:54 +0000)]
for pkgsrc without base clang from sambuc@

Change-Id: Id0bf33da426f6c7a14628846dd1185cdcdfac766

9 years agoremove unused PSW restore code 00/2900/1
Ben Gras [Mon, 24 Nov 2014 11:00:27 +0000 (11:00 +0000)]
remove unused PSW restore code

. now done in-kernel so IOPL gets restored

Change-Id: I9905d2844a4715004054a788613ff7efd02a227d

9 years agorestore PSW like 9393439a20 for AMD syscall 99/2899/1
Ben Gras [Thu, 20 Nov 2014 16:42:32 +0000 (16:42 +0000)]
restore PSW like 9393439a20 for AMD syscall

Change-Id: Ide0a8727af8d0d81361382dbd2460c7a6c5743fc

9 years agoinet: detect short TCP option lengths 96/2896/1
David van Moolenbroek [Tue, 18 Nov 2014 12:45:46 +0000 (12:45 +0000)]
inet: detect short TCP option lengths

Previously, a TCP option length of zero would cause inet to end up
in an infinite loop.

This resolves #7, reported by Alejandro Hernandez.

Change-Id: I45ad4c789d10d8e202cf6e140a7b9db7a6543c75

9 years agoFix for missing /usr/games in root's PATH 95/2895/1
Lionel Sambuc [Mon, 17 Nov 2014 21:35:00 +0000 (22:35 +0100)]
Fix for missing /usr/games in root's PATH

After importing the default environment from NetBSD, we discovered that
it doesn't contain /usr/games, which is required for the commands
strfile. This utility is used while generating fortune database.

This patch simply sets TOOL_STRFILE to contain an absolute path.

Change-Id: I2e366a0b67d5258f387c3f5a2a2a581fedead359

9 years agodhcpd: don't crash so easily 94/2894/1
David van Moolenbroek [Mon, 17 Nov 2014 20:13:46 +0000 (20:13 +0000)]
dhcpd: don't crash so easily

The jump-to-start hack is not resetting global variables, resulting in
a crash after several such restarts cause an overflow in the network
table.  This patch fixes that particular issue, but more similar
issues (in particular memory leaks) are bound to come up.  As such this
is a stopgap measure until we can get rid of the old dhcpd altogether.

This resolves the additional issue reported in #2.

Change-Id: Ic4cd80eae520cf2b97e893bac63b3ab1ecfea6d8

9 years agortl8139: enable bus mastering if needed 93/2893/1
David van Moolenbroek [Mon, 17 Nov 2014 19:19:36 +0000 (19:19 +0000)]
rtl8139: enable bus mastering if needed

This resolves #2.

Change-Id: Ie6736f0d5a713025f09c18de7042ba44fbb1b2f8

9 years agolibfsdriver: support mmap on FSes with no device 92/2892/1
David van Moolenbroek [Sat, 15 Nov 2014 10:14:00 +0000 (10:14 +0000)]
libfsdriver: support mmap on FSes with no device

This patch adds (very limited) support for memory-mapping pages on
file systems that are mounted on the special "none" device and that
do not implement PEEK support by themselves.  This includes hgfs,
vbfs, and procfs.

The solution is implemented in libvtreefs, and consists of allocating
pages, filling them with content by calling the file system's READ
functionality, passing the pages to VM, and freeing them again.  A new
VM flag is used to indicate that these pages should be mapped in only
once, and thus not cached beyond their single use.  This prevents
stale data from getting mapped in without the involvement of the file
system, which would be problematic on file systems where file contents
may become outdated at any time.  No VM caching means no sharing and
poor performance, but mmap no longer fails on these file systems.

Compared to a libc-based approach, this patch retains the on-demand
nature of mmap.  Especially tail(1) is known to map in a large file
area only to use a small portion of it.

All file systems now need to be given permission for the SETCACHEPAGE
and CLEARCACHE calls to VM.

A very basic regression test is added to test74.

Change-Id: I17afc4cb97315b515cad1542521b98f293b6b559

9 years agolibfsdriver: prefill st_dev for stat requests 91/2891/1
David van Moolenbroek [Fri, 14 Nov 2014 15:52:22 +0000 (15:52 +0000)]
libfsdriver: prefill st_dev for stat requests

This obviates the need for several file system implementations to
remember the device on which they are mounted.

Change-Id: Ida8325cf4bcf072e61761cfee34e3f7ed2d750b9

9 years agoprocfs: add /proc/service directory 88/2888/2
David van Moolenbroek [Mon, 10 Nov 2014 14:54:06 +0000 (14:54 +0000)]
procfs: add /proc/service directory

This directory is filled dynamically with regular files, one for each
service that RS knows about, named after its label.  Its contents are
still subject to (heavy) change, but currently expose the service's
endpoint and number of restarts so far.

Change-Id: Ie58c824bcb6382c8da7a714e59fee87329970b4b

9 years agoprocfs: convert to KNF 87/2887/2
David van Moolenbroek [Sun, 9 Nov 2014 15:17:44 +0000 (15:17 +0000)]
procfs: convert to KNF

Change-Id: Ib4252f199af0f9597745dcd2c11a7f761738671f

9 years agolibvtreefs: API changes/extensions, part 2 86/2886/2
David van Moolenbroek [Sun, 9 Nov 2014 14:14:37 +0000 (14:14 +0000)]
libvtreefs: API changes/extensions, part 2

- rename start_vtreefs to run_vtreefs, since the function returns upon
  termination these days;
- add get_inode_slots function to retrieve the number of indexed slots;
- add support for extra per-inode data for arbitrary storage.

Change-Id: If2d365d7b478a1cecc9e20fb2b3e70c1a1cf7243

9 years agolibvtreefs: API changes/extensions, part 1 85/2885/2
David van Moolenbroek [Thu, 6 Nov 2014 15:04:45 +0000 (15:04 +0000)]
libvtreefs: API changes/extensions, part 1

- move primary I/O buffer into vtreefs; change read hook API;
- add hooks for write, truncate, symlink, mknod, unlink, chmod/chown;
- modernize message_hook;
- change procfs, devman, gpio accordingly;

Change-Id: I9f0669e41195efa3253032e95d93f0a78e9d68d6

9 years agolibvtreefs: convert to KNF 84/2884/2
David van Moolenbroek [Thu, 6 Nov 2014 13:36:45 +0000 (13:36 +0000)]
libvtreefs: convert to KNF

Change-Id: I81bdf05c9b630a0cbb0ac573d36d4f59f8137199

9 years agoFix bad cast from `u16_t` to `ssize_t` 89/2889/1
Emmanuel Blot [Fri, 7 Nov 2014 17:24:13 +0000 (18:24 +0100)]
Fix bad cast from `u16_t` to `ssize_t`

9 years agoprocfs: compile in x86 support only for x86 target 83/2883/2
David van Moolenbroek [Wed, 5 Nov 2014 14:07:38 +0000 (14:07 +0000)]
procfs: compile in x86 support only for x86 target

Issue reported by Emmanuel Blot.

Change-Id: I7f5b1b65273e6ac841d5451e0be7b0e1c92d537c

9 years agotest76: increase alarm times 90/2890/1
David van Moolenbroek [Wed, 12 Nov 2014 12:11:32 +0000 (12:11 +0000)]
test76: increase alarm times

The test would sometimes fail because an alarm triggered before the
system call to be interrupted by the alarm could be started.

Change-Id: Ia507720a1f2d259afde1f97b7edd03f22cbd4810

9 years agotrace(1): document how to add an IOCTL handler 82/2882/2
David van Moolenbroek [Tue, 11 Nov 2014 23:11:21 +0000 (23:11 +0000)]
trace(1): document how to add an IOCTL handler

Also fix two small IOCTL-related bugs:
- do not print an argument pointer for argument-less IOCTLs;
- print IOCTL contents with -V given once, just like structures.

Change-Id: Iec7373003d71937fd34ee4b9db6c6cec0c916411

9 years agoext2: perform super I/O with contiguous memory 78/2878/2
David van Moolenbroek [Sun, 9 Nov 2014 12:59:39 +0000 (12:59 +0000)]
ext2: perform super I/O with contiguous memory

Issue reported by Antoine Leca.

Change-Id: Ie6f3ab6c1943b0b7ea9d5a68d4c24b92bab17233

9 years agoVM,MFS: better handling of some exceptional cases 80/2880/1
Ben Gras [Thu, 6 Nov 2014 13:39:32 +0000 (14:39 +0100)]
VM,MFS: better handling of some exceptional cases

Fix for problems reported by Alejandro Hernández:
. VM unmap: handle case where there is no nextvr

Fixes for problems found by running Melkor ELF fuzzing tool:
. VM: better handle case where region prealloc fails by
  freeing memory that was allocated so far
. MFS fs_readwrite: EOF check should happen for read and
  peek requests, not just read

This fixes #4.

Change-Id: I2adf4eebdfb4c48a297beff0478eed5c917a53a4

9 years agoImport NetBSD shell environment files 79/2879/1
Lionel Sambuc [Mon, 10 Nov 2014 15:09:08 +0000 (16:09 +0100)]
Import NetBSD shell environment files

With the import of Xorg, a proper separation between login-time and sub
shell-time of the environment setup is necessary.

Instead of re-developping this from scratch, I am taking the opportunity
to import the NetBSD default environment.

Change-Id: Ib6a8fbd9c2f407ccd59be57a52ef9df21c2c9ce7

9 years agoAdding /usr/X11R7/lib to LD_LIBRARY_PATH 76/2876/2
Lionel Sambuc [Tue, 7 Oct 2014 21:00:33 +0000 (23:00 +0200)]
Adding /usr/X11R7/lib to LD_LIBRARY_PATH

Change-Id: I94b91e9e89115f90142e284fca21df4c3c8e2060

9 years agoAdding /usr/X11R7 to PATH 75/2875/2
Lionel Sambuc [Tue, 6 May 2014 09:14:14 +0000 (11:14 +0200)]
Adding /usr/X11R7 to PATH

Change-Id: Ifac54e59715f48bdfa4ab0a77d656d11f7289a2e

9 years agoImporting external/mit/xorg support rules 74/2874/2
Lionel Sambuc [Wed, 21 Aug 2013 09:15:11 +0000 (11:15 +0200)]
Importing external/mit/xorg support rules

Change-Id: Ib11d8659485a444797bf3a2118182a1d4e316b50

9 years agoexternal/mit/expat: Import 73/2873/2
Lionel Sambuc [Sat, 14 Dec 2013 03:48:37 +0000 (04:48 +0100)]
external/mit/expat: Import

Change-Id: Ieb49357166b392956df6554a06fcae83c8fd519d

9 years agoEnhancing /proc/pci 72/2872/2
Lionel Sambuc [Fri, 17 Oct 2014 16:33:00 +0000 (18:33 +0200)]
Enhancing /proc/pci

 - Adding missing fields for PCI device lookup
 - Adding the domain (for now set to zero) as part of the slot name

Change-Id: Iebaf3b21f6ab5024738cbc1dea66d5ad3ada175d

9 years agoTurn PCI into a character driver 71/2871/2
Lionel Sambuc [Thu, 16 Oct 2014 19:19:24 +0000 (21:19 +0200)]
Turn PCI into a character driver

Change-Id: Ia9c83af4d52e82e845b6a847c3e82e33d1920ae0

9 years agoUse NetBSD PCI ID DB 70/2870/1
Lionel Sambuc [Thu, 16 Oct 2014 12:23:30 +0000 (14:23 +0200)]
Use NetBSD PCI ID DB

Change-Id: I3fcbce5983b4e0b45e6cc8fac076947c6a84928d

9 years agoImporting lib/libpci 69/2869/1
Lionel Sambuc [Wed, 15 Oct 2014 07:51:53 +0000 (09:51 +0200)]
Importing lib/libpci

Change-Id: I21ae1e409286cec27c5e35677de3778a3f505d1e

9 years agoPCI driver cleanup 68/2868/1
Lionel Sambuc [Tue, 14 Oct 2014 19:38:39 +0000 (21:38 +0200)]
PCI driver cleanup

 - Moved to KNF
 - Whitespace cleanup
 - Removed useless static functions prototypes
 - Renamed some file private functions by prepending '__'
 - Renamed some server-specific function by prepending '_'
 - Fixed compilation warning for WARNS= 3

Change-Id: Ie44d35839177d5ee0630cdf576660c852452ab80

9 years agoPCKDB: Fix PS/2 Mouse support. 67/2867/1
Lionel Sambuc [Thu, 6 Nov 2014 14:37:34 +0000 (15:37 +0100)]
PCKDB: Fix PS/2 Mouse support.

Change-Id: I2240b47ca47a3db7268b47e9e5881d8200c68531

9 years agoFix iopl flag when sysenter/exit are used 66/2866/1
Lionel Sambuc [Fri, 31 Oct 2014 21:40:23 +0000 (22:40 +0100)]
Fix iopl flag when sysenter/exit are used

Change-Id: If8c12f987c3adb8f329ae163da6b2f1cb8cc772f

9 years agoAdd trace(1): the MINIX3 system call tracer 65/2865/1
David van Moolenbroek [Tue, 4 Nov 2014 21:33:04 +0000 (21:33 +0000)]
Add trace(1): the MINIX3 system call tracer

Change-Id: Ib970c8647409196902ed53d6e9631a1673a4ab2e

9 years agobuildsystem: fix build errors for x86 on OSX 64/2864/1
Thomas Veerman [Wed, 15 Oct 2014 08:59:38 +0000 (10:59 +0200)]
buildsystem: fix build errors for x86 on OSX

Define _NLS_PRIVATE in tools/llvm-tblgen/Makefile so that
<tools/compat/nl_types.h> will pull in <include/nl_types.h>. This is
necessary as Clang's c++/v1/locale implementation contains references
to catopen and other catalog symbols that aren't defined anywhere.
Moreover, the compiler will complain about NL_CAT_LOCALE not being
declared. The compat nl_types.h fixes these discrepancies.

However, <nl_types.h> uses __format_arg to add function attributes to
declarations. On NetBSD __format_arg(fmtarg) is defined by
<sys/cdefs.h> to be __attribute__((__format_arg__ (fmtarg))) for
briefness, but other platforms don't do that. Consequently, the build
will fail on catopen and friends function declarations because the
compiler doesn't know how to handle __format_arg(fmtarg). A fixup to
<tools/compat/nl_types.h> takes care of this, but it won't win any
beauty contest.

Change-Id: Ic4426eca8385aeef858e60304d6e8c06cd497d95
Signed-off-by: Thomas Veerman <tveerman@gmail.com>
9 years agoVM: fix returning VFS error code for mmap 63/2863/1
David van Moolenbroek [Mon, 3 Nov 2014 11:18:30 +0000 (11:18 +0000)]
VM: fix returning VFS error code for mmap

Change-Id: Ifcaa15fb8277be53515eb18c4f86a306c52d91d6

9 years agoFix fcntl(F_[GS]ETNOSIGPIPE) semantics 62/2862/1
David van Moolenbroek [Sat, 1 Nov 2014 12:57:31 +0000 (12:57 +0000)]
Fix fcntl(F_[GS]ETNOSIGPIPE) semantics

The new semantics should match those of NetBSD and other systems.

Change-Id: Ic9ca9d6b8c3e42d2a2953d9feea5f6bacaceb43c

9 years agodevman: allow multiple event read calls up to EOF 61/2861/1
David van Moolenbroek [Tue, 28 Oct 2014 13:37:42 +0000 (13:37 +0000)]
devman: allow multiple event read calls up to EOF

Read calls may be repeated by VFS if the user destination memory is
not mapped in.  Devman currently assumes that all reads are
successful, and uses this to track whether EOF has been reached for
a particular event, discarding it as soon as this happens.  Upon
repetition, this may result in lost events for devmand.

With this patch, devman discards events only once devmand reads the
EOF marker, which itself can never generate a user page fault.  The
result is that read calls for data can be repeated safely, without
the risk of losing events in the process.

Change-Id: I9dfdf7f8c8992a20a10302d79c3506e61f8564b0

9 years agoFix build error on OSX 60/2860/2
Thomas Veerman [Thu, 9 Oct 2014 20:14:41 +0000 (22:14 +0200)]
Fix build error on OSX

When building Gold on OSX 10.9 and Clang 6.0, the build process fails
with the error:

In file included from /Users/thomas/minix/tools/binutils/../../external/gpl3/binutils/dist/gold/binary.cc:31:
In file included from /Users/thomas/minix/tools/binutils/../../external/gpl3/binutils/dist/gold/stringpool.h:23:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:438:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar:107:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype:54:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype:51:72: error: use of undeclared identifier 'do_not_use_isalnum_with_safe_ctype'
inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);}

Signed-off-by: Thomas Veerman <tveerman@gmail.com>
Change-Id: Ib7ca13a51e83c31bb3020d755e04b308aeacde5d

9 years agoFix OS X crossbuilds for arm 59/2859/2
Lionel Sambuc [Fri, 10 Oct 2014 09:19:08 +0000 (11:19 +0200)]
Fix OS X crossbuilds for arm

 - Fixed missing variable interpolation because of single quotes
 - Replaced /bin/sh in gen_uEnv.txt.sh with /usr/bin/env bash as the default
   echo doesn't support '-n'
 - Fixed some whitespace errors
 - A succesful build requires for now to skip the gold linker on OSX.

Change-Id: Id09bf52f45252026e3a58b74e8448ea24a0dab12

9 years agoImport tmux 58/2858/2
David van Moolenbroek [Wed, 1 Oct 2014 15:59:46 +0000 (15:59 +0000)]
Import tmux

We have to use SOCK_SEQPACKET instead of SOCK_STREAM for client/server
communication, because UDS does things with control messages that tmux
does not expect.

Change-Id: I3edb1875d61fb976cf6485c650f4fd4b82fa354c

9 years agolibc: enable setproctitle(3) 57/2857/2
David van Moolenbroek [Wed, 1 Oct 2014 15:40:46 +0000 (15:40 +0000)]
libc: enable setproctitle(3)

Change-Id: I31bbc5d960c60f7347424ce3d8f4bce89b396339

9 years agoImport libevent 56/2856/2
David van Moolenbroek [Wed, 1 Oct 2014 15:39:05 +0000 (15:39 +0000)]
Import libevent

Change-Id: Ic75f4cac5eb07ffaba8f97d10673d7d7e2b1762d

9 years agominix libraries: resolve clang warnings 55/2855/1
David van Moolenbroek [Tue, 30 Sep 2014 21:04:09 +0000 (21:04 +0000)]
minix libraries: resolve clang warnings

Change-Id: I0f3425fb8838708c9848a006f1eee5ab1bad71d2

9 years agolibc: resolve minix clang warnings 54/2854/1
David van Moolenbroek [Tue, 30 Sep 2014 20:35:56 +0000 (20:35 +0000)]
libc: resolve minix clang warnings

Change-Id: If6c42f7346cc1b00b387ae8d3b4f0df3ffb0244f

9 years agolibsys: resolve clang warnings 53/2853/1
David van Moolenbroek [Tue, 30 Sep 2014 20:08:54 +0000 (20:08 +0000)]
libsys: resolve clang warnings

Change-Id: Ic954ba8667b4d039172b8e0d2ec57674a479b8aa

9 years agoReplace NetBSD grep with OpenBSD grep 52/2852/1
David van Moolenbroek [Tue, 30 Sep 2014 17:26:43 +0000 (17:26 +0000)]
Replace NetBSD grep with OpenBSD grep

The NetBSD version is seriously broken--it is unable to match lines
against an empty pattern--and appears to be unmaintained.

The new version is the latest OpenBSD grep, with a number of MINIX-
specific changes marked as such, and an additional number of
(signed/unsigned, const) fixes to pass compilation.

Since this is not NetBSD code, move back the entire thing into
minix/usr.bin.

Change-Id: Icd40794a2d0cff9e7fb452db7d28c16dbd25e51d

9 years agolibsffs: make path names constant 51/2851/1
David van Moolenbroek [Sat, 23 Aug 2014 22:28:01 +0000 (22:28 +0000)]
libsffs: make path names constant

And a few other related warning fixes.

Change-Id: I1a49b9ee04c2b1bf80bc943272f72ffd6de77ef6

9 years agoRemove support for call profiling 50/2850/1
David van Moolenbroek [Tue, 30 Sep 2014 12:31:44 +0000 (12:31 +0000)]
Remove support for call profiling

The entire infrastructure relied on an ACK feature, and as such, it
has been broken for years now, with no easy way to repair it.

Change-Id: I783c2a21276967af115a642199f31fef0f14a572

9 years agotest56: fix race condition 49/2849/1
David van Moolenbroek [Tue, 23 Sep 2014 11:49:47 +0000 (11:49 +0000)]
test56: fix race condition

Change-Id: I42bfe2b150e92f760794b4a03e62859c8bd7a992

9 years agotests: fix clang warnings 48/2848/1
David van Moolenbroek [Tue, 23 Sep 2014 11:49:24 +0000 (11:49 +0000)]
tests: fix clang warnings

Change-Id: I5dddc85169d7ef515c99dd1ab824573cbc1b5f2b

9 years agoVFS: do not make cloned devices setuid/setgid 47/2847/1
David van Moolenbroek [Mon, 29 Sep 2014 16:07:10 +0000 (16:07 +0000)]
VFS: do not make cloned devices setuid/setgid

Change-Id: Ifd97444dd54334ccbc8780df9473450998ab7489

9 years agoRemove obsolete MIOC(UN)MAP requests 46/2846/1
David van Moolenbroek [Mon, 29 Sep 2014 16:05:22 +0000 (16:05 +0000)]
Remove obsolete MIOC(UN)MAP requests

Change-Id: I915ac759bc80a50aad21c12f088ad6c345a42986

9 years agosys/ioccom.h: remove _MINIX_IOCTL_IORW 45/2845/1
David van Moolenbroek [Mon, 29 Sep 2014 16:02:32 +0000 (16:02 +0000)]
sys/ioccom.h: remove _MINIX_IOCTL_IORW

It is unused, and does not do what the context suggests it does.

Change-Id: Ic5df9c77e2566a7754e01a444126a6caad2850fc

9 years agosvrctl(2) update 44/2844/1
David van Moolenbroek [Mon, 29 Sep 2014 15:41:36 +0000 (15:41 +0000)]
svrctl(2) update

- synchronize request type with ioctl by making it unsigned long;
- unbreak VFS requests, as they were being sent to PM;
- use proper ioctl direction flags (and new numbers) for requests;
- remove some needless header inclusions;
- svrctl is in libc, make its message name reflect this;
- keep backward compatibility: svrctl is part of the userland ABI.

Change-Id: I44902e8d0d11b8ebc1ef3bda94d2202481743c9b

9 years agoVFS/FS: putnode count need not be 64-bit 43/2843/1
David van Moolenbroek [Mon, 29 Sep 2014 15:14:02 +0000 (15:14 +0000)]
VFS/FS: putnode count need not be 64-bit

Change-Id: I49e67438d3f316e0321ac711494e988bb6510679

9 years agoIOCTL requests are unsigned longs now 42/2842/1
David van Moolenbroek [Mon, 29 Sep 2014 15:11:01 +0000 (15:11 +0000)]
IOCTL requests are unsigned longs now

Issue reported by JD Begin.

Change-Id: I0306d9dc43c36107897c8b73ed340d86a8dcef27

9 years agoCreate new colemak minix keymap. 41/2841/1
AndrewEdwards [Sun, 28 Sep 2014 16:23:15 +0000 (16:23 +0000)]
Create new colemak minix keymap.

Change-Id: I3464e723bd6bb578f415dfe78540e60b2eefb8b7

9 years agobuild lua dynamically 40/2840/1
Ben Gras [Sun, 28 Sep 2014 14:31:54 +0000 (16:31 +0200)]
build lua dynamically

. allows modules to be loaded

Fix submitted by Marc Balmer <mbalmer@NetBSD.org>

Change-Id: I6b2d19c2c9b136f0d72d2f714027221c0b86b5ae

9 years agoImport NetBSD legal/COPYRIGHT. 39/2839/2
Ben Gras [Sun, 28 Sep 2014 12:00:54 +0000 (14:00 +0200)]
Import NetBSD legal/COPYRIGHT.

Change-Id: Ic23e5f1902ade92402faa968bb945b7d873aaf6b

9 years agoImport NetBSD games/fish command. 38/2838/1
Alexandre Beletti [Thu, 25 Sep 2014 00:03:28 +0000 (02:03 +0200)]
Import NetBSD games/fish command.

Change-Id: Ie3009121c768fa5e0c50c681b87cde344ae7cfe2

9 years agoPorting grep from NetBSD 37/2837/1
Sky Liu [Sat, 13 Sep 2014 14:59:14 +0000 (22:59 +0800)]
Porting grep from NetBSD

Change-Id: I6fa9e3c0a4edc4d3ff292dc5c96ac16b34d7c792

9 years agoImport NetBSD games/snake command. 36/2836/2
Alexandre Beletti [Tue, 23 Sep 2014 07:16:10 +0000 (04:16 -0300)]
Import NetBSD games/snake command.

Change-Id: Ie46c0acc09e5e8079f80301ae3a40172fcfb51dd

10 years agotests: reenable testisofs 34/2834/2
David van Moolenbroek [Mon, 8 Sep 2014 22:34:15 +0000 (22:34 +0000)]
tests: reenable testisofs

Change-Id: Ic0883f8b487390e34f1a27e324b033a8cbe2cfff

10 years agoClean up obsolete FS support routines 59/2759/4
David van Moolenbroek [Sun, 24 Aug 2014 11:53:52 +0000 (11:53 +0000)]
Clean up obsolete FS support routines

Change-Id: I56d0ab51f32064bb964051732de7e2465dc22b75

10 years agoisofs: rename source directory to "isofs" 58/2758/4
David van Moolenbroek [Sun, 24 Aug 2014 11:52:43 +0000 (11:52 +0000)]
isofs: rename source directory to "isofs"

Change-Id: Ibe630f720b4399e7ebbbd850650036fbaa9cec7b

10 years agoisofs: basic improvements 57/2757/4
David van Moolenbroek [Sun, 24 Aug 2014 11:50:23 +0000 (11:50 +0000)]
isofs: basic improvements

- fix for "out of extents" panic;
- return ENOENT when a file name does not exist;
- inode count sanity check upon unmount.

Change-Id: Icb97dbaf7c8aec463438f06b341defca357094b2

10 years agoisofs: use libdriver 56/2756/4
David van Moolenbroek [Sun, 24 Aug 2014 10:37:12 +0000 (10:37 +0000)]
isofs: use libdriver

Change-Id: I5ced800eec92f651f31d9c77c3129fe837ca4614

10 years agoiso9660fs: rewrite ISO 9660 file system server 33/2833/2
Jean-Baptiste Boric [Sun, 3 Aug 2014 17:24:51 +0000 (19:24 +0200)]
iso9660fs: rewrite ISO 9660 file system server

iso9660fs has been cleaned up and debugged. It now supports:
 * ISO 9660 Level 3,
 * System Use Sharing Protocol (SUSP),
 * Rock Ridge Interchange Protocol (RRIP).

The following Rock Ridge features are supported:
 * POSIX file attributes (PX),
 * POSIX device number (PN),
 * Symbolic links (SL),
 * Alternate file name (NM),
 * Timestamps in 7-byte format (TF).

Change-Id: Ib227411bdda5bc10a957b27ad05fafdc95eca35f

10 years agoRevert "Temporarily disable the is9600 FS server" 35/2835/1
David van Moolenbroek [Thu, 18 Sep 2014 12:59:18 +0000 (12:59 +0000)]
Revert "Temporarily disable the is9600 FS server"

This reverts commit ab5c98ee5a2332a1f64b55fa3d056b675b2252ef.

10 years agowriteisofs: set file struct version field to one 55/2755/3
David van Moolenbroek [Sat, 23 Aug 2014 18:55:44 +0000 (18:55 +0000)]
writeisofs: set file struct version field to one

Dictated by the spec and correctly flagged by the new isofs code.

Change-Id: Ie155c30b6a53e40ec42066af0adbcdbf457e5620

10 years agoPFS: rewrite, restyle 54/2754/3
David van Moolenbroek [Sun, 24 Aug 2014 10:20:59 +0000 (10:20 +0000)]
PFS: rewrite, restyle

- remove the buffer pool, inode bitmap, and inode hash table, and
  simplify the code accordingly;
- use theoretically slightly more optimal buffer management;
- put the entire source in one file, instead of having many files
  with one or two functions each;
- convert the code to KNF style.

Change-Id: Ib8f6f0bd99fbc6eb9098fba718e71b8e560783d9

10 years agoPFS: use libfsdriver 53/2753/3
David van Moolenbroek [Sun, 24 Aug 2014 10:18:30 +0000 (10:18 +0000)]
PFS: use libfsdriver

In order to avoid creating libfsdriver exceptions, two changes to VFS
are necessary:

- the returned position field for reads/writes is no longer abused to
  return the new pipe size; VFS is perfectly capable of updating the
  size itself;
- during system startup, PFS is now sent a mount request, just like all
  other file systems.

In proper "two steps forward, one step back" fashion, the latter point
has the consequence that PFS can no longer drop its privileges at
startup.  This is probably best resolved with a more general solution
for all boot image system services.  The upside is that PFS no longer
needs to be linked with libc.

Change-Id: I92e2410cdb0d93d0e6107bae10bc08efc2dbb8b3

10 years agolibc: make socketpair(3) use the right device 52/2752/3
David van Moolenbroek [Sun, 24 Aug 2014 10:16:37 +0000 (10:16 +0000)]
libc: make socketpair(3) use the right device

UDS expects the device number of the actual socket, not the device on
which the socket happens to reside.  The code worked only because PFS
returned the same value in the st_dev stat field, which it will have
to continue doing for a while now.

Change-Id: I426d38a86a96307ff6e6ed8099d37dae02d6bf2b

10 years agoext2: use libfsdriver 51/2751/3
David van Moolenbroek [Sun, 24 Aug 2014 10:12:30 +0000 (10:12 +0000)]
ext2: use libfsdriver

- fix panic on truncating files with holes;
- remove block-based readahead, to match MFS.

Change-Id: I385552f8019e9c013a6cb937bcc8e4e7181a4a50

10 years agoMFS: use libfsdriver 50/2750/3
David van Moolenbroek [Sun, 24 Aug 2014 10:06:03 +0000 (10:06 +0000)]
MFS: use libfsdriver

Change-Id: Ib658c7dea47b81a417755b0554a75288117b431a

10 years agoMove clock_time into libsys 49/2749/3
David van Moolenbroek [Sun, 24 Aug 2014 10:00:06 +0000 (10:00 +0000)]
Move clock_time into libsys

Change-Id: Ibc5034617e6f6581de7c4a166ca075b3c357fa82

10 years agolibvtreefs: use libfsdriver 48/2748/3
David van Moolenbroek [Sun, 24 Aug 2014 09:55:05 +0000 (09:55 +0000)]
libvtreefs: use libfsdriver

Change-Id: I0e6446bd0ccc3b89edc237be441ebfd92585f352

10 years agolibpuffs: use libfsdriver 47/2747/3
David van Moolenbroek [Sun, 24 Aug 2014 09:51:35 +0000 (09:51 +0000)]
libpuffs: use libfsdriver

Change-Id: I26651578066e1098dc275a9cfbe5710870a13811

10 years agolibsffs: use libfsdriver 46/2746/3
David van Moolenbroek [Sun, 24 Aug 2014 09:47:41 +0000 (09:47 +0000)]
libsffs: use libfsdriver

Change-Id: Id8377873455771c614371e115643cd906d05f12c

10 years agolibminixfs: add block I/O routines 45/2745/3
David van Moolenbroek [Sun, 24 Aug 2014 09:40:52 +0000 (09:40 +0000)]
libminixfs: add block I/O routines

The new functionality aims to save each file system server from having
to implement its own block I/O routines just so that it can serve as a
root file system.  The new source file (bio.c) lists the requirements
that file system servers have to fulfill in order to use the routines.

Change-Id: Ia0190fd5c30e8c2097ed8f4b0e3ccde1827e0b92

10 years agolibminixfs: do not make fs_sync upcalls 44/2744/3
David van Moolenbroek [Sun, 24 Aug 2014 09:38:25 +0000 (09:38 +0000)]
libminixfs: do not make fs_sync upcalls

The file system may not be expecting these upcalls at arbitrary
moments, while they serve only as a performance optimization anyway.

Change-Id: I0748fd1f6c2645ddbb64466093ee36025aac45e0

10 years agotest72: fix mock bdev functions 43/2743/3
David van Moolenbroek [Sun, 24 Aug 2014 09:37:42 +0000 (09:37 +0000)]
test72: fix mock bdev functions

The minixfs library only ever submits vector elements (and reads) of
the system page size. The test implementation was expecting vector
elements (and reads) of the file system block size. The resulting
mismatch caused I/O to fail in various ways, even though this did not
have an effect on the actual test.

Change-Id: I02f4a3efcd4a32916435d82c7d5798e6b78f0a27

10 years agotest72: fix premature block size update 42/2742/3
David van Moolenbroek [Sun, 24 Aug 2014 09:37:10 +0000 (09:37 +0000)]
test72: fix premature block size update

Updating the current block size before flushing the cache, which still
contained blocks with the old block size, resulted in triggering an
assert on position alignment.

Change-Id: I7a83f3d3bc57bafc08aa6c8df64fbf978273bbfd

10 years agoAdd libfsdriver: a library to drive file systems 41/2741/3
David van Moolenbroek [Sun, 24 Aug 2014 09:27:54 +0000 (09:27 +0000)]
Add libfsdriver: a library to drive file systems

This library provides new abstractions for the upper (VFS) side of
file system services, and should be used for all file system service
implementations from now on.  It provides the following functionality:

  - a function call table abstraction, hiding the details of the
    VFS-FS protocol with simple parameters;
  - a (currently limited) number of per-function steps required for
    all file system implementations, such as copying in and out path
    names and result buffers;
  - a default implementation for multicomponent path lookups, such
    that the file system merely has to implement resolution of single
    components at a time;
  - an abstraction for copying data from and to the file system, which
    allows transparent intraprocess copying as required for the lookup
    implementation;
  - a set of functions to simplify getdents implementations.

The message loop provided by the library is currently for use by
single-threaded file system implementations only.  Multithreaded file
system services may use the more low-level message processing
functionality.

Protocol-level optimizations such as including names in protocol
messages may be hidden entirely in this library.  In addition, in the
future, the lookup implementation may be replaced by a single-
component lookup VFS/FS protocol request as part of a VFS name cache
implementation; this, too, can be hidden entirely in this library.

Change-Id: Ib34f0d0e021dfa3426ce8826efcf3eaa94d3ef3e

10 years agoVFS: provide correct root directory for lookups 40/2740/2
David van Moolenbroek [Sun, 24 Aug 2014 09:27:02 +0000 (09:27 +0000)]
VFS: provide correct root directory for lookups

This fixes a VFS panic and a chroot(2) security hole.

Change-Id: Ifd1923f886501cf3a73277aab89db974798c47dc

10 years agoVFS: do not call REQ_FLUSH on the root file system 39/2739/2
David van Moolenbroek [Sun, 24 Aug 2014 09:26:17 +0000 (09:26 +0000)]
VFS: do not call REQ_FLUSH on the root file system

Change-Id: I15d29a6f3d198e604ea7f7a9db600d6d18b6994b