mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-08 20:10:04 -04:00
Prepare system calls for exec and await
This commit is contained in:
parent
744b0a62ae
commit
93b763ad86
@ -38,6 +38,18 @@ void sc_sleep_ms(interrupt::syscall_regs* regs){
|
||||
scheduler::sleep_ms(scheduler::get_pid(), time);
|
||||
}
|
||||
|
||||
void sc_exec(interrupt::syscall_regs* regs){
|
||||
auto file = reinterpret_cast<char*>(regs->rbx);
|
||||
|
||||
regs->rax = scheduler::exec(file);
|
||||
}
|
||||
|
||||
void sc_await_termination(interrupt::syscall_regs* regs){
|
||||
auto pid = regs->rbx;
|
||||
|
||||
//TODO Implement
|
||||
}
|
||||
|
||||
} //End of anonymous namespace
|
||||
|
||||
void system_call_entry(interrupt::syscall_regs* regs){
|
||||
@ -64,6 +76,14 @@ void system_call_entry(interrupt::syscall_regs* regs){
|
||||
sc_sleep_ms(regs);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
sc_exec(regs);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
sc_await_termination(regs);
|
||||
break;
|
||||
|
||||
case 0x666:
|
||||
//TODO Do something with return code
|
||||
scheduler::kill_current_process();
|
||||
|
Loading…
x
Reference in New Issue
Block a user