next up previous
Next: Implementation code Up: Adding a System Call Previous: Adding a System Call

Define the entry point

The first thing you need to do is modify the file unistd.h in include/asm/arch. In this file, you need to add a line providing an id for your system call. Locate the bunch of lines of the form:

#define __NR_somename NNN

You need to add a new line, replacing ``somename" with your system call's name. Next, you must add and entry refering to your call in the system calls table. To do this, modify sys_call_table.c file in arch/um/kernel and add a line:

[ __NR_somename ] = sys_somename,

In the same file, you must change the ``LAST_GENERIC_SYSCALL" so that your new system call's id is considered to be within the allowable range.

#define LAST_GENERIC_SYSCALL __NR_somename

Finally, add a declaration for your system call in the area where all the other system calls are defined, as shown on the following line:

extern syscall_handler_t sys_somename;

Having done all these, an attempt to compile the kernel should fail during linking, as the ``sys_somename" function must now be implemented.


next up previous
Next: Implementation code Up: Adding a System Call Previous: Adding a System Call
Alexandros Karypidis 2002-03-25