2022-10-07 20:16:44 +02:00
# Luna
2024-03-29 20:42:09 +01:00
A simple POSIX-based operating system for personal computers, written in C++.
2022-10-07 20:16:44 +02:00
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 ).
2022-10-07 20:16:44 +02:00
## Features
2023-01-08 15:55:01 +01:00
- x86_64-compatible lightweight [kernel ](kernel/ ).
2023-09-20 21:07:37 +02:00
- Simple round-robin [scheduler ](kernel/src/thread/ ).
- Read-only [ext2 ](kernel/src/fs/ext2/ ) filesystem.
2023-08-08 16:19:38 +02: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).
2023-09-20 21:07:37 +02:00
- [C Library ](libc/ ), aiming for POSIX compatibility, with many features such as local domain sockets, signals, and shared memory.
2023-08-08 16:19:38 +02:00
- Support for [several third-party programs ](ports/ ), including the [GNU binutils ](ports/binutils/PACKAGE ) suite of utilities.
2023-01-08 15:55:01 +01:00
- Designed to be [portable ](kernel/src/arch ), no need to be restricted to x86_64.
2023-09-20 21:07:37 +02:00
- Everything is designed around [UTF-8 ](libluna/include/luna/Utf8.h ).
2023-03-11 10:37:38 +01:00
- Environment-agnostic [utility library ](libluna/ ), which can be used in both kernel and userspace.
2023-08-08 16:19:38 +02:00
- 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/ ).
2023-09-20 21:07:37 +02:00
- A simple and efficient [windowing system ](wind/ ), providing a lightweight GUI environment (still in development, not many GUI apps exist).
## Screenshot

2022-10-29 10:13:36 +02:00
2023-01-08 15:55:01 +01:00
## Setup
2022-12-07 11:13:16 +01:00
2023-07-22 11:45:35 +02: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` .
2022-10-07 20:16:44 +02:00
2023-07-22 11:45:35 +02:00
For this, you should start by installing the [required dependencies ](https://wiki.osdev.org/GCC_Cross_Compiler#Installing_Dependencies ).
2022-10-07 20:16:44 +02:00
2023-07-11 11:50:57 +02:00
Then, run `tools/setup.sh` to build the toolchain.
2022-10-07 20:16:44 +02:00
Please beware that building GCC and Binutils can take some time, depending on your machine.
## Running
2023-07-22 11:45:35 +02:00
To run Luna in a virtual machine, you should have [QEMU ](https://www.qemu.org/ ) installed.
2024-02-10 11:50:01 +01:00
Additionally, the build process needs some extra dependencies to run: `cmake` , `ninja` , `nasm` , `fakeroot` and `genext2fs` .
2022-10-07 20:16:44 +02:00
2023-07-11 11:50:57 +02: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.
2022-10-07 20:16:44 +02:00
2024-03-28 22:37:16 +01: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` manually since `run.sh` does it for you.
2022-10-07 20:16:44 +02:00
## Prebuilt images
2024-03-28 22:37:16 +01:00
Prebuilt ISO images for every release version can be found at [pub.cloudapio.eu ](https://pub.cloudapio.eu/luna/releases ).
2022-10-24 21:12:22 +02:00
2022-10-23 17:15:38 +02:00
## Is there third-party software I can use on Luna?
2023-07-24 18:29:44 +02:00
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.
2022-10-23 17:15:38 +02:00
2022-10-07 20:16:44 +02:00
## License
2023-07-30 11:55:08 +02:00
Luna is open-source and free software under the [BSD-2-Clause License ](LICENSE ).