Skip to contentSkip to conversation

question : is the init process of kernel running in kernel space or user space?

DISCUSSION Tomko 2 participants 2 messages Apr 18, 2005

lore
Share & tools
lore

Tomko

author
#0 lore raw

Hi all,

In the linux system , kernel is often starting up like this :

bootloader -> start_32() -> start_kernel() -> init()

i would like to ask what is the piority level in this starting procedure ? 0 or 3 ? that means, this start up process are running in kernel space or user space ? or the level is keep changing ? If it is in kernel space from the very beginning , at which point the system is switched into user space ? is it at the time when kernel open the shell ?

I am new to linux, hope someone can help me here.

Regards,
TOM

#1 lore raw
Quoted 4 lines · Tomko

Hi all,

In the linux system , kernel is often starting up like this :

Quoted 9 lines

bootloader -> start_32() -> start_kernel() -> init()

i would like to ask what is the piority level in this starting procedure ? 0 or 3 ? that means, this start up process are running in kernel space or user space ? or the level is keep changing ?
If it is in kernel space from the very beginning , at which point the system is switched into user space ? is it at the time when kernel open the shell ?

All the above functions you mentioned are running in kernel space. The point that init switches to user space is at the bottom of the init function, when it calls run_init_process, which calls execve. Which is the same execve that a user program calls, and at that point the execve would switch the process to a user space program, usually /sbin/init.

Also, the term priority is somewhat ambiguous. The priority level of a task in linux is defined as the strength it has in respect to other tasks when it comes down to scheduling. I understand you are talking about the x86 level that a process runs in (kernel or user) but not all architectures use that, and linux is a multiple architecture OS.

-- Steve