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)
Tue, Dec 24, 7:27 PM
Unknown Object (File)
Mon, Dec 16, 2:44 AM
Unknown Object (File)
Sun, Dec 8, 7:28 PM
Unknown Object (File)
Mon, Dec 2, 2:48 AM
Unknown Object (File)
Fri, Nov 29, 11:57 PM
Unknown Object (File)
Oct 31 2024, 3:14 AM
Unknown Object (File)
Oct 27 2024, 1:23 PM
Unknown Object (File)
Oct 27 2024, 1:20 PM
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 Not Applicable
Unit
Tests Not Applicable

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
12 ↗(On Diff #6567)

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

ed edited edge metadata.
sys/compat/cloudabi64/Makefile
12 ↗(On Diff #6567)

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 ↗(On Diff #6734)

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 ↗(On Diff #6734)

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 ↗(On Diff #6734)

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 ↗(On Diff #6734)

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 ↗(On Diff #6734)

Thanks! Be sure to copy whatever you like!

This revision was automatically updated to reflect the committed changes.