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

Commit cfecec2

Browse files
author
cyh21
committed
merge main into cyh-dev 0401
2 parents 98d930b + cfc5f30 commit cfecec2

42 files changed

Lines changed: 583 additions & 291 deletions

Some content is hidden

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

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
arch: x86_64
2828
- name: Build docs
2929
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }}
30-
run: make doc_check_missing
30+
run: make doc
3131
- name: Deploy to Github Pages
3232
if: ${{ github.ref == env.default-branch }}
3333
uses: JamesIves/github-pages-deploy-action@v4

Cargo.lock

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

Cargo.toml

Lines changed: 62 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,77 @@
1-
[package]
2-
name = "starry"
1+
[workspace]
2+
resolver = "2"
3+
members = ["api", "core"]
4+
exclude = [".arceos", "apps"]
5+
6+
[workspace.package]
37
version = "0.1.0"
48
edition = "2024"
5-
authors = ["Azure-stars <Azure_stars@126.com>", "Yuekai Jia <equation618@gmail.com>"]
9+
authors = [
10+
"Azure-stars <Azure_stars@126.com>",
11+
"Yuekai Jia <equation618@gmail.com>",
12+
]
613
homepage = "https://github.com/arceos-org/arceos"
714
repository = "https://github.com/arceos-org/starry-next"
815

9-
[features]
10-
lwext4_rs = ["axstd/lwext4_rs"]
11-
12-
[dependencies]
13-
log = "0.4"
14-
linkme = "0.3"
15-
axerrno = "0.1"
16-
memory_addr = "0.3"
17-
xmas-elf = "0.9"
18-
spin = "0.9"
19-
crate_interface = "0.1"
20-
bitflags = "2.6"
21-
percpu = "0.2.0"
22-
23-
kernel-elf-parser = "0.3"
24-
num_enum = { version = "0.7", default-features = false }
25-
syscalls = { version = "0.6", default-features = false }
26-
numeric-enum-macro = "0.2.0"
27-
static_assertions = "1.1.0"
28-
macro_rules_attribute = "0.2.0"
16+
[workspace.dependencies]
17+
axfeat = { git = "https://github.com/oscomp/arceos.git" }
18+
arceos_posix_api = { git = "https://github.com/oscomp/arceos.git", features = [
19+
"uspace",
20+
"smp",
21+
"irq",
22+
"fs",
23+
"multitask",
24+
"net",
25+
"pipe",
26+
"select",
27+
"epoll",
28+
] }
2929

3030
axconfig = { git = "https://github.com/oscomp/arceos.git" }
3131
axfs = { git = "https://github.com/oscomp/arceos.git" }
32-
axstd = { git = "https://github.com/oscomp/arceos.git", features = ["paging"] }
3332
axhal = { git = "https://github.com/oscomp/arceos.git", features = ["uspace"] }
33+
axlog = { git = "https://github.com/oscomp/arceos.git" }
3434
axmm = { git = "https://github.com/oscomp/arceos.git" }
35-
axtask = { git = "https://github.com/oscomp/arceos.git" }
35+
axns = { git = "https://github.com/oscomp/arceos.git", features = [
36+
"thread-local",
37+
] }
3638
axsync = { git = "https://github.com/oscomp/arceos.git" }
37-
axruntime = { git = "https://github.com/oscomp/arceos.git", features = ["multitask"] }
38-
arceos_posix_api = { git = "https://github.com/oscomp/arceos.git", features = ["uspace", "smp", "irq", "fs", "multitask", "net", "pipe", "select", "epoll"] }
39-
axns = { git = "https://github.com/oscomp/arceos.git", features = ["thread-local"] }
39+
axtask = { git = "https://github.com/oscomp/arceos.git" }
40+
41+
axerrno = "0.1"
42+
bitflags = "2.6"
43+
linkme = "0.3"
44+
memory_addr = "0.3"
45+
46+
starry-core = { path = "./core" }
47+
starry-api = { path = "./api" }
48+
49+
[package]
50+
name = "starry"
51+
version.workspace = true
52+
edition.workspace = true
53+
authors.workspace = true
54+
homepage.workspace = true
55+
repository.workspace = true
56+
57+
[features]
58+
lwext4_rs = ["axfeat/lwext4_rs"]
59+
60+
[dependencies]
61+
axfeat.workspace = true
62+
63+
axhal.workspace = true
64+
axlog.workspace = true
65+
axtask.workspace = true
66+
67+
axerrno.workspace = true
68+
linkme.workspace = true
69+
70+
starry-core.workspace = true
71+
starry-api.workspace = true
72+
73+
syscalls = { git = "https://github.com/jasonwhite/syscalls.git", rev = "92624de", default-features = false }
4074

4175
[patch.crates-io]
42-
syscalls = { git = "https://github.com/jasonwhite/syscalls.git", rev = "92624de"}
4376
page_table_multiarch = { git = "https://github.com/Mivik/page_table_multiarch.git", rev = "19ededd" }
4477
page_table_entry = { git = "https://github.com/Mivik/page_table_multiarch.git", rev = "19ededd" }
45-
46-
[target.'cfg(target_arch = "x86_64")'.dependencies]
47-
x86 = "0.52"
48-
49-
[build-dependencies]
50-
toml_edit = "0.22"

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ LOG ?= off
55
AX_TESTCASES_LIST=$(shell cat ./apps/$(AX_TESTCASE)/testcase_list | tr '\n' ',')
66
FEATURES ?= fp_simd
77

