566 Commits

Author SHA1 Message Date
Jia-Ju Bai
c28d8fefcf VT6105: Restructure the code and correct function order in initialization
Change-Id: Ibbc8f835174349501e74dde7163c234effb34bc8
2017-01-26 12:50:48 +01:00
Jia-Ju Bai
3afdc1200b IP1000: Restructure the code and correct function order in initialization
Change-Id: I7c887a777205ea0ae38b4ef1830535d035c5a976
2017-01-26 12:47:45 +01:00
Jia-Ju Bai
eecf6d233d Add the driver for Trident 4DWAVE-DX sound card
Change-Id: I6a4f5427915032a6a4c0246fed35c10397df3e07
2017-01-08 19:01:58 +01:00
Jia-Ju Bai
8acfcfc39e Add the driver for CS4281 sound card
Change-Id: Ifc1b7c129578c5efa5e328664d10d07ee5df786b
2017-01-08 19:01:20 +01:00
Jia-Ju Bai
86fd71a2c9 Add the driver for ALS4000 sound card
Change-Id: I2ad08e8479b743ec235d1c9e541faa2fa6a29fcc
2017-01-08 19:00:40 +01:00
Jia-Ju Bai
37e23b1cc7 Add the driver for CMI8738 sound card
Change-Id: I5a53e3b8652a014e105ca7c77c42a730f6824307
2017-01-08 18:59:39 +01:00
David van Moolenbroek
6dd801ffb8 libaudiodriver: buffer accounting bugfix
This fixes #191.

Change-Id: I93752161e466b2d03bbcb0838705aab9619c05c8
2016-12-28 13:12:58 +00:00
David van Moolenbroek
192c3a97f6 libaudiodriver: readd callback to drv_int_sum()
The callback, which was dropped in commit git-842c4ed, allows drivers
to fetch the interrupt status once and save it locally for subsequent
calls to drv_int().

This fixes #190 .

Change-Id: I83918656f637e716f60e9f4c19f1498f761d3b52
2016-12-28 13:08:23 +00:00
David van Moolenbroek
10a44c0ee2 trace(1): add basic support for timestamps
This patch adds strace-like support for a -t command line option,
which causes a timestamp to be printed at the beginning of each line.
If the option is given more than once, the output will also include
microseconds.

Change-Id: I8cda581651859448c154b01815cc49d915b7b354
2016-12-28 13:06:04 +00:00
David van Moolenbroek
1bb466dd36 libc: make posix_spawn(3) clean up child on failure
Change-Id: I39a321f23326485fca789e5792a57532d1036716
2016-12-28 13:05:55 +00:00
David van Moolenbroek
b52b83f927 test74: allow to be run from source directory
A small fix to allow this test to be run from its original source
directory location, in addition to its installed location.

Change-Id: I4b7afed14ba02b1bea8d9c5f65bc96698a279188
2016-12-28 13:05:44 +00:00
Jia-Ju Bai
8d98f2e579 Add the driver for IC Plus 1000A Ethernet card
Change-Id: I9ac119c6285bc63a8b795b44d9ab7d245d9a8832
2016-11-24 17:22:28 +01:00
Jia-Ju Bai
8dc24c0650 Update vt6105
Change-Id: I8136a17eb47f626141bb20b9d6a30f82117425b7
2016-11-24 17:22:15 +01:00
rlfnb
fee60e45e6 introducing libacpi
Change-Id: I0808545fefaefc9a8fc8d1101bd85b676467fea0
2016-10-29 17:08:10 +02:00
rlfnb
e154914956 Added vendor- and device id for Via Rhine III
The device id added is used by ALIX boards.

Change-Id: I78d1ce9f2fa0ee121e68d2c84818f669eeab3092
2016-10-24 14:20:37 +02:00
Jia-Ju Bai
9784113fda vt6105: add a README file
Change-Id: I8dbb122afc130f2f2504743fa4fcbada5c97dff5
2016-10-24 14:18:54 +02:00
David van Moolenbroek
286d266fd0 PM: fix alarm signal delivery
As of change git-87c599d, when processing CLOCK notifications, PM no
longer set the current process pointer 'mp'.  That pointer is however
used when delivering signals through check_sig(), to see whether the
current process may deliver a signal to the target process.  As a
result, delivering SIGALARM signals used a previous pointer in these
checks, causing alarm signals not to be delivered in some cases.
This patch ensures that alarm signals are again delivered with PM as
current process.

