Re: implementing a syscall in a module

Craig Milo Rogers (rogers@ISI.EDU)
Fri, 17 Apr 1998 12:01:19 -0700


>> Implementing a system call compiled into the kernel is a piece of
>> cake, so that is not my problem. And writing a module is a piece of
>> cake, so that isn't the problem either. How to mix the two is.
>
>You'd probably want the syscall in the kernel. Then,
>when the call is made, the kernel knows it has to load
>the module in order to complete the call.
>
>If you were to leave both out in the module, the kernel
>would have no way of knowing when to load the module.

Why couldn't the kernel use logic akin to that in
"net/socket.c"? When a user attempts to attempts to open a socket
with an unknown protocol family, sys_socket() attempts to load a
module named "net-pf-%d", where %d is the protocol family number.
Similarly, when an unknown syscall is called, the kernel could request
a module named "syscall-%d", where %d is the syscall number.

This would require changes in the architecture-specific code,
such as "arch/i386/kernel/entry.S", but it looks very do-able. This
suggests that one could omit infrequently used system calls so long as
they aren't required before modules can be loaded during system
startup. This could lead to a considerable savings for people who
worry about fitting a Linux installation package on a floppy disk!

The problem is not loading modular system calls -- it's making
sure that problems don't occur when two different groups use the same
system call number for a local system call, and then exchange code.

I'd refer to my old OS/360 manual for historical examples of
transient system call handlers, but I don't know where I put it. :-)

Craig Milo Rogers

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu