Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Commit 602a303

Browse files
committed
refactor: update arceos
1 parent ec4506b commit 602a303

30 files changed

+633
-429
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ repository = "https://github.com/arceos-org/starry-next"
1515

1616
[workspace.dependencies]
1717
axfeat = { git = "https://github.com/oscomp/arceos.git", features = [
18+
"fp-simd",
1819
"fs",
1920
"irq",
2021
"multitask",
@@ -35,8 +36,8 @@ axruntime = { git = "https://github.com/oscomp/arceos.git" }
3536
axsync = { git = "https://github.com/oscomp/arceos.git" }
3637
axtask = { git = "https://github.com/oscomp/arceos.git" }
3738

38-
axprocess = { git = "https://github.com/Starry-OS/axprocess.git" }
39-
axsignal = { git = "https://github.com/Starry-OS/axsignal.git", rev = "b5b6089" }
39+
axprocess = { git = "https://github.com/Starry-Mix-THU/axprocess.git", rev = "1666809" }
40+
axsignal = { git = "https://github.com/Starry-Mix-THU/axsignal.git", rev = "dd359f6" }
4041

4142
axerrno = "0.1"
4243
bitflags = "2.6"
@@ -49,7 +50,7 @@ linux-raw-sys = { version = "0.9.3", default-features = false, features = [
4950
"prctl",
5051
"system",
5152
] }
52-
memory_addr = "0.3"
53+
memory_addr = "0.4"
5354
spin = "0.9"
5455

5556
starry-core = { path = "./core" }
@@ -64,6 +65,7 @@ homepage.workspace = true
6465
repository.workspace = true
6566

6667
[features]
68+
defplat = ["axfeat/defplat"]
6769
lwext4_rs = ["axfeat/lwext4_rs"]
6870

6971
[dependencies]
@@ -90,5 +92,4 @@ shlex = { version = "1.3.0", default-features = false }
9092
syscalls = { git = "https://github.com/jasonwhite/syscalls.git", rev = "92624de", default-features = false }
9193

9294
[patch.crates-io]
93-
page_table_multiarch = { git = "https://github.com/Mivik/page_table_multiarch.git", rev = "19ededd" }
94-
page_table_entry = { git = "https://github.com/Mivik/page_table_multiarch.git", rev = "19ededd" }
95+
axcpu = { git = "https://github.com/Starry-Mix-THU/axcpu.git", rev = "4d95bb0" }

Makefile

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ AX_TESTCASE ?= nimbos
33
ARCH ?= x86_64
44
LOG ?= off
55
AX_TESTCASES_LIST=$(shell cat ./apps/$(AX_TESTCASE)/testcase_list | tr '\n' ',')
6-
FEATURES ?= fp_simd
76

87
export NO_AXSTD := y
98
export AX_LIB := axfeat
109

1110
RUSTDOCFLAGS := -Z unstable-options --enable-index-page -D rustdoc::broken_intra_doc_links -D missing-docs
12-
EXTRA_CONFIG ?= $(PWD)/configs/$(ARCH).toml
1311
ifneq ($(filter $(MAKECMDGOALS),doc),) # make doc
1412
export RUSTDOCFLAGS
1513
else ifeq ($(filter $(MAKECMDGOALS),clean user_apps ax_root),) # Not make clean, user_apps, ax_root
@@ -24,15 +22,11 @@ OUT_BIN := $(DIR)_$(ARCH)-qemu-virt.bin
2422
ifeq ($(ARCH), x86_64)
2523
TARGET := x86_64-unknown-none
2624
else ifeq ($(ARCH), aarch64)
27-
ifeq ($(findstring fp_simd,$(FEATURES)),)
28-
TARGET := aarch64-unknown-none-softfloat
29-
else
30-
TARGET := aarch64-unknown-none
31-
endif
25+
TARGET := aarch64-unknown-none-softfloat
3226
else ifeq ($(ARCH), riscv64)
3327
TARGET := riscv64gc-unknown-none-elf
3428
else ifeq ($(ARCH), loongarch64)
35-
TARGET := loongarch64-unknown-none
29+
TARGET := loongarch64-unknown-none-softfloat
3630
else
3731
$(error ARCH must be one of x86_64, aarch64, riscv64, loongarch64)
3832
endif
@@ -43,7 +37,7 @@ all: oscomp_build
4337

4438
# export dummy config for clippy
4539
clippy: defconfig
46-
@AX_CONFIG_PATH=$(PWD)/.axconfig.toml cargo clippy --target $(TARGET) --all-features -- -D warnings -A clippy::new_without_default
40+
@cargo clippy --target $(TARGET) --all-features -- -D warnings -A clippy::new_without_default
4741

4842
ax_root:
4943
@./scripts/set_ax_root.sh $(AX_ROOT)
@@ -62,7 +56,7 @@ test: defconfig
6256
@./scripts/app_test.sh
6357

6458
defconfig build run justrun debug disasm: ax_root
65-
@make -C $(AX_ROOT) A=$(PWD) EXTRA_CONFIG=$(EXTRA_CONFIG) $@
59+
@make -C $(AX_ROOT) A=$(PWD) $@
6660

6761
clean: ax_root
6862
@make -C $(AX_ROOT) A=$(PWD) ARCH=$(ARCH) clean
@@ -72,6 +66,6 @@ clean: ax_root
7266
@cargo clean
7367

7468
doc: defconfig
75-
@AX_CONFIG_PATH=$(PWD)/.axconfig.toml cargo doc --no-deps --all-features --workspace
69+
@cargo doc --no-deps --all-features --workspace
7670

7771
.PHONY: all ax_root build run justrun debug disasm clean test_build

api/src/imp/mm/brk.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ pub fn sys_brk(addr: usize) -> LinuxResult<isize> {
66
let process_data = task.task_ext().process_data();
77
let mut return_val: isize = process_data.get_heap_top() as isize;
88
let heap_bottom = process_data.get_heap_bottom() as usize;
9-
if addr != 0 && addr >= heap_bottom && addr <= heap_bottom + axconfig::plat::USER_HEAP_SIZE {
9+
if addr != 0 && addr >= heap_bottom && addr <= heap_bottom + starry_core::config::USER_HEAP_SIZE
10+
{
1011
process_data.set_heap_top(addr);
1112
return_val = addr as isize;
1213
}

api/src/imp/mm/mmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn sys_munmap(addr: usize, length: usize) -> LinuxResult<isize> {
168168
let length = align_up_4k(length);
169169
let start_addr = VirtAddr::from(addr);
170170
aspace.unmap(start_addr, length)?;
171-
axhal::arch::flush_tlb(None);
171+
axhal::asm::flush_tlb(None);
172172
Ok(0)
173173
}
174174

api/src/imp/signal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use core::{mem, time::Duration};
22

33
use alloc::sync::Arc;
44
use axerrno::{LinuxError, LinuxResult};
5-
use axhal::arch::TrapFrame;
5+
use axhal::context::TrapFrame;
66
use axprocess::{Pid, Thread};
77
use axsignal::{SignalInfo, SignalSet, SignalStack, Signo};
88
use axtask::{TaskExtRef, current};

api/src/imp/task/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use alloc::sync::Arc;
22
use axerrno::{LinuxError, LinuxResult};
33
use axfs::{CURRENT_DIR, CURRENT_DIR_PATH};
4-
use axhal::arch::{TrapFrame, UspaceContext};
4+
use axhal::context::{TrapFrame, UspaceContext};
55
use axprocess::Pid;
66
use axsignal::Signo;
77
use axsync::Mutex;

api/src/imp/task/execve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use core::ffi::c_char;
22

33
use alloc::{string::ToString, vec::Vec};
44
use axerrno::{LinuxError, LinuxResult};
5-
use axhal::arch::TrapFrame;
5+
use axhal::context::TrapFrame;
66
use axtask::{TaskExtRef, current};
77
use starry_core::mm::{load_user_app, map_trampoline};
88

@@ -44,7 +44,7 @@ pub fn sys_execve(
4444
let mut aspace = curr_ext.process_data().aspace.lock();
4545
aspace.unmap_user_areas()?;
4646
map_trampoline(&mut aspace)?;
47-
axhal::arch::flush_tlb(None);
47+
axhal::asm::flush_tlb(None);
4848

4949
let (entry_point, user_stack_base) =
5050
load_user_app(&mut aspace, &args, &envs).map_err(|_| {

api/src/imp/task/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn sys_set_tid_address(clear_child_tid: usize) -> LinuxResult<isize> {
5454

5555
#[cfg(target_arch = "x86_64")]
5656
pub fn sys_arch_prctl(
57-
tf: &mut axhal::arch::TrapFrame,
57+
tf: &mut axhal::context::TrapFrame,
5858
code: i32,
5959
addr: usize,
6060
) -> LinuxResult<isize> {

api/src/ptr.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core::{alloc::Layout, ffi::c_char, mem::transmute, ptr, slice, str};
33
use axerrno::{LinuxError, LinuxResult};
44
use axhal::paging::MappingFlags;
55
use axtask::{TaskExtRef, current};
6-
use memory_addr::{MemoryAddr, PAGE_SIZE_4K, VirtAddr, VirtAddrRange};
6+
use memory_addr::{MemoryAddr, PAGE_SIZE_4K, VirtAddr};
77
use starry_core::mm::access_user_memory;
88

99
fn check_region(start: VirtAddr, layout: Layout, access_flags: MappingFlags) -> LinuxResult<()> {
@@ -15,10 +15,7 @@ fn check_region(start: VirtAddr, layout: Layout, access_flags: MappingFlags) ->
1515
let task = current();
1616
let mut aspace = task.task_ext().process_data().aspace.lock();
1717

18-
if !aspace.check_region_access(
19-
VirtAddrRange::from_start_size(start, layout.size()),
20-
access_flags,
21-
) {
18+
if !aspace.can_access_range(start, layout.size(), access_flags) {
2219
return Err(LinuxError::EFAULT);
2320
}
2421

@@ -60,10 +57,7 @@ fn check_null_terminated<T: PartialEq + Default>(
6057
// allocated yet.
6158
let task = current();
6259
let aspace = task.task_ext().process_data().aspace.lock();
63-
if !aspace.check_region_access(
64-
VirtAddrRange::from_start_size(page, PAGE_SIZE_4K),
65-
access_flags,
66-
) {
60+
if !aspace.can_access_range(page, PAGE_SIZE_4K, access_flags) {
6761
return Err(LinuxError::EFAULT);
6862
}
6963

0 commit comments

Comments
 (0)