MCPcopy Index your code
hub / github.com/Starry-OS/StarryOS

github.com/Starry-OS/StarryOS @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
912 symbols 2,204 edges 101 files 195 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Starry OS

An experimental monolithic OS based on ArceOS

GitHub Stars GitHub Forks GitHub License Build status

Supported Architectures

  • [x] RISC-V 64
  • [x] LoongArch64
  • [x] AArch64
  • [ ] x86_64 (work in progress)

Features

TODO

Quick Start

1. Clone repo

git clone --recursive https://github.com/Starry-OS/StarryOS.git
cd StarryOS

Or if you have already cloned it without --recursive option:

cd StarryOS
git submodule update --init --recursive

2. Install Prerequisites

A. Using Docker

We provide a prebuilt Docker image with all dependencies installed.

For users in mainland China, you can use the following image which includes optimizations like Debian packages mirrors and crates.io mirrors:

docker pull docker.cnb.cool/starry-os/arceos-build
docker run -it --rm -v $(pwd):/workspace -w /workspace docker.cnb.cool/starry-os/arceos-build

For other users, you can use the image hosted on GitHub Container Registry:

docker pull ghcr.io/arceos-org/arceos-build
docker run -it --rm -v $(pwd):/workspace -w /workspace ghcr.io/arceos-org/arceos-build

Note: The --rm flag will destroy the container instance upon exit. Any changes made inside the container (outside of the mounted /workspace volume) will be lost. Please refer to the Docker documentation for more advanced usage.

B. Manual Setup

i. Install System Dependencies

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 building QEMU from source.

ii. Install Musl Toolchain
  1. Download files from setup-musl releases
  2. Extract to some path, for example /opt/riscv64-linux-musl-cross
  3. Add bin folder to PATH, for example:

bash export PATH=/opt/riscv64-linux-musl-cross/bin:$PATH

iii. Setup Rust toolchain
# Install rustup from https://rustup.rs or using your system package manager

# Automatically download components via rustup
cd StarryOS
cargo -V

3. Prepare rootfs

# Default target: riscv64
make rootfs
# Explicit target
make ARCH=riscv64 rootfs
make ARCH=loongarch64 rootfs

This will download rootfs image from Starry-OS/rootfs and set up the disk file for running on QEMU.

4. Build and run on QEMU

# Default target: riscv64
make build
# Explicit target
make ARCH=riscv64 build
make ARCH=loongarch64 build

# Run on QEMU (also rebuilds if necessary)
make ARCH=riscv64 run
make ARCH=loongarch64 run

Note:

  1. Binary dependencies will be automatically built during make build.
  2. You don't have to rerun build every time. run automatically rebuilds if necessary.
  3. 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 rootfs with the new architecture before make run.

What next?

You can check out the GUI guide to set up a graphical environment, or explore other documentation in this folder.

If you're interested in contributing to the project, please see our Contributing Guide.

See more build options in the Makefile.

License

This project is now released under the Apache License 2.0. All modifications and new contributions in our project are distributed under the same license. See the LICENSE and NOTICE files for details.

Extension points exported contracts — how you extend this code

DeviceOps (Interface)
Trait for device operations. [13 implementers]
core/src/vfs/dev.rs
SocketAddrExt (Interface)
Trait to extend [`SocketAddr`] and its variants with methods for reading from and writing to user space. [6 implementers]
api/src/socket.rs
SimpleDirOps (Interface)
Operations for a simple directory. [7 implementers]
core/src/vfs/dir.rs
TimeValueLike (Interface)
A helper trait for converting from and to `TimeValue`. [7 implementers]
api/src/time.rs
SimpleFileOps (Interface)
Operations for a simple file. [2 implementers]
core/src/vfs/file.rs
FileLike (Interface)
(no doc) [9 implementers]
api/src/file/mod.rs
AsThread (Interface)
Helper trait to access the thread from a task. [1 implementers]
core/src/task.rs
TtyRead (Interface)
(no doc) [2 implementers]
api/src/terminal/ldisc.rs

Core symbols most depended-on inside this repo

len
called by 85
core/src/vfs/fs.rs
as_thread
called by 77
core/src/task.rs
add
called by 37
api/src/file/epoll.rs
get
called by 30
api/src/vfs/tmp.rs
inner
called by 27
api/src/file/fs.rs
is_empty
called by 26
core/src/futex.rs
insert
called by 24
core/src/shm.rs
get_file_like
called by 24
api/src/file/mod.rs

Shape

Method 468
Function 295
Class 121
Enum 17
Interface 11

Languages

Rust100%
Python1%

Modules by API surface

core/src/task.rs43 symbols
api/src/vfs/tmp.rs43 symbols
api/src/syscall/fs/ctl.rs39 symbols
api/src/file/epoll.rs31 symbols
core/src/shm.rs30 symbols
api/src/syscall/fs/io.rs30 symbols
api/src/syscall/ipc/msg.rs28 symbols
api/src/mm.rs28 symbols
core/src/vfs/dev.rs23 symbols
core/src/time.rs22 symbols
api/src/file/fs.rs21 symbols
core/src/vfs/dir.rs20 symbols

For agents

$ claude mcp add StarryOS \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact