FreeBSD kernel system call

Polytropon freebsd at edvax.de
Wed Jun 19 21:03:51 UTC 2019


On Wed, 19 Jun 2019 16:12:51 +0300, Alexandru Goia wrote:
> I am trying to write the code to a Unix system call, on the
> FreeBSD 12.0 system. I managed to do that on Linux :
> 
> http://romania-acknowledges-stars.blogspot.com/2018/10/angel-call-in-kernel.html
> 
> but I find hard, without proper documentation, to implement it
> on FreeBSD.

There is documentation available:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86-system-calls.html

https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86-first-program.html

Maybe this is a better entry point:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86.html



> I am in trouble understanding the presence of SYSCALL_MODULE(9), and
> its meaning and usage.

Does the command "man 9 SYSCALL_MODULE" provide any help? From
the description:

	The SYSCALL_MODULE() macro declares a new syscall.
	SYSCALL_MODULE() expands into a kernel module declaration
	named as name.

If you have obtained the FreeBSD sources, also have a look at the
file /usr/share/examples/kld/syscall/module/syscall.c where you
can find an illustration of how a kernel module can be created
to provide an additional system call.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list