steed icon indicating copy to clipboard operation
steed copied to clipboard

Generate syscalls ?

Open arnaud-lb opened this issue 7 years ago • 1 comments

Awesome project!

Golang took the same approach, partly for the same reasons. I believe that some of the Golang work / ideas could be reused here.

What they do is to generate simple functions that do nothing but calling syscall() with the right syscall number and arguments (example). Then these functions are used in the standard library.

Generation is done by the mksyscall.pl script. It takes an input file like this one, and generates this.

Syscall number constants are also generated by a script.

arnaud-lb avatar Jan 15 '17 09:01 arnaud-lb

Awesome project!

Thanks.

We are doing something similar but not generating everything "all the way down". The system call numbers have all been automatically generated but the thin syscall wrappers (thinner than go's -- they only add type checking to the "untyped" syscall! macro; they don't any conversion) are being manually written. It would be great to generate those too from the Linux source or something!

japaric avatar Jan 15 '17 16:01 japaric