Change-Id: I94ccbe8b71289df0e1d6d67928e55297bbc28360
2016-10-24 12:11:52 +00:00
David van Moolenbroek
f221d2ce48 RMIB: add support for vector copy-out
Change-Id: I9e9b4b8d6eed39fdb511c6bd2a375ddf898064a5
2016-10-24 12:10:34 +00:00
io12
9f11521a37 Fix grammar errors in a comment
Change-Id: I0ad2b6a28afb44e42d1830f1b0944579dc032261
2016-10-19 23:51:07 +02:00
Jia-Ju Bai
022136b354 Add the driver for VIA Technology 6105/6106S Ethernet card
Change-Id: I690c34f0a37bcbb20a5b7748e3dd315707460caf
2016-10-19 21:54:58 +02:00
Richard Sailer
a0814afb2e VFS: Convert K&R C -> ANSI C
Aditionally this removes all trailing whitespaces
using: sed -i 's/[[:space:]]*$//' *.c

Change-Id: I88451fdb6f6e79e61f8aae5bd5a7f2e3538f9944
2016-10-18 14:20:21 +02:00
Richard Sailer
4aa48abab9 is: Convert K&R C -> ANSI C
Aditionally this removes all trailing whitespaces
using: sed -i 's/[[:space:]]*$//' *.c

Change-Id: I274fccee9ec320e474ac26fbe19f3bd50bec271a
2016-10-18 14:19:48 +02:00
David van Moolenbroek
6956dd2b51 libc: bugfixes for minix's poll(3) wrapper
- clear "revents" fields even when the call times out;
- do not call FD_ISSET with a negative file descriptor number.

Change-Id: I7aeaae79e73e39aed127a75495ea08256b18c182
2016-10-18 14:18:41 +02:00
David van Moolenbroek
3ac58492b3 Add LLVM GCOV coverage support
With this patch, it is now possible to generate coverage information
for MINIX3 system services with LLVM.  In particular, the system can
be built with MKCOVERAGE=yes, either with a native "make build" or
with crosscompilation.  Either way, MKCOVERAGE=yes will build the
MINIX3 system services with coverage profiling support, generating a
.gcno file for each source module.  After a reboot it is possible to
obtain runtime coverage data (.gcda files) for individual system
services using gcov-pull(8).  The combination of the .gcno and .gcda
files can then be inspected with llvm-cov(1).

For reasons documented in minix.gcov.mk, only system service program
modules are supported for now; system service libraries (libsys etc.)
are not included.  Userland programs are not affected by MKCOVERAGE.

The heart of this patch is the libsys code that writes data generated
by the LLVM coverage hooks into a serialized format using the routines
we already had for GCC GCOV.  Unfortunately, the new llvm_gcov.c code
is LLVM ABI dependent, and may therefore have to be updated later when
we upgrade LLVM.  The current implementation should support all LLVM
versions 3.x with x >= 4.

The rest of this patch is mostly a light cleanup of our existing GCOV
infrastructure, with as most visible change that gcov-pull(8) now
takes a service label string rather than a PID number.

Change-Id: I6de055359d3d2b3f53e426f3fffb17af7877261f
2016-09-24 22:18:31 +00:00
rlfnb
92dfb2dc8e Removed redundant ifdef
Change-Id: Ifb7df30591d658700d6293632f5f944c32376fdf
2016-09-10 13:44:04 +02:00
Jean-Baptiste Boric
6afe26749a Enable building with MKDEBUG and MKDEBUGLIB
The way these options work is by creating files that contain debugging
symbols and stashing them in a dedicated set. The minix-debug set has
been created for this purpose, but it will probably have to be refined
since it has been tested only with the default options with an i386
cross-build.

