Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge multiprocess into dev #160

Merged
merged 30 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
714a944
Merge pull request #76 from syswonder/dev
caodg Mar 28, 2024
1a47719
Merge pull request #102 from syswonder/dev
ken4647 May 8, 2024
c54f363
Merge pull request #120 from syswonder/dev
caodg Jun 6, 2024
b1f880b
Merge pull request #135 from syswonder/dev
TheSayOL Jul 5, 2024
6b0d753
add loopback
lhw2002426 Aug 21, 2024
200226f
temporily commit for test
Zen4647 Sep 17, 2024
c08acb7
fix problem for fs deadlock and context switch failds.
Zen4647 Sep 26, 2024
e0cbc0f
implement `sys_wait4` for multiprocess for aarch64.
Zen4647 Sep 27, 2024
2431ea7
drop lock of `process_map` before yielding to other tasks
Zen4647 Sep 27, 2024
fe90312
Merge pull request #142 from ken4647/multiprocess
ken4647 Oct 10, 2024
7380ca7
fix wrong aligned_size in .percpu and deadlock problem in fork_task().
Zen4647 Nov 11, 2024
ee23e4d
fix bugs for pipe's write end closure and exit group
Zen4647 Nov 14, 2024
698e1fa
Merge pull request #144 from ken4647/multiprocess
ken4647 Nov 14, 2024
2d79877
Merge branch 'loopback' into multiprocess-loopback
Nov 23, 2024
2dba7dc
fix sys_rt_sigaction
Nov 26, 2024
029a431
Merge pull request #146 from lhw2002426/multiprocess-loopback
ken4647 Nov 26, 2024
c0ebec1
add unixsocket without real inode
Dec 2, 2024
a98992a
Merge pull request #150 from lhw2002426/multiprocess-loopback
ken4647 Dec 2, 2024
e149cde
fix bug for unexpected pagefault when nested fork.
ken4647 Dec 2, 2024
6bc5b32
Merge pull request #151 from ken4647/mp_el1
ken4647 Dec 2, 2024
bd02cdd
add unix socket drop
Dec 11, 2024
27bcc5d
Merge pull request #155 from lhw2002426/multiprocess-loopback
ken4647 Dec 15, 2024
6f4bf66
move signal handle into ruxtask and fix sys_rt_rigaction
Dec 15, 2024
19fa8e6
Merge remote-tracking branch 'upstream/multiprocess_el1' into multipr…
Dec 15, 2024
a67be9b
Merge pull request #158 from lhw2002426/multiprocess-loopback
ken4647 Dec 17, 2024
6936553
add poll state POLLHUP
Dec 21, 2024
42261fd
Merge pull request #159 from lhw2002426/multiprocess-loopback
ken4647 Dec 21, 2024
f4063b8
Merge branch 'mp4dev' of github.com:ken4647/ruxos into dev
ken4647 Dec 25, 2024
c75a5d9
remove `ruxlibc` from ulibc.
ken4647 Dec 26, 2024
c6c37ec
fix a mistask for swaped-oout memory
ken4647 Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading