/silicium

A modern, fast and portable micro-kernel written entirely in Rust

Primary LanguageRustApache License 2.0Apache-2.0


Silicium

A kernel written in Rust exploring modern concepts
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Acknowledgments

About The Project

Important

Silicium is a work in progress and is not ready for production use.

Silicium is a kernel written in Rust. It try to be a fast, portable kernel with a modern design. Its main goals are:

  • Being portable: Silicium is designed to be able to run on many architectures, by including good abstractions since the beginning of the project.
  • Being fast: Silicium is designed to be fast, efficient and scalable. It should be able to run on low-end hardware as well as on high-end hardware and to take advantage of modern hardware features and design.
  • Being ABI-agnostic, meaning that it should be able to run, in theory, any program written for Linux, Windows or MacOS by using a server that will translate foreign ABIs to Silicium's ABI.
  • Being secure: Silicium is designed to be secure by default. It should be able to run untrusted code without any risk of compromising the system.
  • Being educational. Silicium is designed to be a learning experience for me and for others. It should be easy to understand and to contribute to, and well documented

Note

The goals of Silicium are very ambitious and it is likely that it will never be able to achieve them. However, I think it's a good idea to aim high and to correctly design the project from the start to be able to achieve these goals in the future.

(back to top)

Getting Started

Prerequisites

To build this project, you will need to have Rust and rustup installed on your machine. You can install it by following the instructions on the official website.

There are also a few more dependencies in order to build and run the project:

  • qemu for running the kernel in a virtual machine. You can install it with your package manager. Make sure to install the version corresponding to your target architecture (e.g. qemu-system-x86_64 if you want to run the x86_64 kernel). This is not necessary the same as your host architecture.
  • gcc for compiling the Limine bootloader
  • lld for linking the kernel
  • xorriso for creating the ISO image

Building

Clone the repository:

git clone --depth 1 https://github.com/haoud/silicium.git

Make all the scripts contained in the scripts directory executable:

chmod +x scripts/*

Build the kernel, servers and userland programs:

make build

Run the kernel in Qemy:

make run

Tip

If you are lost, you can run make help to see all the available commands.

(back to top)

Usage

Caution

Running the kernel on real hardware is strongly discouraged as the kernel is not stable and may, even if unlikely, permanently damage your hardware or erasing your data. Use at your own risk.

To run Silicium:

  • http://copy.sh/v86/ : Upload .iso file as an CD-ROM image
  • QEMU: make run-{i686/x86_64/aarch64}
  • Real hardware: Burn .iso file to USB or CD.

By default, the kernel is built for all supported architectures, and the x86_64 version is run in a virtual machine. If you want to run a specific target, you must specify it in the make command:

make run-aarch64

Warning

Although the kernel is designed to be portable, it is not yet tested on all architectures. The "main" architecture is x86_64, and the other architectures are not as well supported. By default, the make run command will run the x86_64 version of the kernel.

(back to top)

Roadmap

Milestone 1: Baremetal kernel (x86-64 only)

  • Babysteps (unit tests, CI, benchmarks...)
  • Serial logging
  • GDT/IDT/TSS
  • Paging
  • APIC
  • IOAPIC
  • Local APIC
  • APIC timer
  • SIMD
  • SMP

Milestone 2: Userspace

  • Physical memory management
  • Kernel heap
  • Thread
  • Process
  • Scheduler
  • Basic syscalls

Milestone 3: WIP

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Silicium is dual-licensed under the Apache License, Version 2.0 and the MIT license. See LICENSE-APACHE and LICENSE-MIT for details.

(back to top)

Acknowledgments

  • Writing an OS in Rust, an amazing starter guide for OS development in Rust
  • OSDev, the golden resource for OS development
  • Limine, a powerful bootloader that is simple and easy to use, and greatly reduce the complexity of the kernel
  • Rust, for creating a amazing language that is (almost) perfect for OS development
  • README Template

(back to top)