Skip to content

Spydr06/amethyst

Repository files navigation

Amethyst

A UNIX-like OS with functional configuration and scripting support.

Important

This project is purely meant for educational purposes. There is no effort to produce production-ready code. Expect many features to be buggy, broken or even unimplemented.

Overview

This Project consists of three main pieces of software:

a) Amethyst - The Kernel

The Amethyst kernel is a UNIX-like monolithic kernel built completely from scratch in C23 and Assembly.

This is the main part of this project. The code can be found in the init/, kernel/, drivers/ and include/ directories. Platform-specific code is located in the arch/ directory.

Features:

  • Booting using the limine boot loader
  • Paging, physical and virtual memory management
  • Kernel heap
  • UNIX-like VFS (including pseudo-filesystems like devfs (/dev) and tmpfs (/tmp))
  • proper file systems like FAT32, ext2, ...
  • NVMe driver
  • SMP-enabled preemptive multitasking and process management
  • Syscalls
  • Kernel stack switching
  • User mode
  • PCI device identifictation & interaction
  • Keyboard input
  • Mouse input
  • ...

Supported Architectures:

  • x86_64
  • riscv64 (planned)

b) Shard - A functional scripting language

Shard is a functional programming language designed for declarative builds and configuration of the Amethyst Operatiing system.

See ./shard and ./shard/README.md for more information.

c) Geode - A declarative package manager based on Shard

Geode is the package manager and build system of the Amethyst Operating System.

See its source in ./shard/geode and the package store in ./store.

Features:

  • bootstrap: Build a new fully functioning system from a single configuration file [in progress]
  • rebuild: Rebuild the system root on the go
  • update: Pull store updates from the internet and do a full rebuild
  • ...

Warning

geode is in especially early development state. To get a booting system image, please refer to commit 7029ae7 until geode is able to bootstrap the full system.

Building

Build Dependencies:

  • GNU binutils
  • GNU make
  • gcc version >= 13 (with C23 support)
  • libarchive
  • python3 (versions tested: 3.11 - 3.13)

Runtime Dependencies:

  • qemu

Getting an ISO

  1. Clone this repository:
$ git clone https://github.com/spydr06/amethyst --recursive
$ cd amethyst
  1. Build the ISO image:
$ make

Note

When compiling for the first time, bootstrapping the system can take several minutes.

Running in a VM

To run amethyst in qemu, use either the run or run-kvm make targets in order to run with or without KVM enabled.

$ make run

or (with KVM):

$ make run-kvm

Contributing

Pull requests are welcome. For major changes, please open an issue first for discussion. Make sure to update unit tests as appropriate.

Please note that this is a toy OS. Hardware support and system stability are not guaranteed.

License

Amethyst, Shard and Geode are licensed under the MIT License. See ./LICENSE for more information.

For all other parts (pci.ids, limine, libarchive, ...), their respective licenses apply. I take no credit at these projects.

Resources | Reference | Inspiration

About

Yet another small unix-like kernel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published