57 lines
3.5 KiB
Markdown
57 lines
3.5 KiB
Markdown
# Luna
|
|
A very basic POSIX-based operating system for personal computers, written in C++. [![Build Status](https://drone.cloudapio.eu/api/badges/apio/Luna/status.svg)](https://drone.cloudapio.eu/apio/Luna)
|
|
|
|
## Another UNIX clone?
|
|
[Yes, another UNIX clone](https://wiki.osdev.org/User:Sortie/Yes_Another_Unix_Clone).
|
|
|
|
## Features
|
|
- x86_64-compatible lightweight [kernel](kernel/).
|
|
- Preemptive multitasking, with a round-robin [scheduler](kernel/src/thread/).
|
|
- [Virtual file system](kernel/src/fs/) with a simple [tmpfs](kernel/src/fs/tmpfs/) and read-only [ext2](kernel/src/fs/ext2/) support.
|
|
- Can [load ELF programs](kernel/src/thread/ELF.cpp) from the file system as userspace tasks.
|
|
- Boots from an [ext2](apps/preinit.cpp) root filesystem (a bit slow for now).
|
|
- [System call](kernel/src/sys/) interface and [C Library](libc/), aiming to be mostly POSIX-compatible.
|
|
- POSIX [signal](libc/src/signal.cpp) support.
|
|
- Designed to be [portable](kernel/src/arch), no need to be restricted to x86_64.
|
|
- Designed around [UTF-8](libluna/include/luna/Utf8.h).
|
|
- Environment-agnostic [utility library](libluna/), which can be used in both kernel and userspace.
|
|
- Return-oriented [error propagation](libluna/include/luna/Result.h), inspired by Rust and SerenityOS.
|
|
- Build system uses [CMake](CMakeLists.txt).
|
|
|
|
## Setup
|
|
|
|
To build and run Luna, you will need to build a [GCC Cross-Compiler](https://wiki.osdev.org/Why_do_I_need_a_Cross_Compiler) and cross-binutils for `x86_64-luna`. (Yes, Luna is advanced enough that it can use its own [OS-Specific Toolchain](https://wiki.osdev.org/OS_Specific_Toolchain), instead of a bare metal target like `x86_64-elf`. It is the first of my OS projects to be able to do so. The patches for Binutils and GCC are [binutils.patch](tools/binutils.patch) and [gcc.patch](tools/gcc.patch)).
|
|
|
|
You should start by installing the [required dependencies](https://wiki.osdev.org/GCC_Cross_Compiler#Installing_Dependencies).
|
|
|
|
Additionally, some extra Luna-specific dependencies you should install are: cmake, ninja, nasm and genext2fs.
|
|
|
|
Then, run `tools/setup.sh` to build the toolchain.
|
|
|
|
Please beware that building GCC and Binutils can take some time, depending on your machine.
|
|
|
|
## Running
|
|
|
|
You should have [QEMU](https://www.qemu.org/) installed.
|
|
|
|
`tools/run.sh` is the script you should use in most cases. It will build changed files, install, make an ISO image, and run Luna in QEMU.
|
|
|
|
If you have no toolchain set up, `run.sh` will build it automatically, which means that you don't necessarily have to run `setup.sh` since `run.sh` does it for you.
|
|
|
|
## Prebuilt images
|
|
|
|
Prebuilt ISO images (numbered) for every version can be found at [pub.cloudapio.eu](https://pub.cloudapio.eu/luna/releases).
|
|
|
|
These images are built manually whenever I decide to make a new version, and thus don't reflect the latest changes on the `main` branch.
|
|
|
|
Every hour, this server pulls the latest commits on `main` and builds an hourly ISO image. The ten most recent ones can be found in the [hourly](https://pub.cloudapio.eu/luna/hourly) directory, and [Luna-latest.iso](https://pub.cloudapio.eu/luna/Luna-latest.iso) should always be symlinked to the newest one.
|
|
|
|
These images do reflect the latest changes on the `main` branch, but are obviously less stable. Additionally, an hourly image will be skipped if building the latest commit of the project fails.
|
|
|
|
## Is there third-party software I can use on Luna?
|
|
|
|
Not right now, but hopefully we can start porting some software soon!
|
|
|
|
## License
|
|
Luna is open-source and free software under the [BSD-2 License](LICENSE).
|