From: Erik Andersen (andersen@codepoet.org)
Date: Sun Jan 21 2001 - 22:36:59 EST
On Mon Jan 22, 2001 at 10:24:30AM +0800, Zhu, Yaozong wrote: > Hi Joe, To put my question in another way: can system calls( swi intructions > indeed ) be called by kernel code? It seems that SWI handling code are > written to service USER mode calls. The init may run in USER mode. But clone > system calls must be called from kernel mode code(in start_kernel) to make > init run. Yes. Syscalls can be called from inside the kernel. For example, in init/main.c, do_shell() is run as a kernel thread and runs several syscalls, which it includes from include/asm/unistd.h. This peice of code is, effectively, user space code run by the kernel. Also note these syscalls run as static inlines so they avoid mucking with the stack before exec is called. -Erik -- Erik B. Andersen email: andersee@debian.org --This message was written using 73% post-consumer electrons-- This message resent by the uclinux-dev@uclinux.org list server http://www.uClinux.org/
This archive was generated by hypermail 2.1.4 : Thu Sep 19 2002 - 13:19:27 EDT