Skip to content

oscomp/starry-next

 
 

Repository files navigation

StarryOS

CI

A monolithic kernel based on ArceOS.

Quick Start

Build and Run through Docker

Install Docker in your system.

Then build all dependencies through provided dockerfile:

./scripts/get_deps.sh
cd .arceos
docker build -t starry -f Dockerfile .

Create a container and build/run app:

# back to the root directory of the project
cd ..
docker run --privileged --rm -it -v $(pwd):/starry -w /starry starry bash

# Now build/run app in the container
make user_apps
make defconfig
make run

Manually Build and Run

1. Install Build Dependencies

cargo install cargo-binutils axconfig-gen

sudo apt install libclang-dev cmake dosfstools build-essential

Download & install musl toolchains:

# download
wget https://musl.cc/aarch64-linux-musl-cross.tgz
wget https://musl.cc/riscv64-linux-musl-cross.tgz
wget https://musl.cc/x86_64-linux-musl-cross.tgz
wget https://github.com/LoongsonLab/oscomp-toolchains-for-oskernel/releases/download/loongarch64-linux-musl-cross-gcc-13.2.0/loongarch64-linux-musl-cross.tgz
# install
tar zxf aarch64-linux-musl-cross.tgz
tar zxf riscv64-linux-musl-cross.tgz
tar zxf x86_64-linux-musl-cross.tgz
tar zxf loongarch64-linux-musl-cross.tgz

# exec below command in bash OR add below info in ~/.bashrc
export PATH=`pwd`/x86_64-linux-musl-cross/bin:`pwd`/aarch64-linux-musl-cross/bin:`pwd`/riscv64-linux-musl-cross/bin:`pwd`/loongarch64-linux-musl-cross/bin:$PATH

2. Dependencies for running apps

# for Debian/Ubuntu
sudo apt-get install qemu-system
# for macos
brew install qemu

Notice: The version of qemu should be no less than 8.2.0.

Other systems, arch and version please refer to Qemu Download

3. Build & Run

# Clone the base repository
./scripts/get_deps.sh

# Run riscv64 example
make ARCH=riscv64 AX_TESTCASE=nimbos user_apps
# When running on a new architecture, you need to generate the configuration file again.
make ARCH=riscv64 defconfig
make ARCH=riscv64 AX_TESTCASE=nimbos BLK=y NET=y ACCEL=n run

# Run x86_64 example
make ARCH=x86_64 AX_TESTCASE=nimbos user_apps
# When running on a new architecture, you need to generate the configuration file again.
make ARCH=x86_64 defconfig
make ARCH=x86_64 AX_TESTCASE=nimbos BLK=y NET=y ACCEL=n run

# Run aarch64 example
make ARCH=aarch64 AX_TESTCASE=nimbos user_apps
make ARCH=aarch64 defconfig
make ARCH=aarch64 AX_TESTCASE=nimbos BLK=y NET=y FEATURES=fp_simd ACCEL=n run

# Run Loongarch64 example
make ARCH=loongarch64 AX_TESTCASE=nimbos user_apps
make ARCH=loongarch64 defconfig
make ARCH=loongarch64 AX_TESTCASE=nimbos BLK=y NET=y ACCEL=n run

# Run another example (libc testcases)
make ARCH=riscv64 AX_TESTCASE=libc user_apps
make ARCH=riscv64 defconfig
# When running libc testcases, you need to enable `fp_simd` feature.
make ARCH=riscv64 AX_TESTCASE=libc BLK=y NET=y FEATURES=fp_simd ACCEL=n run

4. Commands Explanation

# Clone the base repository
./scripts/get_deps.sh

# Build user applications
make ARCH=<arch> AX_TESTCASE=<testcases> user_apps

# Build kernel
make ARCH=<arch> LOG=<log> AX_TESTCASE=<testcases> build

# Run kernel
make ARCH=<arch> LOG=<log> AX_TESTCASE=<testcases> run

Where testcases are shown under the apps/ folder.

<arch> should be one of riscv64, aarch64, x86_64, loongarch64.

<log> should be one of off, error, warn, info, debug, trace.

More arguments and targets can be found in Makefile.

For example, to run the nimbos testcases on qemu-system-x86_64 with log level info:

make ARCH=x86_64 LOG=info AX_TESTCASE=nimbos run

Note: Arguments like NET, BLK, and GRAPHIC enable devices in QEMU, which take effect only at runtime, not at build time. More features can be found in the Cargo.toml of arceos.

Test for oscomp testcases

We can run testcases of the OS competition with StarryOS. Guidence can be found in Starry-Tutorial.

Releases

No releases published

Packages

No packages published

Languages

  • Rust 53.8%
  • Python 18.0%
  • C 16.3%
  • Shell 4.9%
  • Makefile 3.1%
  • Assembly 1.6%
  • Other 2.3%