Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Full Syscall Support: Linux + OpenBSD 6.1


Linux support has finally been reworked, and it's now generated from the
Linux syscall.h and syscalls.tbl.

This should be actual full system call coverage now, with the previous
caveats.

I'll post a writeup of how they're assembled the site soon. For now,
look int mc/support/syscall-gen.

The short summary of the contents of that directory:

	- gencalls.awk

		The code that parses the above files. It's a bit of
		a ball of muck, but it works reasonably well. It's
		called in two passes. It consumes three files:
		types+sys.myr, gentypes+sys.myr, and specials.myr

		In types.myr, we have exported type definitions and
		externs. In specials.myr, we have system call overrides.
		In gentypes.myr, we have types automatically scraped
		from system headers.

		The first pass parses the system calls and generates
		an incomplete sys+system-arch.myr. It also generates
		a file called `want.txt` with all the types that the
		system calls want.

		Then, c2myr.py consumes want.txt and generates
		The second pass does the same as the first one, but
		
	- gensys.sh

		The script that coordinates the above dance.

	- c2myr.py

		A pycparser based script that tries loading all of the
		system headers, then dumping a Myrddin definition for
		the types requested in want.txt. These types are dumped
		into gentypes+sys.myr.

	- syscalls+os.master:

		The BSD-style system call table data. Copied from
		/usr/src/sys/kern/syscalls.master, generally. Copied
		here for reproducibility.

	- syscalls+linux.tbl, syscalls+linux.h

		The Linux syscalll table and header with signatures.


On Sun, 6 Aug 2017 01:56:00 -0700, Ori Bernstein <ori@xxxxxxxxxxxxxx> wrote:

> With the help of scripts and conversion utilities, you should now be able to
> call (nearly) every system call on Linux and OpenBSD.
> 
> Like FreeBSD, The types should all be converted and available, but it's likely
> that there will be some missing flags and constants, and some APIs will be
> clunky and awkward, especially the ones that expect C strings.
> 
> Over time, adding more overrides should happen.
> 
> That leaves 2 incomplete platforms: NetBSD and OSX.
> 
> -- 
>     Ori Bernstein
> 


-- 
    Ori Bernstein

References:
Full Syscall Support: Linux + OpenBSD 6.1Ori Bernstein <ori@xxxxxxxxxxxxxx>