Linux MIPS Architecture development
 help / color / mirror / Atom feed
* when does "init" become usermode process
@ 2003-02-14 18:01 shenminshi
  2003-02-14 18:29 ` Kip Walker
  0 siblings, 1 reply; 2+ messages in thread
From: shenminshi @ 2003-02-14 18:01 UTC (permalink / raw)
  To: linux-mips

Hi,
  I was reading the kernel boot code toward the end where kernel's init thread execve("/sbin/init",x,x). Execve() calls sys_execve() and do_execve(). All the manpage and kernel document told us the init is the first usermode process running in the system. However, when the execve("/sbin/init",x,x) runs in the kernel (init/main.c), I believe we are still in the kernel mode, aren't we? Unless execve() does the trick to turn init into usermode by setting the KU bit in the STATUS register. I checked the execve() code and its not obvious whether it does this or not. I then check the init source code and it does not mess around the KU bit either.

My question is when and how does init turn itself into usermode.


Thanks

sms

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: when does "init" become usermode process
  2003-02-14 18:01 when does "init" become usermode process shenminshi
@ 2003-02-14 18:29 ` Kip Walker
  0 siblings, 0 replies; 2+ messages in thread
From: Kip Walker @ 2003-02-14 18:29 UTC (permalink / raw)
  To: shenminshi; +Cc: linux-mips

shenminshi@netscape.net wrote:
> 
> My question is when and how does init turn itself into usermode.

Look at 'start_thread' in arch/mips/kernel/process.c, which is called
from load_elf_binary in fs/binfmt_elf.c (as a result of the execve
syscall).

Kip

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-14 18:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-14 18:01 when does "init" become usermode process shenminshi
2003-02-14 18:29 ` Kip Walker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox