1. System calls are required from user space to kernel space
2. The system call is implemented via the SWI instruction, at which point a parameter is stored in the R7 register to specify the kernel function to invoke.
3. The actual functions of the general kernel State can be implemented in arbitrary. c files, but the corresponding function pointers must be added to the CALL.S (add table entries)
4. Also declare the parameters in the Unistd.h. This parameter is to be stored inside the R7.
5. When the User state interface function implementation, the above parameters should be stored to R7, and then execute the SWI instruction. Finally, when this function is called where this interface function is needed, the function automatically jumps to the kernel space to find the appropriate kernel-state function.
1. Open the kernel code of the/kernel/printk.c file, implement the function in the file SYS_PK ()
Add a new system call to the 2./arch/arm/kernel/calls file
System call number in 3.arch/arm/include/unistd.h file
4. Write the user function, call the PK function
Thematic 8-linux system calls