book/src/development/design/README.md

74 lines
3.0 KiB
Markdown
Raw Normal View History

2023-04-17 21:23:10 +00:00
# Understanding the Design Goals
**Mercury** has several new and novel design decisions that make it radically different from other general Operating Systems.
```admonish warning
A lot of these designs will likely change and shift as work get's done on the project.
```
First off, it's written in [Rust](https://www.rust-lang.org/), which allows for several nice features, including:
- Memory safety
- Easy dependency and build management with `cargo`
- Great performance and reliability
- Several compilation targets, with simple cross-compilation
It also uses [microkernel](https://doc.redox-os.org/book/ch04-01-microkernels.html) architecture - this allows for us to keep the base kernel code small, and have additional features be modular, and easy to integrate into other projects.
This also allows for a smaller attack surface, less bloat, smaller code, etc.
Additionally, **Mercury** is designed for `ARM`/`RISC-V` architecture machines.
This is not only because they are simpler, but also because I believe they are the future of computing.
For the future, I do not see myself wanting or attempting to implement `x86` functionality.
2023-04-18 11:23:49 +00:00
We may also use [Rhai](https://lib.rs/crates/rhai) for scripting, for easy user control & modification of the system.
2023-04-18 12:31:39 +00:00
It will also use a global configuration - similar to **Guix** or **NixOS**. This allows it to be easily setup.
It will likely use [RON](https://lib.rs/crates/ron) for configuration.
2023-04-18 12:33:23 +00:00
**Note:** [figlet-rs](https://lib.rs/crates/figlet-rs) can be used for cool `ASCII` art!
2023-04-17 21:23:10 +00:00
Further design decisions are gone into detail in the next few chapters.
## Code Organization
```admonish info
These names and layout are all **WIP**.
```
2023-04-20 18:38:24 +00:00
All of the code will take place in separate repositories.
2023-04-17 21:23:10 +00:00
Information on actually commiting, pulling, etc. is in the [Workflow](/development/workflow.md) chapter.
Most of the code will be implemented as libraries, enabling for them to be used across systems, and worked on separately.
2023-04-19 03:52:16 +00:00
Similarly drivers will be libraries in `git submodules`.
2023-04-17 21:23:10 +00:00
2023-04-19 03:52:16 +00:00
- [ferrite](https://git.lavender.software/mercury/ferrite-kernel) - The core microkernel code w/ bootloader
2023-04-17 21:23:10 +00:00
- [hermes]() - The package manager
- [meteor]() - The [actors](/development/design/actor.md) library/implementation
2023-04-18 01:26:02 +00:00
- [gravitas]() - The library for working with [storage](/development/design/filesystem.md)
2023-04-17 21:23:10 +00:00
- [pulsar]() - Networking code
- [photon]() - GUI library
## Overall Design
### Connections
```mermaid
erDiagram
2023-04-19 03:52:16 +00:00
BOOTLOADER ||--|| KERNEL: runs
KERNEL ||..o{ GRAVITAS: uses
KERNEL }|..o{ METEOR: uses
GRAVITAS }|..o{ HAL: uses
GRAVITAS ||--o{ DISK: IO
KERNEL ||--|{ MEMORY: maps
KERNEL ||--o{ EXE: runs
EXE }|..o{ METEOR: uses
EXE }|..o{ KERNEL: msg
```
### Startup Flow
```mermaid
flowchart TD
2023-04-19 16:32:30 +00:00
boot[Bootloader] --> kern(Kernel)
2023-04-20 01:47:45 +00:00
kern --> disk(Read Disk) --> ind(Index Filesystem) -->
parse(Parse Configuration) --> run(Run Startup Programs)
parse -.-> sh([Interactive Shell])
2023-04-20 01:47:45 +00:00
kern --> mem(Map Memory) -.-> ind
run ==> actor([Create Actors])
```