Skip to content

CMIW/Simple_OS

Repository files navigation

Simple OS

GitHub repo size GitHub contributors GitHub stars GitHub forks

This project is an experiment to learn Kernel and OS development concepts. It's a small operating system in the Rust programming language following the Writting an OS in Rust series. It only supports x86.

Kernel Hello World!

Hello World on qemu-system-x86_64

Requirements

  • Linux system
  • rustup
  • qemu run sudo apt install qemu-system-x86

Clone the project and in the project root run the following commands.

  • llvm-tools-preview run rustup component add llvm-tools-preview
  • rust-src run rustup component add rust-src
  • bootimage run cargo install bootimage

Building

This project requires a nightly version of Rust because it uses some unstable features. At least nightly 2020-07-15 is required for building. You might need to run rustup update nightly --force to update to the latest nightly even if some components such as rustfmt are missing it.

You can build the project by running:

cargo build

To create a bootable disk image from the compiled kernel, you need to install the bootimage tool:

cargo install bootimage

After installing, you can create the bootable disk image by running:

cargo bootimage

This creates a bootable disk image in the target/x86_64-simple_os/debug directory.

Running

You can run the disk image in QEMU through:

cargo run

QEMU and the bootimage tool need to be installed for this.

You can also write the image to an USB stick for booting it on a real machine. On Linux, the command for this is:

dd if=target/x86_64-simple_os/debug/bootimage-blog_os.bin of=/dev/sdX && sync

Where sdX is the device name of your USB stick. Be careful to choose the correct device name, because everything on that device is overwritten.

Some sources

aarch64
Booting AArch64 Linux
Raspberry Pi Bare Bones
Raspberry Pi Bare Bones Rust
Writing my own Bootloader
os-tutorial
Writing a Simple Operating System — from Scratch
https://github.com/ababo/arwen
Booting AArch64 Linux
rpi4-osdev
rust_os

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages