5e9e5b98 | 21-Mar-2018 |
Arne Welzel <arne.welzel@gmail.com> |
bsd.own.mk: use -mno-unaligned-access on ARM
Without this option, gcc may emit code accessing unaligned memory. This, and the fact that SCTRL.A (System Control Register - Alignment Check) is set to
bsd.own.mk: use -mno-unaligned-access on ARM
Without this option, gcc may emit code accessing unaligned memory. This, and the fact that SCTRL.A (System Control Register - Alignment Check) is set to 1 in Minix causes data aborts when such code is encountered.
This was the cause of #104. The `minix-service' executable caused unaligned memory accesses calling into getpwnam(). These then trigger data abort exceptions. On ARM, these were previously forwarded to `vm' as pagefaults. However, `vm' did not properly handle them, but instead allocated one page for the faulting address (over and over again) and then resumed the process at the faulting instruction (over and over again). This behavior masked the whole story as an OOM.
Below the assembly version getpwent.c in which unaligned memory accesses are even highlighted...
... 341 ldr lr, [sp, #48] 342 cmp lr, #0 343 bne .L46 344 ldr r0, [r4] @ unaligned 345 add r1, r7, #5 346 str r0, [sp, #4] @ unaligned 347 ldr r4, [sp, #4] 348 mov r5, r4, asr #31 349 strd r4, [r8, #40] ...
This should fix #104. It was tested on an actual Beaglebone Black.
An alternative fix would be to disable alignment checking by setting SCTRL.A to 0 and allowing unaligned memory accesses.
Change-Id: I4d366eb0af1b2936bca369fd28014fb829228ad5
show more ...
|
4c27a833 | 21-Jul-2016 |
David van Moolenbroek <david@minix3.org> |
Add libsockevent: a socket event dispatching library
This library provides an event-based abstraction model and dispatching facility for socket drivers. Its main goal is to eliminate any and all ne
Add libsockevent: a socket event dispatching library
This library provides an event-based abstraction model and dispatching facility for socket drivers. Its main goal is to eliminate any and all need for socket drivers to keep track of pending socket calls. Additionally, this library takes over responsibility of a number of other tasks that would otherwise be duplicated between socket drivers, but in such a way that individual socket drivers retain a large degree of freedom in terms of API behavior. The library's main features are:
- suspension, resumption, and cancellation of socket calls; - an abstraction layer for select(2); - state tracking of shutdown(2); - pending (asynchronous) errors and the SO_ERROR socket option; - listening-socket tracking and the SO_ACCEPTCONN socket option; - generation of SIGPIPE signals; SO_NOSIGPIPE, MSG_NOSIGNAL; - send and receive low-watermark tracking, SO_SNDLOWAT, SO_RCVLOWAT; - send and receive timeout support and SO_SNDTIMEO, SO_RCVTIMEO; - an abstraction layer for the SO_LINGER socket option; - tracking of various on/off socket options as well as SO_TYPE; - a range of pre-checks on socket calls that are required POSIX.
In order to track per-socket state, the library manages an opaque "sock" object for each socket. The allocation of such objects is left entirely to the socket driver. Each sock object has an associated callback table for calls from libsockevent to the socket driver. The socket driver can raise events on the sock object in order to flag that any previously suspended operations of a particular type should be resumed. The library may defer processing such raised events if immediate processing could interfere with internal consistency.
The sockevent library is layered on top of libsockdriver, and should be used by all socket driver implementations if at all possible.
Change-Id: I3eb2c80602a63ef13035f646473360293607ab76
show more ...
|
85723df0 | 21-Feb-2016 |
David van Moolenbroek <david@minix3.org> |
Add libsockdriver: a library for socket drivers
This library provides abstractions for socket drivers, and should be used as the basis for all socket driver implementations. It provides the followi
Add libsockdriver: a library for socket drivers
This library provides abstractions for socket drivers, and should be used as the basis for all socket driver implementations. It provides the following functionality:
- a function call table abstraction, hiding the details of the socket driver protocol with simple parameters and presenting the socket driver with callback functions very similar to the BSD socket API calls made from userland; - abstracting data structures and helper functions for suspending and resuming blocking calls; - abstracting data structures and helper functions for copying data from and to the caller.
Overall, the library is similar to lib{block,char,fs,input,net}driver in concept. Some of the abstractions provided here should in fact be applied to libchardriver as well. As always, for the case that the provided message loop is too restrictive, a set of more low-level message processing functions is provided.
Change-Id: I79ec215f5e195c3b0197e223636f987d3755fb13
show more ...
|
e110411e | 23-Feb-2017 |
David van Moolenbroek <david@minix3.org> |
share: also install other existing manpages
A pair of manual pages were already present in /usr/share/man, but not yet installed. Install them as well. Lots and lots more from NetBSD's set of manu
share: also install other existing manpages
A pair of manual pages were already present in /usr/share/man, but not yet installed. Install them as well. Lots and lots more from NetBSD's set of manual pages should be imported, though.
Change-Id: Ie2e8946967afcb2e71de563f06fa331586dcb31d
show more ...
|
3ac58492 | 24-Sep-2016 |
David van Moolenbroek <david@minix3.org> |
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,
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
show more ...
|
72965c88 | 13-Nov-2015 |
David van Moolenbroek <david@minix3.org> |
Integrate ASR instrumentation into build system
ASR instrumentation is now performed on all applicable system services if the system is built with MKASR=yes. This setting automatically enables MKMA
Integrate ASR instrumentation into build system
ASR instrumentation is now performed on all applicable system services if the system is built with MKASR=yes. This setting automatically enables MKMAGIC=yes, which in turn enables MKBITCODE=yes.
The number of extra rerandomized service binaries to be generated can be set by passing ASRCOUNT=n to the build system, where n is a number between 1 and 65536. The default ASRCOUNT is 3, meaning that each service will have one randomized base binary and three additional rerandomized binaries. As before, update_asr(8) can be used for runtime rerandomization.
Change-Id: Icb498bcc6d1cd8d3f6bcc24eb0b32e29b7e750c2
show more ...
|
bcc17a81 | 13-Nov-2015 |
David van Moolenbroek <david@minix3.org> |
Integrate magic instrumentation into build system
Magic instrumentation is now performed on all system services if the system is built with MKMAGIC=yes, which implies MKBITCODE=yes.
Change-Id: I9d1
Integrate magic instrumentation into build system
Magic instrumentation is now performed on all system services if the system is built with MKMAGIC=yes, which implies MKBITCODE=yes.
Change-Id: I9d1233650188b7532a9356b720fb68d5f8248939
show more ...
|