diff --git a/user/Cargo.toml b/user/Cargo.toml index 9044a4c..0c95325 100644 --- a/user/Cargo.toml +++ b/user/Cargo.toml @@ -1,6 +1,7 @@ -[workspace] +[package] +name = "ucore-user-programs" +version = "0.1.0" +authors = ["Runji Wang "] -members = [ - "ucore-ulib", - "hello", -] \ No newline at end of file +[dependencies] +"ucore-ulib" = { path = "ucore-ulib" } \ No newline at end of file diff --git a/user/Makefile b/user/Makefile index ec5f14e..52ebf0a 100644 --- a/user/Makefile +++ b/user/Makefile @@ -1,2 +1,5 @@ +# arch = {riscv32, x86_64} +arch := riscv32 + all: - @RUST_TARGET_PATH=$(pwd) xargo build --target x86_64-blog_os \ No newline at end of file + @RUST_TARGET_PATH=$(shell pwd) xargo build --target $(arch)-ucore \ No newline at end of file diff --git a/user/hello/Cargo.toml b/user/hello/Cargo.toml deleted file mode 100644 index 28a5ac6..0000000 --- a/user/hello/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "hello" -version = "0.1.0" -authors = ["WangRunji "] - -[dependencies] -ucore-ulib = { path = "../ucore-ulib" } diff --git a/user/riscv32-blog_os.json b/user/riscv32-ucore.json similarity index 100% rename from user/riscv32-blog_os.json rename to user/riscv32-ucore.json diff --git a/user/hello/src/main.rs b/user/src/bin/hello.rs similarity index 100% rename from user/hello/src/main.rs rename to user/src/bin/hello.rs diff --git a/user/ucore-ulib/src/syscall.rs b/user/ucore-ulib/src/syscall.rs index 570e6c9..e537e4f 100644 --- a/user/ucore-ulib/src/syscall.rs +++ b/user/ucore-ulib/src/syscall.rs @@ -39,7 +39,7 @@ fn sys_call(id: usize, arg0: usize, arg1: usize, arg2: usize, arg3: usize, arg4: : "memory" : "volatile"); #[cfg(target_arch = "x86_64")] - asm!("int 0x80" + asm!("int 0x40" : "={rax}" (ret) : "{rax}" (id), "{rdi}" (arg0), "{rsi}" (arg1), "{rdx}" (arg2), "{rcx}" (arg3), "{r8}" (arg4), "{r9}" (arg5) : "memory" diff --git a/user/x86_64-blog_os.json b/user/x86_64-ucore.json similarity index 100% rename from user/x86_64-blog_os.json rename to user/x86_64-ucore.json