Import the CloudABI datatypes and create a system call table.
authored <ed@FreeBSD.org>
Thu, 9 Jul 2015 07:20:15 +0000 (07:20 +0000)
committered <ed@FreeBSD.org>
Thu, 9 Jul 2015 07:20:15 +0000 (07:20 +0000)
commitaf8adb5b79eeec63082a718c418fac779013ea48
tree740a6ea263c6b4989dc446113a34cef6fa14aef4
parentb23b1a18f0d1e3cf77b0e61d66e95659206c3391
Import the CloudABI datatypes and create a system call table.

CloudABI is a pure capability-based runtime environment for UNIX. It
works similar to Capsicum, except that processes already run in
capabilities mode on startup. All functionality that conflicts with this
model has been omitted, making it a compact binary interface that can be
supported by other operating systems without too much effort.

CloudABI is 'secure by default'; the idea is that it should be safe to
run arbitrary third-party binaries without requiring any explicit
hardware virtualization (Bhyve) or namespace virtualization (Jails). The
rights of an application are purely determined by the set of file
descriptors that you grant it on startup.

The datatypes and constants used by CloudABI's C library (cloudlibc) are
defined in separate files called syscalldefs_mi.h (pointer size
independent) and syscalldefs_md.h (pointer size dependent). We import
these files in sys/contrib/cloudabi and wrap around them in
cloudabi*_syscalldefs.h.

We then add stubs for all of the system calls in sys/compat/cloudabi or
sys/compat/cloudabi64, depending on whether the system call depends on
the pointer size. We only have nine system calls that depend on the
pointer size. If we ever want to support 32-bit binaries, we can simply
add sys/compat/cloudabi32 and implement these nine system calls again.

The next step is to send in code reviews for the individual system call
implementations, but also add a sysentvec, to allow CloudABI executabled
to be started through execve().

More information about CloudABI:
- GitHub: https://github.com/NuxiNL/cloudlibc
- Talk at BSDCan: https://www.youtube.com/watch?v=SVdF84x1EdA

Differential Revision: https://reviews.freebsd.org/D2848
Reviewed by: emaste, brooks
Obtained from: https://github.com/NuxiNL/freebsd
24 files changed:
sys/compat/cloudabi/cloudabi_clock.c [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_fd.c [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_file.c [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_futex.c [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_mem.c [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_proc.c [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_proto.h [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_random.c [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_sock.c [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_syscalldefs.h [new file with mode: 0644]
sys/compat/cloudabi/cloudabi_thread.c [new file with mode: 0644]
sys/compat/cloudabi64/Makefile [new file with mode: 0644]
sys/compat/cloudabi64/cloudabi64_fd.c [new file with mode: 0644]
sys/compat/cloudabi64/cloudabi64_poll.c [new file with mode: 0644]
sys/compat/cloudabi64/cloudabi64_sock.c [new file with mode: 0644]
sys/compat/cloudabi64/cloudabi64_syscalldefs.h [new file with mode: 0644]
sys/compat/cloudabi64/cloudabi64_thread.c [new file with mode: 0644]
sys/compat/cloudabi64/syscalls.conf [new file with mode: 0644]
sys/compat/cloudabi64/syscalls.master [new file with mode: 0644]
sys/conf/files
sys/conf/options
sys/contrib/cloudabi/syscalldefs_md.h [new file with mode: 0644]
sys/contrib/cloudabi/syscalldefs_mi.h [new file with mode: 0644]
sys/kern/makesyscalls.sh