From 64dc2ffc10b3002e6f28e97f48ba6684aa08bcaa Mon Sep 17 00:00:00 2001 From: Yu Chen Date: Sat, 18 Jun 2022 17:57:54 +0800 Subject: [PATCH] add/update gui user apps/libs --- user/src/bin/gui.rs | 19 +++++++++++++++++++ user/src/lib.rs | 4 +++- user/src/syscall.rs | 3 +++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 user/src/bin/gui.rs diff --git a/user/src/bin/gui.rs b/user/src/bin/gui.rs new file mode 100644 index 00000000..e3f7ec2c --- /dev/null +++ b/user/src/bin/gui.rs @@ -0,0 +1,19 @@ +#![no_std] +#![no_main] + +use user_lib::create_desktop; + +#[macro_use] +extern crate user_lib; + + + +#[no_mangle] +pub fn main() -> i32 { + println!("gui"); + create_desktop(); + println!("exit pass."); + loop{} + 0 +} + diff --git a/user/src/lib.rs b/user/src/lib.rs index 729eaef3..6f57edd4 100644 --- a/user/src/lib.rs +++ b/user/src/lib.rs @@ -198,7 +198,9 @@ pub fn condvar_signal(condvar_id: usize) { pub fn condvar_wait(condvar_id: usize, mutex_id: usize) { sys_condvar_wait(condvar_id, mutex_id); } - +pub fn create_desktop() { + sys_create_desktop(); +} #[macro_export] macro_rules! vstore { ($var_ref: expr, $value: expr) => { diff --git a/user/src/syscall.rs b/user/src/syscall.rs index b4bb67a0..3f36f533 100644 --- a/user/src/syscall.rs +++ b/user/src/syscall.rs @@ -154,3 +154,6 @@ pub fn sys_condvar_signal(condvar_id: usize) -> isize { pub fn sys_condvar_wait(condvar_id: usize, mutex_id: usize) -> isize { syscall(SYSCALL_CONDVAR_WAIT, [condvar_id, mutex_id, 0]) } +pub fn sys_create_desktop() -> isize { + syscall(2000, [0, 0, 0]) +} \ No newline at end of file