docs: Add dependency information separately
All checks were successful
Build and test / build (push) Successful in 1m41s

This commit is contained in:
apio 2024-12-19 21:12:49 +01:00
parent 6dcdc43dc2
commit f91800f5e1
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 36 additions and 7 deletions

View File

@ -20,22 +20,20 @@ A simple POSIX-based operating system for 64-bit computers, written in C++.
## Screenshot
![Screenshot as of 0.6.0](docs/screenshots/screenshot-0.6.0.png)
## System requirements and dependencies
Read [docs/dependencies.md] for the full information. In short, all modern Unixes should work, provided the dependencies are available.
## Setup
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`.
For this, you should start by installing the [required dependencies](https://wiki.osdev.org/GCC_Cross_Compiler#Installing_Dependencies).
Then, run `tools/setup.sh` to build the toolchain.
There is a script provided for this. Run `tools/setup.sh` to build the toolchain.
Please beware that building GCC and Binutils can take some time, depending on your machine.
## Running
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`, `fakeroot` and `genext2fs`.
`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` manually since `run.sh` does it for you.

31
docs/dependencies.md Normal file
View File

@ -0,0 +1,31 @@
# 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](https://wiki.osdev.org/GCC_Cross_Compiler#Installing_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.
## Source dependencies
Every part of Luna is written from scratch and depends only on its own libraries and programs, with two small exceptions:
The bootloader, BOOTBOOT. It is available at [gitlab.com/bztsrc/bootboot](https://gitlab.com/bztsrc/bootboot), under the MIT license. It is automatically pulled and built from source by `tools/setup.sh`.
(libc/src/strtod.cpp)[libc/src/strtod.cpp]. Written by Yasuhiro Matsumoto, adapted from https://gist.github.com/mattn/1890186 and available under a public domain license.
There is no need for you to install any of these before building the system.