LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2010, 03:49 PM   #1
falconite
Member
 
Registered: Jul 2010
Posts: 42
Blog Entries: 1

Rep: Reputation: 16
Boot process


In an interiew, I was asked to explain about the boot process. So I did tell 'em from start to finish.

I told 'em that once the Grub is loaded onto memory, it reads the /boot/grub/grub.conf file for kernel and initrd image info. once kernel is loaded on memory, it starts the init process.

But the interviewer said that from the Grub loading onto memory and the init process starting, there are a lot of steps that have been skipped.

Can anyone tell me where did I go wrong?

Also, if the kernel info in /boot/grub/grub.conf file is just a virtual image(VMLinuz), then where is the actual kernel info?
 
Old 07-11-2010, 04:44 PM   #2
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
Yeah, you actually skipped some important steps. The grub.conf file contains the filename of the kernel image and optionally the name of an initial ramdisk. First the kernel image is loaded into memory. After that the initrd is also put to memory. Then on x86 architectures the header of the kernel image is analyzed and the 16 bit startup code is executed (arch/x86/boot/header.S). This will prepare the machine for switching to protected mode (arch/x86/boot/main.c): Prepare memory, copy boot parameters, such as command line or initrd addresses, then CPU is switched to protected mode (arch/x86/boot/pm.c) and the internal kernel structures get initialized (arch/x86/kernel/setup.c). After that the external hardware will be initialized: Setting up the PCI bus and other subsystems. When this is done, the root file system is mounted (either from the root= option or from some hardcoded default value). After having done this, the init process is searched for (usually /sbin/init or init= value), loaded into memory and then executed. What follows depends on the init-configuration.

This description was x86-based, but the boot process is similar on other architectures. Maybe you want to look at init/main.c, especially at the start_kernel() function for details and /sbin/init gets loaded in the function init_post() in init/main.c

Last edited by irmin; 07-11-2010 at 04:47 PM.
 
Old 07-11-2010, 04:46 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
...or look at the gazillion docs describing the boot process like http://www.ibm.com/developerworks/li...y/l-linuxboot/.
 
Old 07-11-2010, 05:05 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
<rant>
And why is all that detail relevant to the majority (say 99%) of the Linux user community - sysadmins included ?.
Even people who want to start writing (simple) kernel modules don't need to know much more than the OP answered.

Sure some people like the detail, sure some (very few) need it.

What about reading a disk file ?. Do you need to know about how the kernel structures map to functions at the VFS layer so that block device drivers can resolve the appropriate inode(s) ?.

Bah humbug.

</rant>
 
  


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
Boot with 'acpi=no'-Ubuntu shows one core,normal boot-kacpid process is eating 70%CPU WebEyeX Ubuntu 5 05-18-2008 06:48 AM
Linux boot up process Vs. Windows boot up process darkskull Linux - Software 7 12-30-2006 04:21 PM
Need to install process at end of boot process ch485de Linux - Newbie 5 12-07-2006 05:47 PM
"Starting System Logger" during boot time, stopping boot process. quickNitin Linux - Newbie 1 06-08-2006 01:31 PM
The boot process, need help! kalzanth Linux - Software 10 08-23-2002 05:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:11 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