Rice University logo
 
Top blue bar image
Random notes before using Google Keep
 

Archive for May, 2017


Adding a system call to AArch64 Linux

May 16th, 2017 by mhyun

No more calls.S. It becomes simpler to add a new syscall.

  1. kernel/include/linux/syscalls.h
    Define the syscall:
    asmlinkage long sys_hong(int k);
  2. implement it somewere.c
  3. kernel/include/uapi/asm-generic/unistd.h
    Link the syscall with a number. Don’t forget update __NR_syscalls accordingly.
    e.g.,
    #define __NR_hong 291
    __SYSCALL(__NR_hong, sys_hong)
    #define __NR_syscalls 292