Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-11-2010, 04:49 PM   #1
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, 05:44 PM   #2
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 05:47 PM.
Old 07-11-2010, 05:46 PM   #3
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
...or look at the gazillion docs describing the boot process like
Old 07-11-2010, 06:05 PM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,485

Rep: Reputation: 3455Reputation: 3455Reputation: 3455Reputation: 3455Reputation: 3455Reputation: 3455Reputation: 3455Reputation: 3455Reputation: 3455Reputation: 3455Reputation: 3455
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.



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 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 07:48 AM
Linux boot up process Vs. Windows boot up process darkskull Linux - Software 7 12-30-2006 05:21 PM
Need to install process at end of boot process ch485de Linux - Newbie 5 12-07-2006 06:47 PM
"Starting System Logger" during boot time, stopping boot process. quickNitin Linux - Newbie 1 06-08-2006 02:31 PM
The boot process, need help! kalzanth Linux - Software 10 08-23-2002 06:25 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:31 AM.

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