Luna/docs/dependencies.md
apio 5cb4b8b1fe
All checks were successful
Build and test / build (push) Successful in 1m41s
docs: Add clang-format dependency
2024-12-23 22:59:57 +01:00

2.9 KiB

Dependencies required to build and run Luna

System requirements

Any modern UNIX-like system that supports all the tools listed below should work (Hopefully, that will include Luna itself in the future!).

I personally build and run Luna on an amd64 Fedora Linux 40 machine. CI runs on arm64 Ubuntu 22.04. Any other configurations are untested. Windows is not supported, although you can try using WSL if you really want to.

Building a cross-compiler toolchain

For this, you should start by installing the required dependencies for any OSdev cross-compiler build.

Also make sure you have the perl module File::Compare installed, it is required to build autoconf. On Fedora you can install it using the package manager by running # dnf install perl-File-Compare. If your distro doesn't have it, you might have to install it via cpan.

Building the actual system

The build process needs some extra dependencies to run: cmake, ninja, nasm, fakeroot and genext2fs. On some distributions the ninja package is called ninja-build instead.

If you want to use make instead of ninja, create a file called env-local.sh in the project root and add the line USE_MAKE=1. In this case, ninja does not need to be installed.

Running the built image in a virtual machine

The script provided by the project to run the system, tools/run.sh, assumes that QEMU is installed and uses that to run the image. Therefore, make sure your system has qemu-system-x86_64 in the PATH. If it doesn't, install it using the method appropriate for your system, usually installing qemu or qemu-system from the package manager.

That being said, there's no requirement to use QEMU. If you want to use a different virtualization program, such as Oracle VirtualBox or VMWare, just use tools/build-iso.sh instead of run.sh and use the built Luna.iso in those programs.

Formatting/linting

Please make sure you have clang-format installed. Additionally, if your editor does not support format-on-save or you do not have it configured, please run tools/run-clang-format.sh before committing, to make sure all code follows the same style conventions.

Source dependencies

TLDR: Luna does not depend on any third-party library.

Every part of Luna is written from scratch and depends only on its own libraries and programs, with two small exceptions (included here for crediting and licensing purposes, but there is no need to download and build them separately):

The bootloader, BOOTBOOT. It is available at gitlab.com/bztsrc/bootboot, under the MIT license. It is automatically pulled and built from source by tools/setup.sh.

libc/src/strtod.cpp. Written by Yasuhiro Matsumoto, adapted from https://gist.github.com/mattn/1890186 and available under a public domain license.