tomOSii – The LibC Implementation¶
Since tomOSii is still a work in progress, no existing standard C library (libC) is currently being ported to the system. At the same time, the development of new kernel functionality requires executable programs to test and demonstrate that functionality.
These executables depend on a minimal amount of standard library support. To satisfy this requirement, tomOSii provides its own subset of a standard C library – also a work in progress.
The tomOSii libC is not intended to be a complete or fully standards-compliant C library. Instead, it provides:
A minimal set of C library functions and data types required by the current user-space executables.
A stable API surface that user-space code can be written against during early system development.
A transitional layer between executables and the kernel while the actual system call mechanism is still under construction.
The libC exposes an interface resembling traditional system calls, but these are not yet implemented as true system calls.
At present:
Executables still run in kernel mode.
There is no signal-based system call interface.
The libC functions directly call the kernel’s system call handler functions.
The addresses of these handlers are supplied via a linker script that is generated as part of the libC build process. During building, libC is partially linked against these kernel-provided symbols. This allows user-space executables to link against libC and invoke kernel functionality using the expected interface.
This design is intentional. By routing all kernel interaction through libC:
The API exposed to user-space executables can remain stable.
The internal implementation of these functions can later be changed to use a proper system call mechanism.
Existing executables will require little or no modification once true user space and actual system calls are implemented.
Functionality will be added to the libC implementation, whenever this is required for developing/testing/demonstrating new kernel functionality.
Headers Currently Available¶
Each page is currently just providing a list of function, data types etc. The documentation will be improved in the future.
<ctype.h>(Documentation)<fcntl.h>(Documentation)<stdio.h>(Documentation)<stdlib.h>(Documentation)<string.h>(Documentation)<sys/ioctl.h>(Documentation)<sys/reboot.h>(Documentation)<sys/utsname.h>(Documentation)<sys/wait.h>(Documentation)<unistd.h>(Documentation)