Change kernel suffix
sys_hello
sys_revstr
Step 1: Download and Extract the Linux kernel source code
Step 2: Install essential tools and libraries required for compiling the kernel
Step 3: Copy current kernel config file, then set it as default configuration
Step 4: Modify the config file
Find CONFIG_LOCALVERSION
change value to -os-312551002
Step 5: Compile the kernel (wait 20~50 mins)
Step 6: Install the kernel modules
Step 7: Update GRUB, the bootloader
Step 8: Reboot the system
Press Esc button when system boot > Advanced options for Ubuntu > choose Linux 5.19.12-os-312551002
to start
Step 9: Check the running kernel version
The screenshot of changed kernel suffix
sys_hello
For the implementation of the sys_hello system calls, I modified 4 kernel source files and added 1 new C code to verify if the system calls work correctly. The modified and added files are:
Step 1: In the sys.c file, add the following code to defines a new system call named "hello".
Step 2: In the unistd_64.h file, add the following code to defines the system call number for "hello".
Step 3: In the syscall_64.tbl file, add the following entry to map system call number to its corresponding function.
Step 4: In the syscalls.h file, add the following code to add the new system call in the header file.
Step 5: Create new C code file named sys_hello.c and add the following code:
Step 6: Rebuild the kernel to compile the modified kernel source code.
Step 7: Reinstall the kernel
Step 8: Reboot the kernel
Step 9: Compile the sys_hello.c file to test if the system call operates correctly.
Step 10: Display the output messages produced by the sys_hello system call.
The screenshot of the results of executing sys_hello system call:
sys_revstr
For the implementation of the sys_hello system calls, I modified 4 kernel source files and added 1 new C code to verify if the system calls work correctly. The modified and added files are:
Step 1: In the sys.c file, add the following code to defines a new system call named "revstr".
Step 2: In the unistd_64.h file, add the following code to defines the system call number for "revstr".
Step 3: In the syscall_64.tbl file, add the following entry to map system call number to its corresponding function.
Step 4: In the syscalls.h file, add the following code to add the new system call in the header file.
Step 5: Create new C code file named sys_revstr.c and add the following code:
Step 6: Rebuild the kernel to compile the modified kernel source code.
Step 7: Reinstall the kernel
Step 8: Reboot the kernel
Step 9: Compile the sys_revstr.c file to test if the system call operates correctly.
Step 10: Display the output messages produced by the sys_ revstr system call.
The screenshot of the results of executing sys_ revstr system call: