All Projects → Narasimha1997 → rust-kernel-barebones

Narasimha1997 / rust-kernel-barebones

Licence: MIT license
A minimal 64-bit rust kernel and a bunch of configuration scripts that can be used to bootstrap Operating system development using Nightly-Rust compiler.

Programming Languages

shell
77523 projects
rust
11053 projects

Projects that are alternatives of or similar to rust-kernel-barebones

SynnixOS
Hobbyist Operating System targeting x86_64 systems. Includes userspace, Virtual File System, An InitFS (tarfs), Lua port, easy porting, a decent LibC and LibM, and a shell that supports: piping, file redirection, and more.
Stars: ✭ 40 (-4.76%)
Mutual labels:  kernel, x86-64, osdev
Wingos
a little 64bit operating system written in c++ with smp support
Stars: ✭ 361 (+759.52%)
Mutual labels:  kernel, x86-64, osdev
KnutOS
An x86_64 hobbyist OS written in C and Assembly
Stars: ✭ 16 (-61.9%)
Mutual labels:  kernel, x86-64, osdev
Os2
x86_64 OS kernel with completely async userspace and single address space [WIP; but basic kernel functionality implemented]
Stars: ✭ 25 (-40.48%)
Mutual labels:  kernel, x86-64, osdev
biefircate
Running x86-16 or x86-32 code from x86-64 UEFI; _very experimental_ • mirror of https://gitlab.com/tkchia/biefircate • developer notes at https://gitlab.com/tkchia/biefircate/-/blob/main/doc/NOTES.asciidoc
Stars: ✭ 47 (+11.9%)
Mutual labels:  kernel, x86-64, osdev
Monkos
an experimental 64-bit operating system
Stars: ✭ 100 (+138.1%)
Mutual labels:  kernel, x86-64, osdev
Toaruos
A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
Stars: ✭ 4,687 (+11059.52%)
Mutual labels:  kernel, x86-64, osdev
Cuteos
A 64-bit SMP-safe kernel for the PC architecture.
Stars: ✭ 51 (+21.43%)
Mutual labels:  kernel, x86-64, osdev
Dennix
Dennix is a unix-like hobbyist operating system written from scratch.
Stars: ✭ 53 (+26.19%)
Mutual labels:  kernel, x86-64, osdev
Dgos
Operating System
Stars: ✭ 90 (+114.29%)
Mutual labels:  kernel, x86-64, osdev
Cyjon
A simple, clean code, multi-tasking operating system written in pure assembly language for 64-bit processors from the AMD64 family.
Stars: ✭ 184 (+338.1%)
Mutual labels:  kernel, x86-64, osdev
saturn
A microkernel based operating system developed from scratch. This repository also includes all Saturn services and applications.
Stars: ✭ 21 (-50%)
Mutual labels:  x86-64, osdev
duckOS
Yet another hobby x86 UNIX-like operating system written in C and C++. Features a dynamically linked userspace, an in-house c standard library, and more! And yes, it runs DOOM.
Stars: ✭ 250 (+495.24%)
Mutual labels:  kernel, osdev
MoonOS
MoonOS (just a kernel atm) is a micro kernel designed for the x86_64 and arm architecure.
Stars: ✭ 82 (+95.24%)
Mutual labels:  x86-64, osdev
kwast
Rust operating system running WebAssembly as userspace in ring 0
Stars: ✭ 83 (+97.62%)
Mutual labels:  x86-64, osdev
DentOS
Experimental Stand-alone 32-bit Kernel with Bootloader written in AT&T Assembly and Freestanding C
Stars: ✭ 32 (-23.81%)
Mutual labels:  kernel, osdev
misaka
Experimental x86_64 kernel project. Planned eventual successor to the kernel in ToaruOS. WIP
Stars: ✭ 82 (+95.24%)
Mutual labels:  kernel, x86-64
Cardinal
Operating system designed to be fast and secure.
Stars: ✭ 20 (-52.38%)
Mutual labels:  kernel, osdev
chaos-2
A hand-made SMP-aware kernel
Stars: ✭ 20 (-52.38%)
Mutual labels:  kernel, osdev
Kernel
The Stupid Operating System
Stars: ✭ 217 (+416.67%)
Mutual labels:  kernel, osdev

rust-kernel-barebones

A minimal 64-bit rust kernel and a bunch of configuration scripts that can be used to bootstrap Operating system development using Nightly-Rust (x86_64-unkown-linux-gnu host-triple) compiler.

This repository uses tools built by the awesome Rust OsDev community (like xbuild, bootloader crates) and configures all of these tools to work together so developers can use them without having to worry much on toochain configuration. The toolchain builds and configures the project to use x86_64-unknwon-none target. Some features include:

  1. A single script that configures the whole environment.
  2. A single script to build the kernel and emulate it using Qemu.
  3. VS Code RLS configuration.

Tools used by this barebones:

  1. bootloader - A bootloader written in Rust.
  2. cargo-xbuild - A tool that takes care of managing nightly rust toolchain.

Prerequisites

  1. A linux based operating system with bash shell.
  2. apt package manager (if you are using Red hat based distros, modify tools/setup_env.sh file.)

How to set-up?

Follow these simple steps to bootstrap a working kernel development environment:

  1. Clone the repository with it's submodules:
git clone --recurse-submodule [email protected]:Narasimha1997/rust-kernel-barebones.git
  1. Setup the environment: Just run the file:
bash ./tools/setup_env.sh

This will check for tools like qemu, kvm, rustc, cargo and jq. Tools which are not present will be installed and you may need to enter few choices while installation. Next it will download and install few rust crates that are required for the toolchain to work properly. Then the script configures VS code editor to make RLS plugin recognize the x86_64-unknown-none target.

Note:: After running this script you may have to restart the shell before proceeding to step 3 if cargo and rustc are freshly installed because the $PATH needs to be updated to make sure cargo and rustc are picked up. You can also run source ~/.bashrc to manually refresh the shell's env.

  1. Build and run the kernel: To build and run the kernel, just run:
bash tools/run_qemu.sh

This will build the kernel with bootloader and creates a bootable image, then spins up the qemu with KVM acceleration. If you want to only build and skip emulation, then:

bash tools/run_qemu.sh --build

The build artifcats are generated at kbin directory, so build artifacts will be cached for next time. If you want to force a rebuild from scratch again, then:

bash tools/run_qemu.sh --clean

You can use both of these options together as well:

bash tools/run_qemu.sh --clean --build

If everything is successful, the kernel should bootup into a blank screen and qemu should create a serial.out file where the kernel will write Hello, World!! via a serial port.

UEFI Mode:

Normally the kernel will be booted in legacy BIOS mode. In order to enable UEFI mode, pass --uefi flag to the run_qemu.sh.

bash tools/run_qemu.sh --uefi

The UEFI mode uses Open Virtual Machine Firmware (OVMF) and can be installed via ovmf package. The setup_env.sh script will install this as well, the UEFI firmware will be added to qemu-system-x86_64 via -bios /usr/share/ovmf/OVMF.fd flag. The --uefi flag can be used with other flags as well:

bash tools/run_qemu.sh --uefi --clean --build

Configuring QEMU parameters:

To use your own custom parameters for qemu emulation, modify QEMU_ARGS variable in tools/run_qemu.sh file.

Contributing:

Feel free to try this tool, raise issues, suggest changes or make pull requests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].