Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase system calls support #4

Open
olivierpierre opened this issue Jun 18, 2019 · 0 comments
Open

Increase system calls support #4

olivierpierre opened this issue Jun 18, 2019 · 0 comments

Comments

@olivierpierre
Copy link
Collaborator

olivierpierre commented Jun 18, 2019

We support only a subset of Linux's syscalls. Supporte system calls are listed here. Each case of the switch statement corresponds to a system call and redirect the execution to the syscall implementation. The system call implementation themselves are present here (one file per system call).

When a system call is not supported the execution will abort. With verbose mode enabled it is easy to identify which system call was called as the log will contain a line like this:

[0.000][0:1][ERROR] Unsuported Linux syscall: 34

In this particular example we are missing the pause system call implementation. It's id is 34. For a mapping of system call names to ids, see here for example.

In order to add a new system call implementation, one can create a new file in hermitux-kernel's kernel/syscalls and write the corresponding case directive in arch/x86/kernek/isrs.c. Following the Linux ABI the parameters should be passed in the correct order: %rdi, %rsi, %rdx, %r10, %r8 and %r9. An example for the read system call can be found here.

Generally, the more system calls we support, the more application we support. This paper contains an interesting study of Linux's syscall usage, and may be used to prioritize system call support in HermiTux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant