After adding the system call to kernel I tried to compile the kernel.
It ran for 2 hours and at the end threw
undefined reference to <system call added by me>

Any idea what had happened.
Kernel 3.9.3
Steps followed are –
Get kernel codes from www.kernel.org.
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.3.1.tar.bz2Upzip it with command
tar xvfj XXXto a folder example :/root/kernel tar xvfj linux-3.3.1.tar.bz2Edit file
/root/kernel/linux-3.3.1/arch/x86/syscalls/syscall_64.tbland add new line312 64 husky1 sys_husky1Edit file
/root/kernel/linux-3.3.1/include/linux/syscalls.hAdd new function before the line#endifdeclarationasmlinkage long sys_husky1(int fd);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/MakefileAdd a new lineobj-y += husky.oGo to
/root/kernel/linux-3.3.1folder and run commandmake –j8
Advertisement
Answer
Search your syscall_64.tbl file for “sys_hello_rana”. I am guessing you named your syscall as “sys_hello_rana” in syscall table but you used a different name(sys_husky1) when you defined it.