Page MenuHomeFreeBSD

CloudABI: Add system call stubs.
ClosedPublic

Authored by ed on Jun 17 2015, 3:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 20, 1:16 PM
Unknown Object (File)
Sun, Oct 6, 3:46 AM
Unknown Object (File)
Wed, Oct 2, 6:09 AM
Unknown Object (File)
Mon, Sep 30, 7:36 PM
Unknown Object (File)
Mon, Sep 30, 4:18 AM
Unknown Object (File)
Mon, Sep 30, 4:18 AM
Unknown Object (File)
Mon, Sep 30, 4:14 AM
Unknown Object (File)
Mon, Sep 30, 4:14 AM
Subscribers

Details

Summary

The first step to add support for CloudABI executables to the FreeBSD kernel is to import the CloudABI system call definitions into our source tree. These header files contain definitions for all types, structures and constants that are shared between kernelspace and userspace.

The syscalldefs_mi.h header file contains all of the data that does not depend on the target platform, in particularly the pointer size. These are placed in syscalldefs_md.h. The advantage of splitting these up is that it makes it easier to add support for both 32-bit and 64-bit binaries. It allows us to easily determine which system calls need to be implemented separately to support both flavors.

This change imports copies of upstream CloudABI syscalldefs_m*.h into the contributed code directory. It then adds wrappers around them stored in sys/compat/cloudabi and sys/compat/cloudabi64 to make them work in kernel space. These two directories will be used to store all of the emulator code.

In addition to importing the system call definitions, this change adds the CloudABI system call table, including stubs for every system call. After this change has been imported, we can make CloudABI support more complete by implementing all of the individual system calls.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

ed retitled this revision from to CloudABI: Add system call definition headers..
ed updated this object.
ed edited the test plan for this revision. (Show Details)
ed added reviewers: jonathan, theraven, brooks.
ed set the repository for this revision to rS FreeBSD src repository - subversion.
ed retitled this revision from CloudABI: Add system call definition headers. to CloudABI: Add system call stubs..
ed updated this object.
ed added a reviewer: emaste.

Do you have an expected timeline on introducing the syscalls?

sys/compat/cloudabi64/Makefile
13

Minor nit, what about a command line flag to enable all syscalls in cap mode instead?

ed edited edge metadata.
sys/compat/cloudabi64/Makefile
13

That's a good question!

I just looked into it more closely and it seems that we can just set "capenabled=..." in syscalls.conf to list all of the system calls. I've adjusted syscalls.conf to contain some sed magic to just extract all of the system calls without requiring the change to makesyscalls.sh.

Does that look all right?

In D2848#59109, @emaste wrote:

Do you have an expected timeline on introducing the syscalls?

Forgot to reply to this question: my idea is to start sending out code reviews for individual system calls after this change lands. Some of the system calls require some (minor) changes to generic FreeBSD code, so by importing it this way the changes become more self-contained.

sys/compat/cloudabi64/Makefile
12

I think that's preferable to the previous patch.

brooks edited edge metadata.

Looks good to go once minor the syscalls.conf issue is addressed.

sys/compat/cloudabi64/syscalls.conf
14

Shouldn't syscalls.master here be an $1 since it's not a hardcoded input to mksyscalls.sh?

sys/contrib/cloudabi/syscalldefs_md.h
42

I like this construct, I'll want to swipe it for our pure-CHERI syscall implementation.

This revision is now accepted and ready to land.Jul 9 2015, 12:53 AM

Looks like we're good to go. Will push this into HEAD.

sys/compat/cloudabi64/syscalls.conf
14

Good point. I've changed the file to use $1. I've extended the comment above to clarify that it extracts them from syscalls.master, so we spend less time reverse engineering.

sys/contrib/cloudabi/syscalldefs_md.h
42

Thanks! Be sure to copy whatever you like!

This revision was automatically updated to reflect the committed changes.