Implement syscall and scheduler.