LSC: Amended to support many combination of MKDEBUG, MKDEBUGLIB, with
     and without X11, for both intel and arm.

Change-Id: I2901952e8229938f9ac79c8656484acf704ccd9b
2016-09-10 12:42:45 +02:00
Antoine Leca
a150b26ee8 Improve the process for GNU tools
Split the process to fetch GNU tools (until now embedded
within tools/Makefile.gnuhost) into a new Makefile.fetchgnu,
MINIX-specific hence relocated, which is to be also used
to fetch sources even when not building the tools.
Use it for binutils too.
Improve documentation.

Also do not run configure on each run when MKUPDATE=yes
The .WAIT serialization instruction between fetching and other
configure sources was raising a new run of configure at each
compilation. Avoid it by using two rules.

Change-Id: Ie24950ccbb5c5067f3c1ea57b7bd8294e4c9445e
2016-09-01 21:16:13 +02:00
Antoine Leca
6ddb33542a Allow repartition(8) subpartitions above 4G
Change-Id: I058ab3b58b2e7822b59365b1ce222c5588f442cd
2016-08-06 10:52:38 +02:00
rlfnb
3c71801e8e made PAE enabled by accident and fixed libmagicrt.h
Change-Id: Ia09d8b9a68aa2e1522d66ed93453de9d7d802cb2
2016-08-06 10:52:09 +02:00
David van Moolenbroek
3083d603ba Resolve a number of GCC-generated warnings
The warnings in test47 seem to be a symptom of a larger problem,
i.e., not an issue with the test set code but rather with the GCC
configuration.  Hopefully the switch to LLVM will resolve those.

Change-Id: Ic9fa3b8bc9b728947c993f2e1ed49d9a3b731344
2016-08-05 16:24:04 +02:00
David van Moolenbroek
f83d70a503 tests: fix bug in sys_vumap test
Ever since a VM allocation strategy change, this test is fully
dysfunctional.  It should be repaired and added to the regular
test set, but that will require some work.

For now, keep it in reasonable shape.

Reported by dcb314.

This closes #153.

Change-Id: Ia57bdfdf6a3fc8d47cae76a0be9881fb4d796f6d
2016-08-05 11:17:37 +00:00
David van Moolenbroek
815afbad33 libmthread: resolve memory leaks on exception path
If libmthread runs into a memory allocation failure while attempting
to enlarge its thread pool, it does not free up any preliminary
allocations made so far.

Reported by dcb314.

This closes #152.

Change-Id: Ib882a4544e4802a0eb0a53446b43997876cde633
2016-08-05 11:17:30 +00:00
David van Moolenbroek
ab712d1923 commands: fix various small issues
Reported by dcb314.  Recommendations adopted as is.

This closes #137, closes #138, closes #139, and hopefully I got that
right this time.

Change-Id: I79774f4c398495dba19dec43fbc3f79afd186843
2016-08-05 11:17:19 +00:00
David van Moolenbroek
1ccb488d84 libsys: fix format specifier in RMIB code
Reported by dcb314.

This closes #141.

Change-Id: I26011870891f5ba22844c335af6081ee9f05c12c
2016-08-05 11:16:43 +00:00
David van Moolenbroek
89a4204b83 VFS: split block, character device handling
All functions prefixed with bdev_ are moved into bdev.c, and those
prefixed with cdev_ are now in cdev.c.  The code in both files are
converted to KNF.  The little (IOCTL-related) code left in device.c
is also cleaned up but should probably be moved into other existing
source files.  This is left to a future patch.  In general, VFS is
long overdue for a source code rebalancing, and the patch here is
only a step in the right direction.

Change-Id: I2fb25734b5778b44f2ff6d2ce331a8e2146e20b0
2016-08-05 11:16:30 +00:00
David van Moolenbroek
232819dd49 VFS: store process suspension state as union
Previously, VFS would use various subsets of a number of fproc
structure fields to store state when the process is blocked
(suspended) for various reasons.  As a result, there was a fair
amount of abuse of fields, hidden state, and confusion as to
which fields were used with which suspension states.

