LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-13-2005, 08:58 AM   #1
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
A question about system booting


I have a question about how a linux or Unix box boots.
The bootloader points to the kernel, and the kernel loads.
The root partition is specified as kernel parameter in the boot loader.
Then the kernel loads, utilizes some stuff, mounts the root filesystem (read only in the beginning)and then init (mother of all processes) reads the /etc/inittab to determine what comes next (start up script and the suitable script for the specified runlevel). How does init know that it should read /etc/inittab. Is it hard coded? I tried to grep for inittab in the kernel source tree and nothing appeared. Does the boot loader specify this to the kernel as a parameter, like the root partition? Is it possible to tell the kernel to read another file?

Last edited by perfect_circle; 04-13-2005 at 09:03 AM.
 
Old 04-13-2005, 09:12 AM   #2
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Um, as far as I remember one is calling the other. Try searching for inittab in /sbin/init, I think you'll find it there...
 
Old 04-13-2005, 11:07 AM   #3
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Original Poster
Rep: Reputation: 53
I've been using the init command for years, and still i was looking for inittab inside the kernel.
Actually the path to init is what is hard-coded inside the kernel, in the file /init/main.c in the kernel tree:
Code:
skalkoto@darkstar:/usr/src/linux-2.4.29/init$ grep "/sbin/init" main.c
run_init_process("/sbin/init");
skalkoto@darkstar:/usr/src/linux-2.4.29/init$
And the inittab path is hardcoded inside the /sbin/init file:
Code:
skalkoto@darkstar:~$ grep "/etc/inittab" /sbin/init
Binary file /sbin/init matches
skalkoto@darkstar:~$
thanks for helping me clear this out.
 
Old 04-13-2005, 11:13 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
In case you don't know them yet:

http://axiom.anu.edu.au/~okeefe/p2b/...ower2bash.html
http://www-106.ibm.com/developerwork.../l-config.html
 
Old 04-13-2005, 01:21 PM   #5
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Original Poster
Rep: Reputation: 53
Thanx. I 'll look at them
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
please help me system not booting suguname Mandriva 16 01-22-2005 02:29 AM
system not booting. suguname Mandriva 2 01-20-2005 10:55 AM
system not booting sanjith11 Linux - General 0 02-06-2004 07:00 AM
help me please : system not booting linux_guy2003 Linux - Newbie 8 06-17-2003 04:04 PM
system hanging on booting jmarsh Linux - Networking 1 04-07-2003 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:49 AM.

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