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

Archive for the ‘Kernel Debugging’ Category

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.
    #define __NR_hong 291
    __SYSCALL(__NR_hong, sys_hong)
    #define __NR_syscalls 292



Old, but still necessary and working docs from IBM

September 23rd, 2013 by mhyun


Change loglevel

August 29th, 2013 by mhyun

echo 3 > /proc/sys/kernel/printk
The number, 3, can be changed.

Android cgroup

August 29th, 2013 by mhyun

/dev/cpuctl –> /apps –> /bg_non_interactive

Diable cpu DVFS

August 29th, 2013 by mhyun

echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

Disable a CPU core

August 29th, 2013 by mhyun

echo 0 > /sys/devices/system/cpu/cpu1/online

Where, ‘cpu1’ can be replaced with ‘cpu0’.