title: Error syscall : Function not implemented
body: <p>I'm trying to add new (dummy) system call to linux kernel. </p>
  
  <p>1) I added the system call code under linux-source/kernel/myfile.c and updated the Makefile accordingly.</p>
  
  <p>2) Updated syscall.h, unistd.h and entry.S files to reflect the new system call (pedagogictime(int flag,struct timeval *time))</p>
  
  <p>Then compiled the kernel and installed and rebooted the image. </p>
  
  <p>When I run: <code>cat /proc/kallsyms | grep "pedag"</code>, this is the output I'm getting</p>
  
  <p>0000000000000000 T sys_pedagogictime
  0000000000000000 d event_exit__pedagogictime
  0000000000000000 d event_enter__pedagogictime
  0000000000000000 d __syscall_meta_<em>pedagogictime
  0000000000000000 d types</em>_pedagogictime
  0000000000000000 d args__pedagogictime
  0000000000000000 t trace_init_flags_enter__pedagogictime
  0000000000000000 t trace_init_flags_exit__pedagogictime
  0000000000000000 t __event_exit__pedagogictime
  0000000000000000 t __event_enter__pedagogictime
  0000000000000000 t __p_syscall_meta__pedagogictime
  0000000000000000 t __initcall_trace_init_flags_exit__pedagogictimeearly
  0000000000000000 t __initcall_trace_init_flags_enter__pedagogictimeearly</p>
  
  <p>which means the system call is registered correctly.</p>
  
  <p>In my user space program, I'm writing:</p>
  
  <pre><code>#define __NR_pedagogictime 1326 //1326 is my system call number
  struct timeval *now = (struct timeval *)malloc(sizeof(struct timeval));
  
      long ret = syscall(__NR_pedagogictime,0,now);
      if(ret)
              perror("syscall ");
  </code></pre>
  
  <p>But I'm getting the error: </p>
  
  <p>"syscall : Function not implemented"</p>
  
  <p>I would really appreciate any help about this. Thanks.</p>
  
  <p>Edit:</p>
  
  <p>Btw, the assembly code for the syscall() looks like this (if it helps):   </p>
  
  <pre><code>    movl    $6, %esi
      movl    $1326, %edi
      movl    $0, %eax
      call    syscall
      cltq
  </code></pre>