rebuilding/installing kernel with new system call

rebuilding/installing kernel with new system call

Post by KAB » Mon, 22 Oct 2001 21:31:20



I just installed linux for the first time so that i could play around
with an operating system for which i had the source code (i usually
program under Solaris, which is locked up tight as a drum).

Anyway, i am trying to add a system call for fun. I've registered the
system call number (223) in /usr/src/linux/arch/i386/kernel/entry.S,
added the macro __NR_mycall to linux/include/asm/unistd.h, and added
mycall.c and mycall.h to linux/arch/i386/kernel, (mycall.h has the
_syscall1 macro) and rebuilt/installed the kernel. My call is in the
kernel (i verify that by looking in System.map), and, after much
head banging i tried calling interrupt 80 with my system call number,
and it worked. The problem is i don't have to call int 80 for time,
sleep, waitpid, etc, so i should not need to do that for my call.
The _syscall1 macro is creating a great little int 80 call in the
kernel, where it does me no good. Is there a standard place where i
should put the _syscall1 so that when i rebuild/install the kernel
it will go somewhere in /usr/lib and  /usr/include/sys?
I didn't see an answer to this in the FAQ...

                                        Thanks,
                                                -jim bowmaster

 
 
 

rebuilding/installing kernel with new system call

Post by bdonla » Tue, 23 Oct 2001 07:16:23



Quote:> I just installed linux for the first time so that i could play around
> with an operating system for which i had the source code (i usually
> program under Solaris, which is locked up tight as a drum).

> Anyway, i am trying to add a system call for fun. I've registered the
> system call number (223) in /usr/src/linux/arch/i386/kernel/entry.S,
> added the macro __NR_mycall to linux/include/asm/unistd.h, and added
> mycall.c and mycall.h to linux/arch/i386/kernel, (mycall.h has the
> _syscall1 macro) and rebuilt/installed the kernel. My call is in the
> kernel (i verify that by looking in System.map), and, after much
> head banging i tried calling interrupt 80 with my system call number,
> and it worked. The problem is i don't have to call int 80 for time,
> sleep, waitpid, etc, so i should not need to do that for my call.
> The _syscall1 macro is creating a great little int 80 call in the
> kernel, where it does me no good. Is there a standard place where i
> should put the _syscall1 so that when i rebuild/install the kernel
> it will go somewhere in /usr/lib and  /usr/include/sys?
> I didn't see an answer to this in the FAQ...

the functions you mentioned are in a shared library, and simply call int80
with the syscall number.
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GO/CS d? s? !a c++++ UL+++ P+ L+++ E- W++ N++ o?
K? w--- !O M- V? !PS !PE Y+ PGP? t+ 5? X? !R tv+
b++ DI++++ !D G e* h* !r
------END GEEK CODE BLOCK------