Ubuntu 18.04 kernel system call to add linux-5.0.4

(Virtual Machine) on Ubuntu 18.04 kernel system call to add linux-5.0.4

1. https://www.kernel.org/ download the Linux kernel
and moves to the ** / usr / src folder and unzip
unzip command: sudo-5.0.4.tar.xz the xz -d Linux
sudo tar -xf Linux -5.0.4.tar.xz
**

After the extraction is completed:
the kernel
cd /usr/src/linux-5.0.4
Here Insert Picture Description
enter the kernel file
1./arch/x86/entry/syscalls/syscall_64.tbl increase system call number
to call 335 for me to add
Here Insert Picture Description
2.include /linux/syscalls.h increase the header file system calls

Here Insert Picture Description
3. Note here the difference with the previous version of the kernel to write /kernel/sys.c to define different system call
system call first added time did not notice the difference between the return value of a program leading to the final random number
Here Insert Picture Description

After the implementation of make menuconfig to enter the graphical interface may be errors which can not be carried out according to package prompts directly sudo apt-get install xxx missing

Then execute sudo make -j4 began to compile the kernel package to install what is missing after j greater number represents the number of digital core, the faster compile virtual machine about four hours a core 4-core fast 30 minutes

Here Insert Picture Description
After the kernel has finished compiling: sudo make modules compile
Here Insert Picture Description
sudo make modules_install install just generated modules
Here Insert Picture Description
installed just Mark sudo make install Here Insert Picture Description
here compiled restart to call the new function!
After rebooting
write a test to test

Here Insert Picture Description
Test Run

Here Insert Picture Description

mission completed! Keep your own written after backup hhh

Released nine original articles · won praise 4 · Views 4251

Guess you like

Origin blog.csdn.net/qq_42239081/article/details/88850637