Table of Contents
The SRR Module (srripc) is an implementation of synchronous Send/Receive/Reply (S/R/R) message passing as a Linux kernel module. This module provides synchronous message passing among processes and threads, queued asynchronous event notification (proxies), timed delivery of proxies and signals, triggering of proxies between tasks, and user-space interrupt handling.
Synchronous messaging is a very fast means of communication and synchronization between two processes or threads, allowing a system developer to break a problem into separate threads of execution without the need for semaphores, mutexes or shared memory. User-space interrupt handling is implemented using a simple byte code interpreter that runs at interrupt time in the kernel, followed by the delivery of a proxy (scheduled asynchronous notification) to the user program after each interrupt. The user program transmits the byte code to the module at run time, and performs all non-time-critical processing in user space when the proxy is delivered. This makes it possible to write device drivers that service interrupts with no kernel programming. This implementation has been inspired by the QNX™ operating system, and includes a QNX 4 compatible API layer.
This is a beta release of the sofware. It has been used successfully to run a fairly large set of QNX applications under Linux, but it hasn't been used extensively. We welcome any comments, and hope it will be useful for anybody porting code from QNX to Linux, or wanting to experiment with S/R/R under Linux, perhaps even with the intention of eventually porting to QNX. To view the software version history, please refer to the CHANGES file in the distribution.
The ideas behind this implementation of S/R/R under Linux are simple:
Extend the kernel by writing a loadable kernel module.
Register with that module by opening its dev file /dev/srr, either explicitly with SrrReg(), or implicitly by making one of the library calls.
Map all (pseudo-) system calls to an ioctl() to the driver -- like other system calls the ioctl() can block, not block, perform arbitrary reads/writes into the process' address space, etc. It does everything that the QNX S/R/R API appears to do.
The ioctl()/module implementation should look familiar to a QNX systems programmer, since it is essentially an inversion of a QNX I/O resource manager. In QNX, S/R/R is used to pass structures holding Posix system call arguments (read, write, ioctl) to the I/O manager. In Linux we use an ioctl() to pass structures holding the arguments to QNX system calls to the kernel module.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.