add/update gui user apps/libs

This commit is contained in:
Yu Chen 2022-06-18 17:57:54 +08:00
parent e7e7d572ba
commit 64dc2ffc10
3 changed files with 25 additions and 1 deletions

19
user/src/bin/gui.rs Normal file
View File

@ -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
}

View File

@ -198,7 +198,9 @@ pub fn condvar_signal(condvar_id: usize) {
pub fn condvar_wait(condvar_id: usize, mutex_id: usize) { pub fn condvar_wait(condvar_id: usize, mutex_id: usize) {
sys_condvar_wait(condvar_id, mutex_id); sys_condvar_wait(condvar_id, mutex_id);
} }
pub fn create_desktop() {
sys_create_desktop();
}
#[macro_export] #[macro_export]
macro_rules! vstore { macro_rules! vstore {
($var_ref: expr, $value: expr) => { ($var_ref: expr, $value: expr) => {

View File

@ -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 { pub fn sys_condvar_wait(condvar_id: usize, mutex_id: usize) -> isize {
syscall(SYSCALL_CONDVAR_WAIT, [condvar_id, mutex_id, 0]) syscall(SYSCALL_CONDVAR_WAIT, [condvar_id, mutex_id, 0])
} }
pub fn sys_create_desktop() -> isize {
syscall(2000, [0, 0, 0])
}