2003-01-12 00:31:51

by Hall, Luca

[permalink] [raw]
Subject: System Call Problem

Hello I have a small problem with a new sys call:

Slackware 8 , Kernel 2.2.19
tring to add a system call i did:

/usr/src/linux/kernel/luca.c

#include <linux/luca.h>
#include <linux/kernel.h>

asmlinkage int sys_luca(void){
printk("my call in the kernel\n");
return(555);

}

/usr/src/linux/include/linux/luca.h

#ifndef __LINUX_LUCA_H
#define __LINUX_LUCA_H

#include <linux/linkage.h>
#include <linux/unistd.h>

_syscall0(int,luca)

#endif

/usr/src/linux/include/asm-i386/unistd.h

added: #define __NR_luca 191

/usr/src/linux/arch/i386/kernel/entry.S

added: .long SYMBOL_NAME(sys_luca)
changed from 190: .rept NR_syscalls-191

compiled with make dep, make bzImage

The problem is now that when I boot i see the printk messages at the
bottom. around 5 - 7 times.
When I log in I see the printk messages, and dmesg also. I checked many
resources and cant seem too find what I'm doing wrong; why is my funct being
called at boot time and
login ?

thanks alot
luca


2003-01-12 00:55:18

by Robert Love

[permalink] [raw]
Subject: Re: System Call Problem

On Sat, 2003-01-11 at 19:38, Hall, Luca wrote:

> The problem is now that when I boot i see the printk messages
> at the bottom. around 5 - 7 times.

You took the syscall number for getrlimit(2).

You cannot just arbitrarily pick a syscall number, it needs to be a new
and never-before-used number.

Look in include/asm/unistd.h and add your number to the bottom.

Robert Love