8+
export NO_AXSTD := y
9+
export AX_LIB := axfeat
10+
811
RUSTDOCFLAGS := -Z unstable-options --enable-index-page -D rustdoc::broken_intra_doc_links -D missing-docs
912
EXTRA_CONFIG ?= $(PWD)/configs/$(ARCH).toml
1013
ifneq ($(filter $(MAKECMDGOALS),doc_check_missing),) # make doc_check_missing
@@ -68,7 +71,7 @@ clean: ax_root
6871
done
6972
@cargo clean
7073

71-
doc_check_missing:
72-
@cargo doc --no-deps --all-features --workspace
74+
doc: defconfig
75+
@AX_CONFIG_PATH=$(PWD)/.axconfig.toml cargo doc --no-deps --all-features --workspace
7376

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

README.md

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Create a container and build/run app:
2323
cd ..
2424
docker run --privileged --rm -it -v $(pwd):/starry -w /starry starry bash
2525

26+
2627
# Now build/run app in the container
2728
make user_apps
2829
make defconfig
@@ -168,7 +169,17 @@ To run more testcases from oscomp, you can refer to the [oscomp README](./apps/o
168169

169170
## How to add new testcases
170171

171-
To allow the kernel to run user-written test cases, temporary test cases can be created. The specific steps are as follows:
172+
To allow the kernel to run user-written test cases, temporary test cases can be created.
173+
174+
175+
If you want to add source codes of the testcases, you can refer to the [libc testcases](./apps/libc) and add your source codes in the [c testcase](./apps/libc/c/) folder, and append the [testcase_list](./apps/libc/testcase_list) with your testcase name. Then you can run the testcases with the following commands:
176+
177+
```sh
178+
make AX_TESTCASE=libc user_apps ARCH=$(YOUR_ARCH)
179+
make AX_TESTCASE=libc BLK=y NET=y FEATURES=fp_simd ACCEL=n run ARCH=$(YOUR_ARCH)
180+
```
181+
182+
If you want to add **executable file** directly, the specific steps are as follows:
172183

173184
1. Create a temporary test case folder
174185

@@ -189,28 +200,7 @@ To allow the kernel to run user-written test cases, temporary test cases can be
189200

190201
The reason for creating an empty build `Makefile` is that when Starry packages test case images, it will first execute the test case's build program by default. However, since our temporary test case does not currently have a defined build program, `make all` does not need to perform any operations.
191202
192-
3. Copy your compiled executable file into the current directory.
193-
194-
Let's take a `hello_world` example. Create a `hello.c` file in the current directory and write the following content:
195-
196-
```c
197-
#include "syscall.h"
198-
199-
int main()
200-
{
201-
char msg[] = "Hello, World!\n";
202-
write(1, msg, sizeof(msg));
203-
return 0;
204-
}
205-
```
206-
207-
Then, run the following command to compile it:
208-
209-
```sh
210-
x86_64-linux-musl-gcc -static hello.c -o hello
211-
```
212-
213-
This generates an x86_64 executable file in the current folder. Of course, you can also complete the compilation process elsewhere and directly copy the executable file into the current directory.
203+
3. Copy your **executable file** into the current directory.
214204
215205
4. Create a `testcase_list` file in the current directory and add the relative path of the executable file that needs to be executed. Note that this path should be relative to `apps/custom` (i.e., the current directory). In our example, the content should be:
216206
@@ -224,7 +214,7 @@ To allow the kernel to run user-written test cases, temporary test cases can be
224214
sudo ./build_img.sh -fs ext4 -file apps/custom
225215
cp disk.img .arceos/disk.img
226216
make defconfig
227-
make AX_TESTCASE=custom EXTRA_CONFIG=../configs/x86_64.toml ARCH=x86_64 BLK=y NET=y FEATURES=fp_simd,lwext4_rs LOG=off ACCEL=n run
217+
make AX_TESTCASE=custom ARCH=x86_64 BLK=y NET=y FEATURES=fp_simd,lwext4_rs LOG=off ACCEL=n run
228218
```
229219
230-
This completes the execution of the custom test case.
220+
This completes the execution of the custom test case.

api/Cargo.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[package]
2+
name = "starry-api"
3+
version.workspace = true
4+
edition.workspace = true
5+
authors.workspace = true
6+
homepage.workspace = true
7+
repository.workspace = true
8+
9+
[dependencies]
10+
axconfig.workspace = true
11+
axfs.workspace = true
12+
axhal.workspace = true
13+
axlog.workspace = true
14+
axsync.workspace = true
15+
axtask.workspace = true
16+
arceos_posix_api.workspace = true
17+
18+
axerrno.workspace = true
19+
bitflags.workspace = true
20+
memory_addr.workspace = true
21+
22+
starry-core.workspace = true
23+
24+
macro_rules_attribute = "0.2"
25+
num_enum = { version = "0.7", default-features = false }
26+
static_assertions = "1.1"
27+
28+
[target.'cfg(target_arch = "x86_64")'.dependencies]
29+
x86 = "0.52"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use macro_rules_attribute::apply;
77

88
use crate::{
99
ptr::{PtrWrapper, UserConstPtr, UserPtr},
10-
syscall_imp::syscall_instrument,
10+
syscall_instrument,
1111
};
1212

1313
/// The ioctl() system call manipulates the underlying device parameters
@@ -32,7 +32,7 @@ pub fn sys_chdir(path: UserConstPtr<c_char>) -> LinuxResult<isize> {
3232
})
3333
}
3434

35-
pub(crate) fn sys_mkdirat(dirfd: i32, path: UserConstPtr<c_char>, mode: u32) -> LinuxResult<isize> {
35+
pub fn sys_mkdirat(dirfd: i32, path: UserConstPtr<c_char>, mode: u32) -> LinuxResult<isize> {
3636
let path = path.get_as_str()?;
3737

3838
if !path.starts_with("/") && dirfd != AT_FDCWD as i32 {

0 commit comments

Comments
 (0)