64-bit system with Ubuntu 14.04 + new kernel linux-3.14.34
Https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.34.tar.xz
Before using/boot/grub/grub.cfg do not make changes, if you have changed the best to remove the previous changes.
In order to avoid trouble, you need to get root permission.
Execute the following command
sudo su to enter the password as prompted
The process is as follows:
1. First extract the new kernel to USR/SRC;
2. Then use the command, "cd/usr/src/linux-3.14.34", enter the command
sudo vim kernel/sys.c
3. Add the system call function to the end of the file,
For example, my:
asmlinkage int Sys_mycall (char* sourcefile,char* destfile)
{
int Source=sys_open (sourcefile,o_rdonly,0);
int Dest=sys_open (destfile,o_wronly| O_creat| O_TRUNC,0600);
Char buf[4096];
MM_SEGMENT_T FS;
FS = Get_fs ();
Set_fs (Get_ds ());
int i;
if (source>0 && dest>0)
{
Do
{
I=sys_read (source,buf,4096);
Sys_write (Dest,buf,i);
}
while (i);
}
Else
{
PRINTK ("error!");
}
Sys_close (source);
Sys_close (dest);
SET_FS (FS);
return 10;
}
Save
4. Modify the system call table, enter the command sudo vim arch/x86/syscalls/syscall_64.tbl, here because it is a 64-bit system so it should be syscall_64.tbl
Then, add the 64-bit system call number that is not being used, only 64-bit,
317 Common Mycall Sys_mycall
5. Then add the function prototype to the header file, first with the command, sudo vim include/asm-generic/syscalls.h, enter the second line after the file, namely "#endif/* __asm_generic_syscalls_h * *" This line of The above line adds the following content
#ifndef Sys_mycall
asmlinkage int Sys_mycall (char* sourcefile,char* destfile);
#endif
6. Install the ncurses library, this library will be used in subsequent compilations to
sudo apt-get install Libncurses5-dev
7. Then create a script file in the/usr/src/linux-3.14.34 directory,
by command: Vim mycall.sh
Edit, copy the following command:
#!/bin/bash
Make Mrproper
Make Menuconfig
Make DEP
Make clean
Make Bzimage-j9
Make Modules-j9
Make Modules_install-j9
Make Install-j9
Mkinitramfs-o/boot/initrd.img-3.14.34
Update-grub
Reboot
Save again to give the highest privilege, execute command chmod 777 mycall.sh
8. The last step runs the above script,./mycall.sh
In the middle of the configuration of the Linux process, the first save, then OK, then exit, waiting for the computer to restart, automatically enter the new kernel.
This article references: http://www.it165.net/os/html/201404/7764.html
Precautions:
You may not be able to enter the new kernel after #1, and the workaround is not found yet.
#2 compile, you can add multithreaded compilation-j9 and the like, General i5 computer with-J4
Ubuntu 14.04 + Linux 3.14.34 system call for file copy