Prepare system calls for exec and await

This commit is contained in:
Baptiste Wicht 2014-02-03 21:28:17 +01:00
parent 744b0a62ae
commit 93b763ad86

View File

@ -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();