syscall/sysmsg overview

Matthew Dillon dillon at
Fri Jun 23 09:50:23 PDT 2006

:I've been digging around in the code here:
:trying to learn more about the new syscall messaging infrastructure.
:I realize the code is old and outdated.  I have read the information
:available at with regard to the new sysmsg work.
:I don't quite understand how a sysmsg is constructed or where exactly.
:call.  Any pointers to places in the code I can read to learn more
:would also be helpful.  I've looked at /sys/i386/i386/trap.c and the
:sys{msg,union,proto}.h header files.
:Also any information with regard to adding syscalls via KLD would be a
:boon as well.  I have a hacked up version of the example that passes
:data from userland to the kernel and back again but I feel this isn't
:quite right.  

    Heh.  I just ripped most of it out.  The structural infrastructure is
    still there, but it's no longer 'messaged'.

    Basically just look at any existing system call.  For example,
    sys_utimes() in kern/vfs_syscalls.c.

    Any pointers supplies by userland, for example a pointer to a timeval,
    must be copied into kernel space before the kernel can safely access
    it.  You also need to avoid declaring large structures or buffers 
    on the kernel stack, so for example you would have to malloc() that
    1024 byte buffer in your example.

					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>

More information about the Kernel mailing list