Kernel Design
This page is under construction
SharpOS consists of C# microkernel containing a mix of unmanaged and managed code. The microkernel provides enough functionality to support loading, compiling, and executing both safe and unsafe IL as well as traditional managed applications. Processes containing safe IL code (the only variety initially supported) will be isolated from the kernel and other processes using “software isolation”, which employs verification of the code’s behavior using the information inherent in the IL bytecode. In this manner, most of the performance hit associated with context switching in traditional protected memory models disappears. However, the kernel will also employ the traditional protected memory techniques for unsafe IL and traditional unmanaged applications (C, C++, etc). Processes containing this sort of code will be isolated from the kernel/other processes using traditional “hardware isolation”.
Drivers and kernel modules will be normal processes (just like other processes) that make use of a well-defined interface between the kernel core and the driver code. These processes will have the proper rights to use the kernel driver facilities that provide methods of configuring/registering for interrupts and allocating DMA/device buffers (see Hardware Resource Management). Note that although the drivers will run in their own processes, they will be able to make calls to published kernel API functions at a speed similar to if they were compiled into the kernel (although there may be overhead for conversion of some managed data to the unmanaged equivalent for HIP processes).
Transient Nature of the Kernel design
The kernel design is currently being worked on, and a lot of details to entire sections might completely change.
The kernel …
- is an AOT compiled Micro-Kernel
- is loaded by a multiboot-compliant boot loader.
- handles the Security of the system
- implements the Architecture Dependent Code which handles:
- Architecture low level initialization
- Hardware Resource Management
- Memory Management
- JIT Compilation
- manages all the Processes and the Inter Process Communication between them.
- implements the Runtime and shares it (readonly) with all processes.
- detects all Devices, and tries to find drivers for these devices.
Some of those drivers are included in the kernel binary. - uses the following File system layout (for devices that need one)