LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-11-2009, 07:04 PM   #1
Felicia23
LQ Newbie
 
Registered: Jan 2009
Posts: 9

Rep: Reputation: 0
process1 is init,process0 is ?


Thanks guys,continue answering...
In linux,process 1 is called as init,whereas process 0 is called as ?
Thanks
 
Old 01-11-2009, 08:07 PM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Are you related to Marty21 per chance? lol.
 
Old 01-12-2009, 06:18 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
When Linux/Unix starts up, one-or-more entries are "manually created" in the process table. Implementations vary (Unix, Linux, OS/X...), but the essential idea is the same: a certain number of user-land processes "appear, as if by magic" (well, it is "magic"...), and they (are required to...) exist for as long as the computer itself is "up."

(In Linux, if "process #1," a.k.a. init, ever dies, for any reason, you immediately get the slightly-incorrect kernel panic, "attempted to kill init." Well, nobody killed it, per se, but "it is not allowed to die.")

Now... "why would we ever want to do such a thing?" The answer, actually, is elegance, but the reasons might not be entirely obvious unless you have spent some time designing operating systems.

If you haven't, (and I shall presume that you have not...) then let me just say that "kernel-space code is in rather an awkward spot." The kernel's job is to create the environment in which "user space" code runs, but because of that very-special status, it can never live "in userland." And, in a general sense, it can never trust anyone who "lives there." (No, not even the processes that happen to be running as root!)

Well... to make a very long story very short, "these very-special userland processes" are trusted. They are "trusted," in fact, to a degree that no other user-land process is ... bar none. They perform roles that are absolutely as much "part of 'the kernel'" as "the kernel itself" is, except for the fact that they are not, by definition, part of the kernel.

The role of init, the "'process #1' of any Linux system," can be succintly defined as follows:
  1. If any process 'dies' when its parent has already died, "init" will reap it.
  2. All 'daemon' processes are spawned by init at system startup, and if any of those processes subsequently die, init alone decides "what to do."
Is that "role" ... like ... huge? Uh huh, yes it is. To the degree that "Linux cannot survive without it." To the degree that, "Linux must (and will...) 'roll over and die immediately' if nobody in user-land can fill that role."

Some Unix-derivative systems, like Apple's OS/X (Darwin...) define more-than-one process to act in these uber-privileged roles. Any way that you slice it, "it is an utterly amazing, utterly elegant hack" that has survived since the 1970's ... when it was the death-knell to the utterly over-engineered Multics system.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernal panic no init found try passing init option to kernel m2azer Linux - General 3 11-08-2007 01:51 PM
Kernal Panic: No init found. Try passing init= option to kernel raees Linux - General 12 03-18-2004 11:10 PM
error: No init found. Try passing the init= option to the Kernel neylitalo Linux - Laptop and Netbook 3 01-22-2004 09:34 PM
error "Kernel panic: No init found. Try passing init= option Anauj0101 Linux - Newbie 3 05-06-2003 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration