Skip to content

Commit

Permalink
merge upstream dev
Browse files Browse the repository at this point in the history
  • Loading branch information
lhw2002426 committed Jun 25, 2024
2 parents da2ef8b + 6714011 commit ef35a96
Show file tree
Hide file tree
Showing 61 changed files with 1,717 additions and 186 deletions.
34 changes: 32 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ members = [
"crates/spinlock",
"crates/timer_list",
"crates/tuple_for_each",
"crates/tty",

"modules/axalloc",
"modules/axlog",
Expand All @@ -43,6 +44,7 @@ members = [
"modules/ruxconfig",
"modules/ruxdisplay",
"modules/ruxdriver",
"modules/ruxfdtable",
"modules/ruxfs",
"modules/ruxhal",
"modules/ruxruntime",
Expand Down
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# RuxOS

[![CI](https://github.com/syswonder/ruxos/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/syswonder/ruxos/actions/workflows/build.yml)
[![CI](https://github.com/syswonder/ruxos/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/syswonder/ruxos/actions/workflows/test.yml)

An experimental modular operating system (or unikernel) written in Rust.
<p align="center">
<img src="doc/figures/ruxos-logo0.svg" alt="RuxOS-logo" width="500"><br>
A unikernel operating system written in Rust.<br/>
<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>
<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>
<br/>
</p>

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

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

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

### Rust
### Rust applications

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

### C
### C applications

| App | Enabled features | Description |
|-|-|-|
Expand All @@ -60,13 +63,24 @@ The currently supported applications (Rust), as well as their dependent modules
| [pipe](apps/c/pthread/pipe/) | alloc, paging, multitask, pipe | A test for pipe API |
| [sleep](apps/c/pthread/sleep/) | alloc, paging, multitask, irq | Thread sleeping test |
| [tsd](apps/c/pthread/tsd/) | alloc, paging, multitask, irq | A test for pthread-key related API |
| [dl](apps/c/dl/) | paging, alloc, irq, musl, multitask, fs, pipe, poll, rtc, signal, virtio-9p | An example for dynamically loading apps |
| [libc-bench](apps/c/libc-bench/) | alloc, multitask, fs, musl | A standard libc test for musl libc integration |
| [iperf](apps/c/iperf/) | alloc, paging, net, fs, blkfs, select, fp_simd | A network performance test tool |
| [redis](apps/c/redis/) | alloc, paging, fp_simd, irq, multitask, fs, blkfs, net, pipe, epoll, poll, virtio-9p, rtc | A Redis server on Ruxos |
| [sqlite3](apps/c/sqlite3/) | alloc, paging, fs, fp_simd, blkfs | A simple test for Sqlite3 API |
| [iperf](https://github.com/syswonder/rux-iperf) | alloc, paging, net, fs, blkfs, select, fp_simd | A network performance test tool |
| [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 |
| [cpp](apps/c/cpp/) | alloc, paging, irq, multitask, fs, random-hw | C++ benchmark |
| [dl](apps/c/dl/) | paging, alloc, irq, musl, multitask, fs, pipe, poll, rtc, signal, virtio-9p | An example for dynamically loading apps |
| [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 |
| [wamr](https://github.com/syswonder/rux-wamr) | alloc, paging, fp_simd, irq, multitask, fs, virtio-9p, signal, smp | Wasm runtime |

### Programming languages

| Language | Description |
|- | - |
| C | Run C apps by RuxOS ruxlibc or standard musl libc supported by ruxmusl. Evaluated by libc-bench. |
| C++ | Run C++ apps by c++ static library provided by musl libc. Passed c++ benchmark. Evaluated by c++ benchmark. |
| [Perl](https://github.com/syswonder/rux-perl) | Run Perl standard library by musl libc. Evaluated by Perl benchmark. |
| [Python](https://github.com/syswonder/rux-python3) | Run Python apps by dynamically loading Python modules. Evaluated by Python benchmark. |
| Rust | Run Rust standard library by modifying Rust std source. Evaluated by Rust tests. |

## Build & Run

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

## RuxGo

A convient tool to run RuxOS applications by concise command. See [RuxGo-Book](https://ruxgo.syswonder.org/) for more information.

## Design

![](doc/figures/ruxos.svg)
27 changes: 22 additions & 5 deletions api/ruxfeat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,26 @@ irq = ["ruxhal/irq", "ruxruntime/irq", "ruxtask?/irq"]
rtc = ["ruxhal/rtc", "ruxruntime/rtc"]

# Memory
alloc = ["axalloc", "ruxruntime/alloc", "ruxfs/alloc"]
alloc = ["axalloc", "ruxruntime/alloc", "ruxfs/alloc", "ruxhal/alloc"]
alloc-tlsf = ["axalloc/tlsf"]
alloc-slab = ["axalloc/slab"]
alloc-buddy = ["axalloc/buddy"]
paging = ["alloc", "ruxhal/paging", "ruxruntime/paging"]
tls = ["alloc", "ruxhal/tls", "ruxruntime/tls", "ruxtask?/tls"]

# Multi-threading and scheduler
multitask = ["alloc", "ruxtask/multitask", "axsync/multitask", "ruxruntime/multitask"]
multitask = [
"alloc",
"ruxtask/multitask",
"axsync/multitask",
"ruxruntime/multitask",
]
sched_fifo = ["ruxtask/sched_fifo"]
sched_rr = ["ruxtask/sched_rr", "irq"]
sched_cfs = ["ruxtask/sched_cfs", "irq"]

# File system
fs = ["alloc", "dep:ruxfs", "ruxruntime/fs"]
fs = ["alloc", "dep:ruxfs", "ruxruntime/fs"]
blkfs = ["ruxdriver/virtio-blk", "ruxruntime/blkfs"]
myfs = ["ruxfs?/myfs"]
9pfs = []
Expand All @@ -52,10 +57,20 @@ lwip = ["ruxnet/lwip"]
smoltcp = ["ruxnet/smoltcp"]

# Display
display = ["alloc", "ruxdriver/virtio-gpu", "dep:ruxdisplay", "ruxruntime/display"]
display = [
"alloc",
"ruxdriver/virtio-gpu",
"dep:ruxdisplay",
"ruxruntime/display",
]

# 9P
virtio-9p = ["9pfs", "ruxdriver/virtio-9p", "rux9p/virtio-9p", "ruxruntime/virtio-9p"]
virtio-9p = [
"9pfs",
"ruxdriver/virtio-9p",
"rux9p/virtio-9p",
"ruxruntime/virtio-9p",
]
net-9p = ["9pfs", "net", "rux9p/net-9p", "ruxruntime/net-9p"]

# Device drivers
Expand All @@ -73,6 +88,8 @@ log-level-info = ["axlog/log-level-info"]
log-level-debug = ["axlog/log-level-debug"]
log-level-trace = ["axlog/log-level-trace"]

tty = ["ruxhal/tty", "ruxruntime/tty", "alloc", "irq"]

[dependencies]
ruxruntime = { path = "../../modules/ruxruntime" }
ruxhal = { path = "../../modules/ruxhal" }
Expand Down
3 changes: 3 additions & 0 deletions api/ruxos_posix_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ruxconfig = { path = "../../modules/ruxconfig" }
axlog = { path = "../../modules/axlog" }
ruxhal = { path = "../../modules/ruxhal" }
axsync = { path = "../../modules/axsync" }
ruxfdtable = { path = "../../modules/ruxfdtable" }
ruxfutex = { path = "../../modules/ruxfutex", optional = true }
axalloc = { path = "../../modules/axalloc", optional = true }
ruxtask = { path = "../../modules/ruxtask", optional = true }
Expand All @@ -65,5 +66,7 @@ cfg-if = "1.0"
elf = { version = "0.7", default-features = false }
bitflags = "2.2"

lazy_init = { path = "../../crates/lazy_init" }

[build-dependencies]
bindgen = { version = "0.66" }
1 change: 1 addition & 0 deletions api/ruxos_posix_api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ typedef struct {{
"PROT_.+",
"MS_.+",
"MREMAP_.+",
"GRND_.*",
];

#[derive(Debug)]
Expand Down
2 changes: 2 additions & 0 deletions api/ruxos_posix_api/ctypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@
#include <sys/uio.h>
#include <unistd.h>
#include <dirent.h>

#include <sys/random.h>
Loading

0 comments on commit ef35a96

Please sign in to comment.