Enabling and disabling system calls



Hello,

In my current research about how to write system calls I found myself
stuck again. After reading a little bit about the kernel, and the
actual code I found out how to make the system calls (or at least one
way to do it).

What I do is that I edit the syscall_table.S, located at
arch/i386/kernel (all paths I'm going to say is relative to the kernel
root), and write ``.long sys_mysyscall'' at the end of the table. I then
create a mysyscall.c on that same directory, where I define my system
call. I add it to the Makefile on the obj-y variable. After that I add
__NR_mysycall defined as a new number and I increment NR_syscalls on
unistd.h. Then I compile the kernel and my system call seems to work.

I understand how to create a new entry to Kconfig that would make my
system call be compiled into the kernel or not. I know even how to make
the Makefile not compile the mysyscall.c if the option is not selected.
But my problem is that the system call is still declared on the
syscall_table.S file. Is there another place to declare my system call?
Am I missing something?

Thank you for your attention,
Rafael
.



Relevant Pages

  • Re: Kbuild Makefile output
    ... Now I have created single makefile to compile all this ... But now the problem is lots of file included in kernel ... Previously in 2.4 we use to put all output object file ...
    (Linux-Kernel)
  • Re: Compiling ftape modules
    ... >suitable Makefile for the temp directory. ... Then I created the ftape directory ... This is very similar to what was happening when I was trying to compile "in ... modules and the kernel as installed in the FC3 release? ...
    (Fedora)
  • Re: Distributions
    ... | general there are a lot of packages for people to use. ... kernel, have to run on a multitude of different systems, they tend to be ... and slower than if you compile those packages, ... can have that stability with virtually any distro. ...
    (Debian-User)
  • Re: Distributions
    ... Ubuntu is based on Debian, ... | general there are a lot of packages for people to use. ... kernel, have to run on a multitude of different systems, they tend to be larger ... and slower than if you compile those packages, ...
    (Debian-User)
  • Problems with custom kernel fbsd 6.2
    ... My kernel for freebsd 6.2 is not compiling but only with my custom config. ... I was able to compile it with the GENERIC kernel included, but my modified one will not compile. ... # Power management support ...
    (freebsd-questions)