Merge branch 'thread_scheduler' into bin-loader

This commit is contained in:
Quentin Legot
2023-04-04 15:28:24 +02:00
15 changed files with 989 additions and 713 deletions

View File

@ -65,7 +65,7 @@ __start:
.globl Halt
.type __Halt, @function
Halt:
Shutdown:
addi a7,zero,SC_HALT
ecall
jr ra

View File

@ -84,7 +84,7 @@
typedef int t_error;
/* Stop Nachos, and print out performance stats */
void Halt();
void Shutdown();
/* Return the time spent running Nachos */

21
test/userlib/syscall.rs Normal file
View File

@ -0,0 +1,21 @@
pub struct Burritos_Time {
seconds: i64,
nanos: i64
}
pub struct ThreadId{
id: u64
}
pub struct t_error{
t: i32
}
extern "C"{
fn Shutdown() -> ();
fn SysTime(t: Burritos_Time) -> ();
fn Exit(status: i32) -> ();
fn Exec(name: String) -> ThreadId;
fn newThread(debug_name: String, func: i32, arg: i32) -> ThreadId;
fn Join (id: ThreadId) -> t_error;
fn Yield() -> ();
fn Perror(mess: String) -> ();
}