Skip to content

Commit c54f363

Browse files
authored
Merge pull request #120 from syswonder/dev
Merge dev into main
2 parents 1a47719 + f841b85 commit c54f363

File tree

50 files changed

+1201
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1201
-123
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,19 @@ jobs:
4747
crate: cargo-binutils
4848
version: latest
4949
use-tool-cache: true
50+
# musl toolchain is also needed in non-musl apps
51+
# because we need to build opensbi under riscv64
52+
- uses: ./.github/workflows/actions/setup-musl
53+
with:
54+
arch: ${{ matrix.arch }}
55+
5056
- name: Build display/basic_painting
5157
run: make ARCH=${{ matrix.arch }} A=apps/display/basic_painting
5258
- name: Build display/draw_map
5359
run: make ARCH=${{ matrix.arch }} A=apps/display/draw_map
5460
- name: Build fs/shell
5561
run: make ARCH=${{ matrix.arch }} A=apps/fs/shell
5662

57-
- uses: ./.github/workflows/actions/setup-musl
58-
with:
59-
arch: ${{ matrix.arch }}
6063
- name: Build c/helloworld
6164
run: make ARCH=${{ matrix.arch }} A=apps/c/helloworld
6265
- name: Build c/memtest

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "patches/opensbi"]
2+
path = patches/opensbi
3+
url = https://github.com/Sssssaltyfish/opensbi.git

Cargo.lock

