Squashed commit of the following:
commit c1f8bd0351773f101b887beebf1bf8faea047d65
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:08:24 2014 +0000
virtio_net: use new libnetdriver
Change-Id: Id06bdb67da12477984b42bbd46623bd8f25c0ab9
commit 70b92b94eb2ebd23fe4f0e39708f273fd23df6e9
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:06:15 2014 +0000
rtl8169: use new libnetdriver
Change-Id: Ia26b6c440a1525f1d2bb9e7592e357dac0ba602c
commit 553a4151f85d4a51a368c1abbc7384f981c25a1d
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:07:16 2014 +0000
rtl8139: use new libnetdriver
Change-Id: Iba941653b7c052375694bcec2561957c1979feb0
commit 0d5784cf27ba95190c09c885fda1c6c563e87f29
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:05:26 2014 +0000
orinoco: use new libnetdriver
Change-Id: I003590539dd76f4be8e067f986bb1f17b151490d
commit 84a2c824ace788d3d014a3b4ee0f2d90321eeb8e
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:05:09 2014 +0000
lance: use new libnetdriver
Change-Id: If3414088e66407c688c4960f99a165b0ee1ebc83
commit b3097036029c3d88a3964362a1fea0d76c4dfa00
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:04:33 2014 +0000
lan8710a: use new libnetdriver
Change-Id: Iaee4d75a5dfafc72d94f0b02681f9aea1c9da535
commit bed92519b0c5015bac88400f2b13c7836539642d
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:04:01 2014 +0000
fxp: use new libnetdriver
Change-Id: I03268655a5daff3d109ae52e64673911ef096a3f
commit ba868da1e91b1f8c64dbf918f0572000956f86e2
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:03:14 2014 +0000
e1000: use new libnetdriver
Change-Id: I111750d2ca27f01039d0b427b1314aea861e2074
commit 668777f3f727722b73654253a66a0fd1ac3e1bbd
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:02:46 2014 +0000
dpeth: use new libnetdriver
Change-Id: Ic389e54817c5b241dad851c89ef1cf16c015a79b
commit edf59ab3cb55219a93a060fceb8f59b713d75dcd
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:02:02 2014 +0000
dp8390: use new libnetdriver
Change-Id: Ieaf6d605832d475f95fd9b06026b349dce7ee025
commit d8f11c1f66daaae7d50fe240d216e625472100b0
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:01:20 2014 +0000
dec21140A: use new libnetdriver
Change-Id: I54be3b770e4d1fd320200c30e9e9073a7c1b405b
commit cc851f55f60ffcaa8cd61df269bd399c3159a78c
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 14:00:04 2014 +0000
atl2: use new libnetdriver
Change-Id: I65de5d29a75d5f3101b2c5ab16a4b0d79bd77cc3
commit a50e5606a8cf503c024825ebe56d4b1a3dfd2670
Author: David van Moolenbroek <david@minix3.org>
Date: Tue Dec 2 13:16:14 2014 +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
commit 81cfac6291eaf0db0f66146ecdc2e6cf8c5e05ca
Author: David van Moolenbroek <david@minix3.org>
Date: Mon Dec 1 17:00:04 2014 +0000
e1000: convert to KNF
Change-Id: Ibd156c2e0a58fed70895080d4b230b26c500fa11
commit 400925dd615afbf0ed720779085ee02db65abeab
Author: David van Moolenbroek <david@minix3.org>
Date: Thu Nov 27 12:59:57 2014 +0000
atl2: convert to KNF
Change-Id: Ie4b979aab3127a91a12b8086326da0eb1f9a860b
commit 15e2247939858c826a6395cedac95632e3a8637f
Author: David van Moolenbroek <david@minix3.org>
Date: Mon Dec 1 17:30:45 2014 +0000
libvirtio: expose result size on packet dequeue
Change-Id: I49304678895779849abc2528a9f78730f968e712
commit cf57d76601ac76ff0e4a1a7d5b4f2b1be15bd32d
Author: David van Moolenbroek <david@minix3.org>
Date: Mon Dec 1 17:21:17 2014 +0000
orinoco: restore register memory mapping
Untested.
Change-Id: I439f0e711e16ba478dadf57ffc8ad74ec19ea1b9
commit d388e231194b9334da2319175383aa9ee7c9e49d
Author: David van Moolenbroek <david@minix3.org>
Date: Mon Dec 1 17:11:44 2014 +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
commit 21e797836a991907f4139874bc740207cd893467
Author: David van Moolenbroek <david@minix3.org>
Date: Mon Dec 1 17:04:49 2014 +0000
e1000: fix unaligned register access
This resolves a guru meditation in recent VirtualBox versions.
Change-Id: I5034d8af1fe885adda3c027cb23563bffaccf97e
commit e9a2ab30f46660d5385eaf1e9212adcfc34448bc
Author: David van Moolenbroek <david@minix3.org>
Date: Mon Dec 1 17:50:59 2014 +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
commit 651f2f48e07e532b26c6daaa617aed784006db8e
Author: David van Moolenbroek <david@minix3.org>
Date: Mon Dec 1 17:35:21 2014 +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
commit 56ba3bb62d74c273e1d8230b9f3dddbb0cd5d4cf
Author: David van Moolenbroek <david@minix3.org>
Date: Mon Dec 1 17:58:20 2014 +0000
UDS: move from drivers/net/ to net/
Change-Id: I53992b205e767a77c7b3c868a38c7f3d772a4ed3
Change-Id: I45f13cf627c0bce0d0d53b2e0e6aab51312106d9
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
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
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
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
This obviates the need for several file system implementations to
remember the device on which they are mounted.
Change-Id: Ida8325cf4bcf072e61761cfee34e3f7ed2d750b9
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
- 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
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
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
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
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
- Adding missing fields for PCI device lookup
- Adding the domain (for now set to zero) as part of the slot name
Change-Id: Iebaf3b21f6ab5024738cbc1dea66d5ad3ada175d
- 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
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>
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
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
- 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
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
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