* system call
@ 2002-07-08 10:15 Bruno Pujol
2002-07-08 15:16 ` Randy.Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Bruno Pujol @ 2002-07-08 10:15 UTC (permalink / raw)
To: linux-kernel
Hi,
Do someone know how to add a system call for the kernel 2.4.8 ?
I did know how to do it for an older version (2.0.35) :
- add a line in the file : /usr/src/linux/include/asm/unistd.h
#define __NR_my_systemcall XXXX (where XXXX is the number for my new system call)
- modify the file /usr/src/linux/arch/i386/kernel/entry.S
- add my system call
.long SYMBOL_NAME (my_systemcall) at the end of the system callslist
- modify le last line of the file :
.space (NR_syscalls-166)*4 <= replace the 166 by 167
After this changes, I only needed to recompile the kernel and reboot with it... and a user's program could use the new system call...
But with my new kernel, this manupilation doesn't still work.
PUJOL Bruno
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: system call
2002-07-08 10:15 system call Bruno Pujol
@ 2002-07-08 15:16 ` Randy.Dunlap
2002-07-08 23:59 ` Vladimir Zidar
0 siblings, 1 reply; 4+ messages in thread
From: Randy.Dunlap @ 2002-07-08 15:16 UTC (permalink / raw)
To: Bruno Pujol; +Cc: linux-kernel
On Mon, 8 Jul 2002, Bruno Pujol wrote:
| Do someone know how to add a system call for the kernel 2.4.8 ?
There are _many_ examples of adding syscalls on the web.
Try searching with www.google.com if you haven't already.
I expect that the real problem is that a patch that works for
2.4.8 won't work for 2.4.18 and vice versa, e.g., due to the
method used for defining the end/size of the syscall table.
| I did know how to do it for an older version (2.0.35) :
| - add a line in the file : /usr/src/linux/include/asm/unistd.h
| #define __NR_my_systemcall XXXX (where XXXX is the number
| for my new system call)
|
| - modify the file /usr/src/linux/arch/i386/kernel/entry.S
| - add my system call
| .long SYMBOL_NAME (my_systemcall) at the end of the system callslist
| - modify le last line of the file :
| .space (NR_syscalls-166)*4 <= replace the 166 by 167
That's very close to working.
Here's how I did it for 2.4.18, but like I said above, it won't
apply cleanly to 2.4.8. You'll have to use just a small amount of
gray matter to fix it:
http://www.xenotime.net/linux/syscall_ex/
contains a howto, kernel patch, and test program.
| After this changes, I only needed to recompile the kernel and reboot
| with it... and a user's program could use the new system call...
| But with my new kernel, this manupilation doesn't still work.
You should modify the new syscall number to a value to is not used,
and modify your userspace program to use that new syscall number.
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: system call
2002-07-08 15:16 ` Randy.Dunlap
@ 2002-07-08 23:59 ` Vladimir Zidar
2002-07-09 0:13 ` Keith Owens
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Zidar @ 2002-07-08 23:59 UTC (permalink / raw)
To: Randy.Dunlap, linux-kernel
On Mon, 2002-07-08 at 17:16, Randy.Dunlap wrote:
> http://www.xenotime.net/linux/syscall_ex/
> contains a howto, kernel patch, and test program.
And how to choose goot syscall number ? Are some numbers pre-reserved
to 'private' syscalls ? What numbers are free to use, without fear that
new kernel release will just jump over them !?
And what about an idea to be able to add syscall by name, from loadab;e
module of course. Userland application will then resolve 'name' to
number at startup, and use it just as ordinary syscall ?
--
Bye,
and have a very nice day !
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: system call
2002-07-08 23:59 ` Vladimir Zidar
@ 2002-07-09 0:13 ` Keith Owens
0 siblings, 0 replies; 4+ messages in thread
From: Keith Owens @ 2002-07-09 0:13 UTC (permalink / raw)
To: linux-kernel
On 09 Jul 2002 01:59:42 +0200,
Vladimir Zidar <vladimir@mindnever.org> wrote:
>On Mon, 2002-07-08 at 17:16, Randy.Dunlap wrote:
>> http://www.xenotime.net/linux/syscall_ex/
>> contains a howto, kernel patch, and test program.
>
> And how to choose goot syscall number ? Are some numbers pre-reserved
>to 'private' syscalls ? What numbers are free to use, without fear that
>new kernel release will just jump over them !?
> And what about an idea to be able to add syscall by name, from loadab;e
>module of course. Userland application will then resolve 'name' to
>number at startup, and use it just as ordinary syscall ?
http://marc.theaimsgroup.com/?t=100902098800001&r=1&w=2. There were
alternative patches going around, primarily from Benjamin LaHaise.
Linus did not want any of the patches.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-07-09 0:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-08 10:15 system call Bruno Pujol
2002-07-08 15:16 ` Randy.Dunlap
2002-07-08 23:59 ` Vladimir Zidar
2002-07-09 0:13 ` Keith Owens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox