wiki:Dev/KernelHack/COINS/worklog/201111

Version 2 (modified by mitty, 12 years ago) (diff)

--

11/02

informative system calls

  • kernel/sys.c
    • sethostname, gethostname
    • about copy_to_user/copy_from_user
  • kernel/hrtimer.c
    • nanosleep
    • about timespec
  • kernel/posix-timers.c
    • clock_gettime
    • about timespec
  • kernel/module.c
    • delete_module
    • about strncpy_from_user
  • kernel/printk.c
    • about __LOG_BUF_LEN/access_ok

testing new_debug syscall

  • windell57:i386 s0711489$ make -j2
    Kernel: arch/x86/boot/bzImage is ready  (#3)
    
  • s0711489@ubuntu-lucid:~$ sudo /mnt/hgfs/tools/install.sh
  • s0711489@ubuntu-lucid:~$ sudo reboot
  • s0711489@ubuntu-lucid:~$ cat > new_debug-sys.c
  • s0711489@ubuntu-lucid:~$ gcc -I /lib/modules/2.6.35.14/build/arch/x86/include/ new_debug-sys.c
  • s0711489@ubuntu-lucid:~$ ./a.out
    new_debug()
    
  • s0711489@ubuntu-lucid:~$ dmesg | tail -n 2
    [    6.833440] dhclient3 used greatest stack depth: 5560 bytes left
    [  579.378377] new_debug()
    
  • s0711489@ubuntu-lucid:~$ ./a.out hoge fuga piyo
    [-570566464.-1216585740] hoge
    [0.000000000] fuga
    [0.000000000] piyo
    
  • s0711489@ubuntu-lucid:~$ dmesg | tail -n 5
    [    6.833440] dhclient3 used greatest stack depth: 5560 bytes left
    [  579.378377] new_debug()
    [  596.785236] hoge
    [  596.785274] fuga
    [  596.785282] piyo
    

maybe useful

11/04

  • define as static char __log_buf[__LOG_BUF_LEN] in printk.c
  • sys_clock_gettime uses copy_to_user in its code

Attachments (4)

Download all attachments as: .zip