The OS Library (OSLIB) is an optional set of RTOS features that can be added on top of both RT and NIL kernels.
The two kernels are now so compatible that it would have been a waste to duplicate so much code in both code trees. This is why some functionalities, previously part of RT, have now been moved in OSLIB.
From the application perspective it makes no difference if an certain feature is in the kernel or OSLIB so it is purely a source code architectural decision.
In OSLIB can be implemented all those features that meet the following requirements:
This is a list of the features found in the OSLIB, some of which will be detailed in next chapters. Some of the features are quite “high level”, not what you usually find in your average RTOS.
Three kind of memory allocators are provided:
The above mechanisms were previously in the RT kernel and have been moved into OSLIB.
A variation on the semaphore mechanism with only two internal states, this mechanism was previously in the RT kernel and has been moved into OSLIB.
Queues of asynchronous messages, this mechanism was previously in the RT kernel and has been moved into OSLIB.
Queues of objects composed by a pool of free object and a mailbox for pointers exchange. It is useful when there is the need to exchange fixed-size objects in a copy-less way.
Structure-less streams of bytes exchanged between threads.
It is a mechanism that allows to perform function calls in the context of another thread which is acting as a “functions server thread”. Function calls are “delegated” to a dedicated thread which performs the call synchronously.
Implements a queue of “jobs” that are consumed and executed by a “jobs server thread” asynchronously. A job is simply a structure containing a function pointer and a pointer argument.
Implements a cache of fixed-size objects which can be then retrieved by their numeric identifier. It could be used for a disk cache for example.
A system that allows to allocate other objects dynamically and attribute them a name. Objects can be used by reference, references can be obtained by searching for name.
The OSLIB has its own suite of tests, the tests are performed on both RT and NIL host kernels.