
All the files required for the modification of the version string.
How to add a system call in linux kernel update#
Now it is only a matter of updating the copy of the git repository on your local VM and pushing the update up to the GitHub server. You have already initialized and created your git repository early in this project (when you ran the git clone command earlier). If you’ve gotten this far successfully, congratulations, you’ve written your first Linux kernel system call! Submission Instructions If you get an error message from the program (which should usually say “Function not implemented”), make sure that you have made all the changes in the guide properly, built the modified kernel, installed it and rebooted into it before running the test program. The program will print out the success message if the syscall runs correctly, and you should see the “Hello World!” message if you look at the output running the dmesg program as root. So, if the hello system call accepted an argument (with a name, for instance), you would simply add that argument to the list passed there, after _NR_hello.Ĭompile the program with your system C compiler (gcc) and run it. This function-like macro accepts an integer argument to note what system call to perform, along with any number of arguments to pass to the system call. This is done by making use of the syscall macro, provided by the C library. The only interesting part of this code is the part where the system call is called.


Note that if you had a different number for your system call in the previous step (i.e, you’re not using a clean copy of the 5.5 kernel source), then you will need to adjust the _NR_hello line.