Instead, the suspension state is now split into per-state
structures, which are then stored in a union.  Each of the union's
structures should be accessed only right before, during, and right
after the fp_blocked_on field is set to the corresponding blocking
type.  As a result, it is now very clear which fields are in use
at which times, and we even save a bit of memory as a side effect.

Change-Id: I5c24e353b6cb0c32eb41c70f89c5cfb23f6c93df
2016-08-05 11:15:15 +00:00
David van Moolenbroek
0eb6caa076 VFS: disallow opening files of unsupported types
Any attempt to use open(2) to open a socket file now fails with
EOPNOTSUPP, as is common and in the process of being standardized.
The behavior and error code is now tested in test56.

Any attempt to open a file of which the type is not known to VFS
(e.g., as a result of bogus file system contents) now fails with EIO.
For now, this is a safety feature, to prevent VFS tripping over such
types in unchecked cases.  In the future, a proper VFS code audit
should determine whether we can lift this restriction again, although
it does not seem particularly useful to be able to open files of
unknown types anyway.  Another error code may be assigned to this case
later, too.

Change-Id: Ib4cb4341eec954f0448fe469ecf28bd78edebde2
2016-08-05 11:14:29 +00:00
David van Moolenbroek
63faa8fe9a VFS: add debug dump for select
By now it has become clear that the VFS select code has an unusually
high concentration of bugs, and there is no indication that any form
of convergence to a bug-free state is in sight.  Thus, for now, it
may be helpful to be able to dump the contents of the select tables
in order to track down any bugs in the future.  Hopefully that will
allow the next bugs to be resolved slightly after than before.

The debug dump can be triggered with "svrctl vfs get print_select".

Change-Id: Ia826746dce0f065d7f3b46aa9047945067b8263d
2016-08-05 11:14:09 +00:00
David van Moolenbroek
2ff64318e2 VFS: fix race condition in select(2)
A select query could deadlock if..

- it was querying a character or socket device that, at the start of
  the select query, was not known to be ready for the requested
  operations;
- this device could not be checked immediately, due to another ongoing
  query to the same character or socket driver;
- the select query had a timer that triggered before the device could
  be checked, thereby changing the select query to non-blocking.

In this situation, a missing flag check would cause the select code to
conclude erroneously that the operations which it flagged for later,
were satisfied.  At the same time, the same flag remained set, so that
the select query would continue to wait for that device.  This
resulted in a deadlock.  The same bug could most likely be triggered
through other scenarios that were even less likely to occur.

This patch fixes the race condition and puts in a hopefully slightly
more informative comment for the affected block of code.

In practice, the bug could be triggered fairly reliably by generating
lots of output in tmux.

Change-Id: I1c909255dcf552e6c7cef08b0cf5cbc41294b99c
2016-08-05 11:13:59 +00:00
David van Moolenbroek
a758ec672e VFS: forbid mknod(2) on symlinks
As imposed by POSIX.

Extend a random test to verify this behavior.

Change-Id: Ib70550cefaeb9efd54e22312425263a5606fb5e8
2016-08-05 11:13:38 +00:00
David van Moolenbroek
cfd712b424 Various timer improvements
Now that clock_t is an unsigned value, we can also allow the system
uptime to wrap.  Essentially, instead of using (a <= b) to see if time
a occurs no later than time b, we use (b - a <= CLOCK_MAX / 2).  The
latter value does not exist, so instead we add TMRDIFF_MAX for that
purpose.

We must therefore also avoid using values like 0 and LONG_MAX as
special values for absolute times.  This patch extends the libtimers
interface so that it no longer uses 0 to indicate "no timeout".
Similarly, TMR_NEVER is now used as special value only when
otherwise a relative time difference would be used.  A minix_timer
structure is now considered in use when it has a watchdog function set,
rather than when the absolute expiry time is not TMR_NEVER.  A few new
macros in <minix/timers.h> help with timer comparison and obtaining
properties from a minix_timer structure.

