首先在unistd.h中有系统调用编号,然后再linux1.0版本中在kernel/sys_call.S中有如下代码:
_system_call: pushl %eax # save orig_eax SAVE_ALL movl $-ENOSYS,EAX(%esp) cmpl _NR_syscalls,%eax jae ret_from_sys_call movl _current,%ebx andl $~CF_MASK,EFLAGS(%esp) # clear carry - assume no errors movl $0,errno(%ebx) movl %db6,%edx movl %edx,dbgreg6(%ebx) # save current hardware debugging status testb $0x20,flags(%ebx) # PF_TRACESYS jne 1f call _sys_call_table(,%eax,4) movl %eax,EAX(%esp) # save t......
阅读全文