Skip to content

Commit ddeb03e

Browse files
AsakuraMizuCopilot
andauthored
docs: update README.md and Makefile (#70)
Co-authored-by: Copilot <[email protected]>
1 parent 0328e46 commit ddeb03e

File tree

2 files changed

+92
-58
lines changed

2 files changed

+92
-58
lines changed

Makefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,22 @@ ifeq ($(MEMTRACK), y)
2121
APP_FEATURES += starry-api/memtrack
2222
endif
2323

24-
IMG_URL = https://github.com/Starry-OS/rootfs/releases/download/20250917
25-
IMG = rootfs-$(ARCH).img
24+
default: build
2625

27-
img:
28-
@if [ ! -f $(IMG) ]; then \
26+
ROOTFS_URL = https://github.com/Starry-OS/rootfs/releases/download/20250917
27+
ROOTFS_IMG = rootfs-$(ARCH).img
28+
29+
rootfs:
30+
@if [ ! -f $(ROOTFS_IMG) ]; then \
2931
echo "Image not found, downloading..."; \
30-
curl -f -L $(IMG_URL)/$(IMG).xz -O; \
31-
xz -d $(IMG).xz; \
32+
curl -f -L $(ROOTFS_URL)/$(ROOTFS_IMG).xz -O; \
33+
xz -d $(ROOTFS_IMG).xz; \
3234
fi
33-
@cp $(IMG) arceos/disk.img
35+
@cp $(ROOTFS_IMG) arceos/disk.img
36+
37+
img:
38+
@echo -e "\033[33mWARN: The 'img' target is deprecated. Please use 'rootfs' instead.\033[0m"
39+
@$(MAKE) --no-print-directory rootfs
3440

3541
defconfig justrun clean:
3642
@make -C arceos $@

README.md

Lines changed: 79 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
# Starry OS
22

3-
## Quick Start
3+
*An experimental monolithic OS based on ArceOS*
44

5-
### 1. Install System Dependencies
5+
[![GitHub Stars](https://img.shields.io/github/stars/Starry-OS/StarryOS?style=for-the-badge)](https://github.com/Starry-OS/StarryOS/stargazers)
6+
[![GitHub Forks](https://img.shields.io/github/forks/Starry-OS/StarryOS?style=for-the-badge)](https://github.com/Starry-OS/StarryOS/network)
7+
[![GitHub License](https://img.shields.io/github/license/Starry-OS/StarryOS?style=for-the-badge)](https://github.com/Starry-OS/StarryOS/blob/main/LICENSE)
8+
[![Build status](https://img.shields.io/github/check-runs/Starry-OS/StarryOS/main?style=for-the-badge)](https://github.com/Starry-OS/StarryOS/actions)
69

7-
This step may vary depending on your operating system. Here is an example based on Debian:
10+
## Supported Architectures
811

9-
```bash
10-
$ sudo apt update
11-
$ sudo apt install -y build-essential cmake clang qemu-system
12-
```
12+
- [x] RISC-V 64
13+
- [x] LoongArch64
14+
- [x] AArch64
15+
- [ ] x86_64 (work in progress)
1316

14-
**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](https://www.qemu.org/download/).
17+
## Features
1518

16-
### 2. Install Musl Toolchain
19+
TODO
1720

18-
1. Download files from https://github.com/arceos-org/setup-musl/releases/tag/prebuilt
19-
2. Extract to some path, for example `/opt/riscv64-linux-musl-cross`
20-
3. Add bin folder to `PATH`, for example:
21-
```bash
22-
$ export PATH=/opt/riscv64-linux-musl-cross/bin:$PATH
23-
```
21+
## Quick Start
2422

25-
### 3. Clone repo
23+
### 1. Clone repo
2624

2725
```bash
2826
$ git clone --recursive https://github.com/Starry-OS/StarryOS.git
@@ -36,69 +34,99 @@ $ cd StarryOS
3634
$ git submodule update --init --recursive
3735
```
3836

39-
### 4. Setup Rust toolchain
37+
### 2. Install Prerequisites
38+
39+
#### A. Using Docker
40+
41+
We provide a prebuilt Docker image with all dependencies installed.
42+
43+
For users in mainland China, you can use the following image which includes optimizations like Debian packages mirrors and crates.io mirrors:
4044

4145
```bash
42-
# Install rustup from https://rustup.rs or using your system package manager
46+
$ docker pull docker.cnb.cool/starry-os/arceos-build
47+
$ docker run -it --rm -v $(pwd):/workspace -w /workspace docker.cnb.cool/starry-os/arceos-build
48+
```
4349

44-
# Make sure that you don't have `RUSTUP_DIST_SERVER` set
45-
$ export RUSTUP_DIST_SERVER=
50+
For other users, you can use the image hosted on GitHub Container Registry:
4651

47-
# Automatically download components via rustup
48-
$ cd StarryOS
49-
$ rustup target list --installed
52+
```bash
53+
$ docker pull ghcr.io/arceos-org/arceos-build
54+
$ docker run -it --rm -v $(pwd):/workspace -w /workspace ghcr.io/arceos-org/arceos-build
5055
```
5156

52-
### 5. Build
57+
**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](https://docs.docker.com/) for more advanced usage.
58+
59+
#### B. Manual Setup
60+
61+
##### i. Install System Dependencies
62+
63+
This step may vary depending on your operating system. Here is an example based on Debian:
5364

5465
```bash
55-
# Default target: riscv64
56-
$ make build
57-
# Explicit target
58-
$ make ARCH=riscv64 build
59-
$ make ARCH=loongarch64 build
66+
$ sudo apt update
67+
$ sudo apt install -y build-essential cmake clang qemu-system
6068
```
6169

62-
This should also download required binary dependencies like [cargo-binutils](https://github.com/rust-embedded/cargo-binutils).
70+
**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](https://www.qemu.org/download/).
71+
72+
##### ii. Install Musl Toolchain
73+
74+
1. Download files from https://github.com/arceos-org/setup-musl/releases/tag/prebuilt
75+
2. Extract to some path, for example `/opt/riscv64-linux-musl-cross`
76+
3. Add bin folder to `PATH`, for example:
77+
```bash
78+
$ export PATH=/opt/riscv64-linux-musl-cross/bin:$PATH
79+
```
80+
81+
##### iii. Setup Rust toolchain
82+
83+
```bash
84+
# Install rustup from https://rustup.rs or using your system package manager
85+
86+
# Automatically download components via rustup
87+
$ cd StarryOS
88+
$ cargo -V
89+
```
6390

64-
### 6. Prepare rootfs
91+
### 3. Prepare rootfs
6592

6693
```bash
67-
$ make img
68-
$ make img ARCH=riscv64
69-
$ make img ARCH=loongarch64
94+
# Default target: riscv64
95+
$ make rootfs
96+
# Explicit target
97+
$ make ARCH=riscv64 rootfs
98+
$ make ARCH=loongarch64 rootfs
7099
```
71100

72-
This will download rootfs image from [GitHub Releases](https://github.com/Starry-OS/StarryOS/releases) and setup the disk file for running on QEMU.
101+
This will download rootfs image from [Starry-OS/rootfs](https://github.com/Starry-OS/rootfs/releases) and set up the disk file for running on QEMU.
73102

74-
### 7. Run on QEMU
103+
### 4. Build and run on QEMU
75104

76105
```bash
77-
$ make run ARCH=riscv64
78-
$ make run ARCH=loongarch64
106+
# Default target: riscv64
107+
$ make build
108+
# Explicit target
109+
$ make ARCH=riscv64 build
110+
$ make ARCH=loongarch64 build
79111

80-
# Shortcut:
81-
$ make rv
82-
$ make la
112+
# Run on QEMU (also rebuilds if necessary)
113+
$ make ARCH=riscv64 run
114+
$ make ARCH=loongarch64 run
83115
```
84116

85117
Note:
86-
1. You don't have to rerun the build step before running. `run` will automatically rebuild it.
87-
2. 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 running `make run`.
118+
1. Binary dependencies will be automatically built during `make build`.
119+
2. You don't have to rerun `build` every time. `run` automatically rebuilds if necessary.
120+
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`.
88121

89122
## What next?
90123

91-
You can check out the [GUI guide](./docs/gui.md) to set up a graphical environment, or explore other documentation in this folder.
124+
You can check out the [GUI guide](./docs/x11.md) to set up a graphical environment, or explore other documentation in this folder.
92125

93126
If you're interested in contributing to the project, please see our [Contributing Guide](./CONTRIBUTING.md).
94127

95-
## Other Options
96-
97-
TODO
98-
99-
See [Makefile](./Makefile)
100-
128+
See more build options in the [Makefile](./Makefile).
101129

102130
## License
103131

104-
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](./LICENSE) and [NOTICE](./NOTICE) files for details.
132+
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](./LICENSE) and [NOTICE](./NOTICE) files for details.

0 commit comments

Comments
 (0)