The HyperNews Linux KHG Discussion Pages

## question RE: syscalls on 2.o.x & up

  Forum: How System Calls Work on Linux/i86
  Keywords: syscall system call
  Date: Thu, 09 Oct 1997 10:43:04 GMT
  From: Tim Hockin <thockin@ais.net>

`I have started digging up info on hw syscalls work, and I have been successful. I added my custom sys_ routine, added my __NR_????? to <asm/unistd.h>. My question comes with Entry.S near the end of the file we see: .long SYMBOL_NAME(sys_sched_get_priority_min) /* 160 */ .long SYMBOL_NAME(sys_sched_rr_get_interval) .long SYMBOL_NAME(sys_nanosleep) .long SYMBOL_NAME(sys_mremap) .long 0,0 .long SYMBOL_NAME(sys_vm86) .space (NR_syscalls-166)*4 so sys_mremap is #163. If I add my own syscall as 164 (assuming that was what my __NR_ was #defined to) do I put my own ".long SYMBOL_NAME ..." before or after ".long 0,0"? And then, do I need to change the hardcoded 166 to 167 in ".space ..." ? Anything else I need to do? It seems to work, but I am not 100% sure. All in all, figuring out the assembler was tricky, but this page helped TONS! looking forward to some answers! Thanks Tim Hockin thockin@ais.net`

Messages

1. Where to add the syscall by Michael K. Johnson