This patch also eliminates the union of timer arguments, instead using
the only union element that is only used (the integer).  This prevents
potential problems with e.g. live update.  The watchdog function
prototype is changed to pass in the argument value rather than a
pointer to the timer structure, since obtaining the argument value was
the only current use of the timer structure anyway.  The result is a
somewhat friendlier timers API.

The VFS select code required a few more invasive changes to restrict
the timer value to the new maximum, effectively matching the timer
code in PM.  As a side effect, select(2) has been changed to reject
invalid timeout values.  That required a change to the test set, which
relied on the previous, erroneous behavior.

Finally, while we're rewriting significant chunks of the timer code
anyway, also covert it to KNF and add a few more explanatory comments.

Change-Id: Id43165c3fbb140b32b90be2cca7f68dd646ea72e
2016-08-05 11:12:44 +00:00
rlfnb
bf609e1012 Preparations for PAE support
Change-Id: I9a7c9ed9f803e2e26d745d14149a8aec64ab0c75
2016-08-04 09:24:42 +02:00
Antoine Leca
55a5a21b97 Clean up traces from long-gone sys_int86 interface
Change-Id: I773ab67342be852cc74f76b4fcbb338c9cb11f7e
2016-07-20 19:00:44 +02:00
Antoine Leca
a2bd2caf02 Drop obsolete postinstall script
Conflicts with NetBSD /usr/sbin/postinstall(8)

Change-Id: Iaefe4494b95b46d1134f4a477798765bbcc66c70
2016-07-20 17:35:49 +02:00
Antoine Leca
4aaaf2c612 Remove long-obsolete pwdauth(8) command (in usr/lib)
Change-Id: I454d506199ce1d5d48295bca86b590ce0701dcc2
2016-07-20 17:35:37 +02:00
Antoine Leca
7eb1c60ab5 Allow part(8) to make subpartitions above 4G
Change-Id: I3fd2c5de7cbb190b857eb34f16463f67a30118a3
2016-07-14 12:34:41 +02:00
Lionel Sambuc
733a844ac6 kernel/cpulocals.h: Simplify macros
Change-Id: Ice845fb0743ff686398293cef2620f5ac9c902ad
2016-07-09 12:18:15 +02:00
Richard Sailer
637f688f0d PM: Convert K&R C -> ANSI C
Aditionally this removes all trailing whitespaces in pm server code
using: sed -i 's/[[:space:]]*$//' *.c

Change-Id: Ie44162fd56cd7042f4f0cc7bd7314b17ea128761
2016-07-08 21:24:33 +02:00
David van Moolenbroek
764cd267a7 INET/LWIP: minimal net.route sysctl support
At a point not too far in the future, we will be switching from the
hardcoded MINIX3 implementation of the getifaddrs(3) libc routine to
the proper NetBSD implementation.  The latter uses the
net.route.rtable sysctl functionality to obtain its information.  In
order make the transition as painless as possible, this patch adds
basic support for that net.route.rtable functionality to INET and
LWIP, using the remote MIB (RMIB) facility.

Change-Id: I54f5cea7985f6606e317c73a5e6be3a5d07bc7dc
2016-06-18 12:47:30 +00:00
David van Moolenbroek
534584945c IPC: use RMIB to handle kern.ipc sysctl subtree
With this patch, the IPC service is changed to use the new RMIB
facility to register and handle the "kern.ipc" sysctl subtree itself.
The subtree was previously handled by the MIB service directly.  This
change improves locality of handling: especially the
kern.ipc.sysvipc_info node has some peculiarities specific to the IPC
service and is therefore better handled there.  Also, since the IPC
service is essentially optional to the system, this rearrangement
yields a cleaner situation when the IPC service is not running: in
that case, the MIB service will expose a few basic kern.ipc nodes
indicating that no SysV IPC facilities are present.  Those nodes will
be overridden through RMIB when the IPC service is running.

It should be easier to add the remaining (from NetBSD) kern.ipc nodes
as well now.

Test88 is extended with a new subtest that verifies that sysctl-based
information retrieval for semaphore sets works as expected.

Change-Id: I6b7730e85305b64cfd8418c0cc56bde64b22c584
2016-06-18 12:47:24 +00:00