Luna/README.md

60 lines
3.9 KiB
Markdown
Raw Normal View History

# Luna
2023-08-08 14:04:10 +00:00
A simple 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)
2023-04-04 20:57:55 +00:00
## 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/).
2023-07-01 15:40:29 +00:00
- [Virtual file system](kernel/src/fs/) with a simple [tmpfs](kernel/src/fs/tmpfs/) and read-only [ext2](kernel/src/fs/ext2/) support.
2023-08-08 14:19:38 +00:00
- Can [load ELF programs](kernel/src/binfmt/ELF.cpp), [shebang scripts](kernel/src/binfmt/Script.cpp) or [arbitrary binary formats](kernel/src/binfmt/BinaryFormat.h) (registered through kernel modules, which are not supported yet =D).
- Boots from an [ext2](apps/preinit.cpp) root filesystem (a bit slow for now).
2023-08-08 14:19:38 +00:00
- [System call](kernel/src/sys/) interface and [C Library](libc/), aiming to be almost POSIX-compatible.
- Support for [several third-party programs](ports/), including the [GNU binutils](ports/binutils/PACKAGE) suite of utilities.
2023-07-11 09:50:57 +00:00
- POSIX [signal](libc/src/signal.cpp) support.
- Designed to be [portable](kernel/src/arch), no need to be restricted to x86_64.
2023-08-08 14:19:38 +00:00
- Everything is [UTF-8](libluna/include/luna/Utf8.h).
2023-07-30 09:55:08 +00:00
- [UNIX local domain sockets](kernel/src/net/UnixSocket.cpp), allowing for local IPC.
2023-08-08 14:19:38 +00:00
- [POSIX shared memory](libc/include/sys/mman.h) support.
- Environment-agnostic [utility library](libluna/), which can be used in both kernel and userspace.
2023-08-08 14:19:38 +00:00
- Return-oriented [error propagation](libluna/include/luna/Result.h), inspired by Rust and SerenityOS. No exceptions here :).
- An extensive set of [standard Unix utilities](apps/), from [ls](apps/ls.cpp) to [uname](apps/uname.cpp) to [base64](apps/base64.cpp). Written in modern C++ and very small amounts of code, using Luna's practical [OS library](libos/).
2022-10-29 08:13:36 +00:00
## Setup
2022-12-07 10:13:16 +00:00
2023-07-22 09:45:35 +00:00
To build and run Luna, you will need to build a [cross-compiler](https://wiki.osdev.org/Why_do_I_need_a_Cross_Compiler) and cross-binutils for `x86_64-luna`.
2023-07-22 09:45:35 +00:00
For this, you should start by installing the [required dependencies](https://wiki.osdev.org/GCC_Cross_Compiler#Installing_Dependencies).
2023-07-11 09:50:57 +00:00
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
2023-07-22 09:45:35 +00:00
To run Luna in a virtual machine, you should have [QEMU](https://www.qemu.org/) installed.
Additionally, the build process needs some extra dependencies to run: `cmake`, `ninja`, `nasm` and `genext2fs`.
2023-07-11 09:50:57 +00:00
`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.
2023-07-11 09:50:57 +00:00
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
2022-10-24 19:15:22 +00:00
Prebuilt ISO images (numbered) for every version can be found at [pub.cloudapio.eu](https://pub.cloudapio.eu/luna/releases).
2023-07-22 09:45:35 +00:00
These images are built manually whenever a new release is created, and thus don't reflect the latest changes on the `main` branch.
2023-07-11 09:50:57 +00:00
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?
Yes! A ports system is in place, and you can use the build scripts to add some ports to your image. More information in the [Ports](ports/README.md) page.
## License
2023-07-30 09:55:08 +00:00
Luna is open-source and free software under the [BSD-2-Clause License](LICENSE).