mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-22 09:26:26 +04:00
add/update gui user apps/libs
This commit is contained in:
parent
e7e7d572ba
commit
64dc2ffc10
19
user/src/bin/gui.rs
Normal file
19
user/src/bin/gui.rs
Normal 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
|
||||||
|
}
|
||||||
|
|
@ -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) => {
|
||||||
|
@ -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])
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user