Lines changed: 24 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ members = [
1919
"crates/driver_net",
2020
"crates/driver_pci",
2121
"crates/driver_virtio",
22-
"crates/dtb",
22+
"crates/dtb",
2323
"crates/flatten_objects",
2424
"crates/lazy_init",
2525
"crates/linked_list",
@@ -42,6 +42,7 @@ members = [
4242
"modules/ruxconfig",
4343
"modules/ruxdisplay",
4444
"modules/ruxdriver",
45+
"modules/ruxfdtable",
4546
"modules/ruxfs",
4647
"modules/ruxhal",
4748
"modules/ruxruntime",
@@ -67,3 +68,6 @@ lto = true
6768
[profile.reldebug]
6869
inherits = "release"
6970
debug = true
71+
72+
[patch.crates-io]
73+
sbi-spec = { git = "https://github.com/Sssssaltyfish/rustsbi.git", rev = "a25d448d3d770c6db493a472e3e78d949b63f523", optional = true }

Makefile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,19 @@ LD_SCRIPT := $(CURDIR)/modules/ruxhal/linker_$(PLATFORM_NAME).lds
166166
OUT_ELF := $(OUT_DIR)/$(APP_NAME)_$(PLATFORM_NAME).elf
167167
OUT_BIN := $(OUT_DIR)/$(APP_NAME)_$(PLATFORM_NAME).bin
168168

169+
PREBUILD := $(CURDIR)/scripts/prebuild/$(ARCH).mk
170+
169171
all: build
170172

173+
# prebuild option to be overriden in `$(PREBUILD)`
174+
define run_prebuild
175+
endef
176+
177+
# prebuild makefile might override some variables by their own
178+
# so it must be placed before the rest of the makefiles
179+
ifneq ($(wildcard $(PREBUILD)),)
180+
include $(PREBUILD)
181+
endif
171182
include scripts/make/utils.mk
172183
include scripts/make/build.mk
173184
include scripts/make/qemu.mk
@@ -178,6 +189,16 @@ else ifeq ($(PLATFORM_NAME), aarch64-bsta1000b)
178189
include scripts/make/bsta1000b-fada.mk
179190
endif
180191

192+
_force: ;
193+
194+
# prebuild scripts must track their dependencies by themselves
195+
prebuild: _force
196+
$(call run_prebuild)
197+
198+
$(OUT_DIR): prebuild
199+
200+
$(OUT_BIN): prebuild
201+
181202
build: $(OUT_DIR) $(OUT_BIN)
182203

183204
disasm:
@@ -248,4 +269,5 @@ clean_musl:
248269
rm -rf ulib/ruxmusl/build_*
249270
rm -rf ulib/ruxmusl/install
250271

251-
.PHONY: all build disasm run justrun debug clippy fmt fmt_c test test_no_fail_fast clean clean_c clean_musl doc disk_image debug_no_attach
272+
.PHONY: all build disasm run justrun debug clippy fmt fmt_c test test_no_fail_fast clean clean_c\
273+
clean_musl doc disk_image debug_no_attach prebuild _force

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# RuxOS
22

3-
[![CI](https://github.com/syswonder/ruxos/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/syswonder/ruxos/actions/workflows/build.yml)
4-
[![CI](https://github.com/syswonder/ruxos/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/syswonder/ruxos/actions/workflows/test.yml)
5-
6-
An experimental modular operating system (or unikernel) written in Rust.
3+
<p align="center">
4+
<img src="doc/figures/ruxos-logo0.svg" alt="RuxOS-logo" width="500"><br>
5+
A unikernel operating system written in Rust.<br/>
6+
<a href="https://github.com/syswonder/ruxos/actions/workflows/build.yml"><img src="https://github.com/syswonder/ruxos/actions/workflows/build.yml/badge.svg?branch=main" alt="Build CI" style="max-width: 100%;"></a>
7+
<a href="https://github.com/syswonder/ruxos/actions/workflows/test.yml"><img src="https://github.com/syswonder/ruxos/actions/workflows/test.yml/badge.svg?branch=main" alt="Test CI" style="max-width: 100%;"></a>
8+
<br/>
9+
</p>
710

811
RuxOS was inspired by [Unikraft](https://github.com/unikraft/unikraft) and [ArceOS](https://github.com/rcore-os/arceos)
912

@@ -34,16 +37,16 @@ Example applications can be found in the [apps/](apps/) directory. All applicati
3437
* [ruxconfig](modules/ruxconfig/): Platform constants and kernel parameters, such as physical memory base, kernel load addresses, stack size, etc.
3538
* [axlog](modules/axlog/): Multi-level formatted logging.
3639

37-
The currently supported applications (Rust), as well as their dependent modules and features, are shown in the following table:
40+
The currently supported applications and programming languages, as well as their dependent modules and features, are shown in the following table:
3841

39-
### Rust
42+
### Rust applications
4043

4144
| App | Extra modules | Enabled features | Description |
4245
|-|-|-|-|
4346
| [display](apps/display/) | axalloc, ruxdisplay | alloc, paging, display | Graphic/GUI test |
4447
| [shell](apps/fs/shell/) | axalloc, ruxdriver, ruxfs | alloc, paging, fs | A simple shell that responds to filesystem operations |
4548

46-
### C
49+
### C applications
4750

4851
| App | Enabled features | Description |
4952
|-|-|-|
@@ -60,13 +63,24 @@ The currently supported applications (Rust), as well as their dependent modules
6063
| [pipe](apps/c/pthread/pipe/) | alloc, paging, multitask, pipe | A test for pipe API |
6164
| [sleep](apps/c/pthread/sleep/) | alloc, paging, multitask, irq | Thread sleeping test |
6265
| [tsd](apps/c/pthread/tsd/) | alloc, paging, multitask, irq | A test for pthread-key related API |
66+
| [dl](apps/c/dl/) | paging, alloc, irq, musl, multitask, fs, pipe, poll, rtc, signal, virtio-9p | An example for dynamically loading apps |
6367
| [libc-bench](apps/c/libc-bench/) | alloc, multitask, fs, musl | A standard libc test for musl libc integration |
64-
| [iperf](apps/c/iperf/) | alloc, paging, net, fs, blkfs, select, fp_simd | A network performance test tool |
65-
| [redis](apps/c/redis/) | alloc, paging, fp_simd, irq, multitask, fs, blkfs, net, pipe, epoll, poll, virtio-9p, rtc | A Redis server on Ruxos |
6668
| [sqlite3](apps/c/sqlite3/) | alloc, paging, fs, fp_simd, blkfs | A simple test for Sqlite3 API |
69+
| [iperf](https://github.com/syswonder/rux-iperf) | alloc, paging, net, fs, blkfs, select, fp_simd | A network performance test tool |
70+
| [redis](https://github.com/syswonder/rux-redis) | alloc, paging, fp_simd, irq, multitask, fs, blkfs, net, pipe, epoll, poll, virtio-9p, rtc | Redis server on Ruxos |
6771
| [cpp](apps/c/cpp/) | alloc, paging, irq, multitask, fs, random-hw | C++ benchmark |
68-
| [dl](apps/c/dl/) | paging, alloc, irq, musl, multitask, fs, pipe, poll, rtc, signal, virtio-9p | An example for dynamically loading apps |
72+
| [nginx](https://github.com/syswonder/rux-nginx) | alloc, paging, fp_simd, irq, multitask, fs, blkfs, net, pipe, epoll, poll, select, rtc, signal | Run Nginx as web server |
73+
| [wamr](https://github.com/syswonder/rux-wamr) | alloc, paging, fp_simd, irq, multitask, fs, virtio-9p, signal, smp | Wasm runtime |
6974

75+
### Programming languages
76+
77+
| Language | Description |
78+
|- | - |
79+
| C | Run C apps by RuxOS ruxlibc or standard musl libc supported by ruxmusl. Evaluated by libc-bench. |
80+
| C++ | Run C++ apps by c++ static library provided by musl libc. Passed c++ benchmark. Evaluated by c++ benchmark. |
81+
| [Perl](https://github.com/syswonder/rux-perl) | Run Perl standard library by musl libc. Evaluated by Perl benchmark. |
82+
| [Python](https://github.com/syswonder/rux-python3) | Run Python apps by dynamically loading Python modules. Evaluated by Python benchmark. |
83+
| Rust | Run Rust standard library by modifying Rust std source. Evaluated by Rust tests. |
7084

7185
## Build & Run
7286

@@ -197,6 +211,10 @@ make PLATFORM=aarch64-raspi4 A=apps/fs/shell FEATURES=driver-bcm2835-sdhci
197211
make PLATFORM=x86_64-pc-oslab A=apps/c/redis FEATURES=driver-ixgbe,driver-ramdisk SMP=4
198212
```
199213

214+
## RuxGo
215+
216+
A convient tool to run RuxOS applications by concise command. See [RuxGo-Book](https://ruxgo.syswonder.org/) for more information.
217+
200218
## Design
201219

202220
![](doc/figures/ruxos.svg)

api/ruxos_posix_api/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ ruxconfig = { path = "../../modules/ruxconfig" }
4343
axlog = { path = "../../modules/axlog" }
4444
ruxhal = { path = "../../modules/ruxhal" }
4545
axsync = { path = "../../modules/axsync" }
46+
ruxfdtable = { path = "../../modules/ruxfdtable" }
4647
ruxfutex = { path = "../../modules/ruxfutex", optional = true }
4748
axalloc = { path = "../../modules/axalloc", optional = true }
4849
ruxtask = { path = "../../modules/ruxtask", optional = true }

0 commit comments

Comments
 (0)