This step may vary depending on your operating system. Here is an example based on Debian:
$ sudo apt update
$ sudo apt install -y build-essential cmake clang qemu-system
Note: Running on LoongArch64 requires QEMU 10. If the QEMU version in your Linux distribution is too old (e.g. Ubuntu), consider installing QEMU from source.
- Download files from https://github.com/arceos-org/setup-musl/releases/tag/prebuilt
- Extract to some path, for example
/opt/riscv64-linux-musl-cross
- Add bin folder to
PATH
, for example:$ export PATH=/opt/riscv64-linux-musl-cross/bin:$PATH
$ git clone --recursive https://github.com/Starry-OS/StarryOS.git
$ cd StarryOS
Or if you have already cloned it with out --recursive
option:
$ cd StarryOS
$ git submodule update --init --recursive
# Install rustup from https://rustup.rs or using your system package manager
# Make sure that you don't have `RUSTUP_DIST_SERVER` set
$ export RUSTUP_DIST_SERVER=
# Automatically download components via rustup
$ cd StarryOS
$ rustup target list --installed
# Default target: riscv64
$ make build
# Explicit target
$ make ARCH=riscv64 build
$ make ARCH=loongarch64 build
This should also download required binary dependencies like cargo-binutils.
$ make img
$ make img ARCH=riscv64
$ make img ARCH=loongarch64
This will download rootfs image from GitHub Releases and setup the disk file for running on QEMU.
$ make run ARCH=riscv64
$ make run ARCH=loongarch64
# Shortcut:
$ make rv
$ make la
Note:
- You don't have to rerun the build step before running.
run
will automatically rebuild it. - The disk file will not be reset between each run. As a result, if you want to switch to another architecture, you must run
make img
with the new architecture before runningmake run
.
You can check out the GUI guide to set up a graphical environment, or explore other documentation in this folder.
TODO
See Makefile