Skip to content

Commit

Permalink
Merge pull request #160 from ken4647/dev
Browse files Browse the repository at this point in the history
Merge multiprocess into dev
  • Loading branch information
lhw2002426 authored Jan 15, 2025
2 parents 4ab23d3 + c6c37ec commit 06589bf
Show file tree
Hide file tree
Showing 275 changed files with 2,993 additions and 11,635 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:

jobs:
clippy:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
arch: [x86_64, riscv64, aarch64]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
arch: [x86_64]
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:

jobs:
doc:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

jobs:
unit-test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
arch: [x86_64, riscv64, aarch64]
steps:
- uses: actions/checkout@v3
Expand Down
48 changes: 37 additions & 11 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ members = [
"modules/ruxnet",
"modules/axsync",
"modules/rux9p",
"modules/ruxmm",
"modules/ruxconfig",
"modules/ruxdisplay",
"modules/ruxdriver",
Expand All @@ -58,7 +59,6 @@ members = [
"api/ruxos_posix_api",

"ulib/axstd",
"ulib/ruxlibc",
"ulib/ruxmusl",

"apps/display/basic_painting",
Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ ARGS ?=
ENVS ?=

# Libc options
MUSL ?= n
MUSL ?= y

# App type
ifeq ($(wildcard $(APP)),)
Expand Down Expand Up @@ -250,9 +250,6 @@ doc_check_missing:
fmt:
cargo fmt --all

fmt_c:
@clang-format --style=file -i $(shell find ulib/ruxlibc -iname '*.c' -o -iname '*.h')

test:
$(call app_test)

Expand All @@ -274,12 +271,11 @@ clean: clean_c clean_musl
cargo clean

clean_c::
rm -rf ulib/ruxlibc/build_*
rm -rf $(app-objs)

clean_musl:
rm -rf ulib/ruxmusl/build_*
rm -rf ulib/ruxmusl/install

.PHONY: all build disasm run justrun debug clippy fmt fmt_c test test_no_fail_fast clean clean_c\
.PHONY: all build disasm run justrun debug clippy fmt fmt_c test test_no_fail_fast clean \
clean_musl doc disk_image debug_no_attach prebuild _force
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The currently supported applications and programming languages, as well as their

| 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 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. |
Expand Down
2 changes: 2 additions & 0 deletions api/arceos_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ myfs = ["ruxfeat/myfs"]
dummy-if-not-enabled = []

[dependencies]
crate_interface = "0.1.1"
ruxfeat = { path = "../ruxfeat" }
ruxruntime = { path = "../../modules/ruxruntime" }
ruxconfig = { path = "../../modules/ruxconfig" }
ruxmm = {path = "../../modules/ruxmm"}
axlog = { path = "../../modules/axlog" }
axio = { path = "../../crates/axio" }
axerrno = { path = "../../crates/axerrno" }
Expand Down
2 changes: 2 additions & 0 deletions api/arceos_api/src/imp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

mod mem;
mod task;
#[cfg(feature = "paging")]
mod trap;

cfg_fs! {
mod fs;
Expand Down
15 changes: 8 additions & 7 deletions ulib/ruxlibc/src/utils.rs → api/arceos_api/src/imp/trap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
* See the Mulan PSL v2 for more details.
*/

use core::ffi::c_int;
use ruxhal::trap::{PageFaultCause, TrapHandler};

pub fn e(ret: c_int) -> c_int {
if ret < 0 {
crate::errno::set_errno(ret.abs());
-1
} else {
ret as _
struct TrapHandlerImpl;

#[crate_interface::impl_interface]
impl TrapHandler for TrapHandlerImpl {
fn handle_page_fault(vaddr: usize, cause: PageFaultCause) -> bool {
// TODO: handle page fault
panic!("Page fault at {:#x} with cause {:?}.", vaddr, cause);
}
}
3 changes: 2 additions & 1 deletion api/ruxfeat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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"]
paging = ["alloc", "ruxhal/paging", "ruxtask/paging", "ruxruntime/paging", "ruxmm/paging"]
tls = ["alloc", "ruxhal/tls", "ruxruntime/tls", "ruxtask?/tls"]

# Multi-threading and scheduler
Expand Down Expand Up @@ -96,6 +96,7 @@ tty = ["ruxhal/tty", "ruxruntime/tty", "alloc", "irq"]
[dependencies]
ruxruntime = { path = "../../modules/ruxruntime" }
ruxhal = { path = "../../modules/ruxhal" }
ruxmm = { path = "../../modules/ruxmm" }
axlog = { path = "../../modules/axlog" }
axalloc = { path = "../../modules/axalloc", optional = true }
ruxdriver = { path = "../../modules/ruxdriver", optional = true }
Expand Down
7 changes: 4 additions & 3 deletions api/ruxos_posix_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ default = []

smp = ["ruxfeat/smp"]
alloc = ["dep:axalloc", "ruxfeat/alloc"]
paging = ["alloc", "ruxfeat/paging"]
paging = ["alloc", "ruxfeat/paging", "ruxmm"]
multitask = ["ruxfeat/multitask", "ruxtask/multitask", "dep:ruxfutex"]
fd = ["alloc"]
fs = ["dep:ruxfs", "ruxfeat/fs", "fd"]
net = ["dep:ruxnet", "ruxfeat/net", "fd"]
signal = ["ruxruntime/signal", "ruxhal/signal"]
signal = ["ruxruntime/signal", "ruxhal/signal", "ruxtask/signal"]
pipe = ["fd"]
select = ["fd"]
epoll = ["fd"]
Expand All @@ -44,9 +44,10 @@ axlog = { path = "../../modules/axlog" }
ruxhal = { path = "../../modules/ruxhal" }
axsync = { path = "../../modules/axsync" }
ruxfdtable = { path = "../../modules/ruxfdtable" }
ruxmm = { path = "../../modules/ruxmm", optional = true }
ruxfutex = { path = "../../modules/ruxfutex", optional = true }
axalloc = { path = "../../modules/axalloc", optional = true }
ruxtask = { path = "../../modules/ruxtask", optional = true }
ruxtask = { path = "../../modules/ruxtask", features = ["notest"], optional = true }
ruxfs = { path = "../../modules/ruxfs", optional = true }
ruxnet = { path = "../../modules/ruxnet", optional = true }

Expand Down
7 changes: 4 additions & 3 deletions api/ruxos_posix_api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ typedef struct {{
"kstat",
"stack_t",
"ino_t",
"rusage",
"dirent",
];
let allow_vars = [
Expand Down Expand Up @@ -147,7 +148,7 @@ typedef struct {{

let mut builder = bindgen::Builder::default()
.header(in_file)
.clang_arg("-I./../../ulib/ruxlibc/include")
.clang_arg("-I./../../ulib/include")
.parse_callbacks(Box::new(MyCallbacks))
.derive_default(true)
.size_t_is_usize(false)
Expand All @@ -166,7 +167,7 @@ typedef struct {{
.expect("Couldn't write bindings!");
}

gen_pthread_mutex("../../ulib/ruxlibc/include/ax_pthread_mutex.h").unwrap();
gen_pthread_cond("../../ulib/ruxlibc/include/ax_pthread_cond.h").unwrap();
gen_pthread_mutex("../../ulib/include/ax_pthread_mutex.h").unwrap();
gen_pthread_cond("../../ulib/include/ax_pthread_cond.h").unwrap();
gen_c_to_rust_bindings("ctypes.h", "src/ctypes_gen.rs");
}
Loading

0 comments on commit 06589bf

Please sign in to comment.