book/src/development/design/kernel.md

35 lines
1.6 KiB
Markdown
Raw Normal View History

2023-04-17 21:23:10 +00:00
# Microkernel
2023-04-18 03:01:54 +00:00
The core `kernel` of **Mercury** will be highly limited, implementing only necessary portions.
2023-04-18 11:19:16 +00:00
This allows other functionality to be simply run in userspace.
2023-04-18 03:01:54 +00:00
Additionally, most code should be put into separate libraries then pulled into the `kernel` code.
This will likely be done via `git submodules`.
Initially, it will be built for `RISC-V`, then `ARM` *(focused on running in a [VM](/user/virtual-machine.md))*, then on a **Raspberry Pi**.
Afterwards, we can put focus towards building out various features.
Support for multiple targets will be done via `Cargo.toml` targets, cross-compilation, and [conditional compilation](https://doc.rust-lang.org/reference/conditional-compilation.html).
2023-04-18 11:19:16 +00:00
2023-04-18 13:21:55 +00:00
## Concurrency
For performance, we will be using various concurrency programming techniques.
For **IO** intensive operations, `async` will be used.
This will include the [filesystem](/development/design/filesystem.md), [actors](/development/design/actor.md), and [GUI](/development/design/gui.md).
**CPU**-bound operations are better suited to individual `threads`, however.
This might include operations like *hashing*, *encryption*, and *indexing*.
2023-04-18 11:19:16 +00:00
## Boot Process
*To be implemented*
## Memory Management
*To-Do*
## Processes
*To-Do*
- [postcard](https://lib.rs/crates/postcard) for message passing
2023-04-18 12:28:20 +00:00
## Error Handling
All errors must be handled gracefully by the `kernel`. If possible, they should simply log an error.
2023-04-18 12:31:53 +00:00
If not, they can display it to the user, preferably in a simple format, maybe using something like [const_panic](https://lib.rs/crates/const_panic) or [snafu](https://lib.rs/crates/snafuhttps://lib.rs/crates/snafu).