Project mysyslog: Adding a syscall

by: burt rosenberg
at: university of miami
date: sep 2016
This is how to add a system call to the Linux kernel, as of the date of this writing.

The central change is adding to the syscall table. Coordinating changes must be made in the syscalls header file.

The additions to the syscall table are function pointers. We implement the functions in a new file, kernel/mysyscalls.c, and modify a Makefile to instruct the kernel build to compile and incorporate the new file into the kernel.

Three existing files in the kernel source tree are modified, and one file is added. The file is a hyperlink to the file. I have shown additions in red.

Note that in different editions of csc421, not all the additions in red will be needed, or will be asked for initially. It does not hurt to include them all, just as long as you have just a minimal function in mysyscalls.c and mysyscalls.h so that the kernel can compile.

d: linux-source-4.4.0
|
+--- d: arch
|    |
|    +--- d: x86
|         |
|         +--- d: entry
|              |
|              +--- d: syscalls
|                   |
|                   +--- f: syscall_32.tbl
|
+--- d: include 
|     |
|     +--- d: linux
|          |
|          +--- f: syscalls.h
|
+--- d: kernel
     |
     +--- f: Makefile
          f: mysyscalls.c (this file is added)
          f: mysyscalls.h (this file is added)
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

author: burton rosenberg
created: 14 sep 2015
update: 27 sep 2020