I am very new to this kernel thing. What I want to do is just add a new system call to the kernel. I was following this guideline: http://hekimian-williams.com/?p=20.
The problem is there used to syscall_table_32.S file under arch/x86/kernel, but I cannot find the file for x86 systems in kernel version 3.3. Do I still need to edit the file and append one more line for the newly added system call? Or do I need to do something else to let the kernel know about my new system call? Any help will be appreciated. Thank you.
I think in kernel 3.3 its shifted here
http://lxr.free-electrons.com/source/arch/x86/syscalls/
How to add a new Linux kernel API in 3.3 version? -- for 64 bits OS
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.3.1.tar.bz2
Upzip it with command ‘tar xvfj XXX” to a folder For example : /root/kernel tar xvfj linux-3.3.1.tar.bz2
Edit file “/root/kernel/linux-3.3.1/arch/x86/syscalls/syscall_64.tbl” Add new line
312 64 husky1 sys_husky1
asmlinkage long sys_husky1(int fd);
before the line “#endif”
Add a new c file under “/root/kernel/linux-3.3.1/arch/x86/kernel” (I am using x86 CPU) Example :
Edit “/root/kernel/linux-3.3.1/arch/x86/kernel/Makefile” Add a new line “obj-y += husky.o”
goto /root/kernel/linux-3.3.1 folder and run command “make –j8”
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With