LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 01-01-2012, 08:55 PM   #1
anandg111
Member
 
Registered: Jan 2012
Posts: 56

Rep: Reputation: Disabled
Unhappy How the bootloader gets called by machine


Hi everyone,

I want to know that how the bootloader gets called by when we start the machine and what happens next.
what is the initial progam that runs when machine gets start?
I heard that linux loads the programs which needs at that time so at the initial stage of booting system how that program works without having any compiler to compile it ?
 
Old 01-01-2012, 09:19 PM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 191Reputation: 191
http://en.wikipedia.org/wiki/Linux_startup_process
Google is your friend.
 
1 members found this post helpful.
Old 01-01-2012, 09:24 PM   #3
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 50
There is a booting process link in IBM website and it is well good to learn in detail about Linux Booting process.

http://www.ibm.com/developerworks/library/l-linuxboot/
 
1 members found this post helpful.
Old 01-01-2012, 09:24 PM   #4
anandg111
Member
 
Registered: Jan 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Thanks.
 
Old 01-03-2012, 06:05 AM   #5
grahamatlq
Member
 
Registered: Dec 2006
Posts: 40

Rep: Reputation: 18
Vectors to instructions starting at zero

The simple answer is that that machine runs instructions starting at zero in the RAM or ROM.

I deal with embedded systems and have dealt with this many times.

Usually a section of FLASH ROM gets mapped to be addressed from 0x00000000.
The machine then sets the PC to 0x00000000 and loads this instruction into the processor pipeline which gets executed.
This is incremented and the next instruction is loaded and so on.

At some point in the bootloader code the bootloader is swapped out and the linux kernel is loaded into RAM.

I believe in Von Neuman architecture (standard PC) the bootloader is the "BIOS" which then loads the "bootloader" from whichever medium to RAM, runs it then swaps out of the low address space to leave this running.

This loaded "bootloader" then loads the kernel, etc and runs it.

HTH, Graham.

Last edited by grahamatlq; 01-03-2012 at 06:07 AM.
 
2 members found this post helpful.
Old 01-03-2012, 11:32 AM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Since you haven't specified the architecture, and since you've posted in the Embedded forum where we expect many different architectures, it is impossible to provide specific details. On some architectures, the bootloader is read from bootable spinning media, while on other architectures it will be started directly from ROM mapped to the CPU's reset vector. Other variations also exist, among which is the possibility of direct-loading linux kernels.
--- rod.
 
Old 01-03-2012, 04:59 PM   #7
syko4MT@gmx.com
LQ Newbie
 
Registered: Dec 2010
Location: Hamilton MT.
Distribution: Ubuntu11.04, Mint11, Mint12
Posts: 7

Rep: Reputation: Disabled
If I get what your asking...

Linux on PC's:
distro's vary but the basics are:
BIOS loads the bootloader (ex. GRUB v?). Grub then looks for file init.conf, which then becomes process #1. init.conf contains the "list" of processes required for Linux to then "boot up". (Ubuntu is changing the init.conf file to a 'newer/more options' system called upstart.)

For more specifics, blue_print's comment to check out IBM devWorks is terrific. They have great Linux info on wide variety of subjects, as well as LPIC study aids that should be read by all users.

Hope This Helps,
 
1 members found this post helpful.
Old 01-03-2012, 05:13 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860
Quote:
Originally Posted by syko4MT@gmx.com View Post
If I get what your asking...

Linux on PC's:
distro's vary but the basics are:
BIOS loads the bootloader (ex. GRUB v?). Grub then looks for file init.conf, which then becomes process #1. init.conf contains the "list" of processes required for Linux to then "boot up". (Ubuntu is changing the init.conf file to a 'newer/more options' system called upstart.)
Sorry, but this is horribly wrong. The BIOS invokes the basic hardware functions and the loads the bootloader from disk and starts it. The bootloader will load the kernel (according to its configuration or after displaying a menu for choice) and if needed/configured so the initial ramdisk (initrd) from the disk. After this is done the bootloader starts the kernel and handles control to it. The kernel initializes the hardware (which has inbuilt drivers) and then starts the init process (which actually doesn't have to be init, it can also be something like systemd or upstart, IIRC), either from the initrd or from the specified root partition. The init process then handles thinks like loading kernel modules, mounting disks, starting services and login shells and, if configured that way, the graphical system.
 
Old 01-03-2012, 07:42 PM   #9
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Just to confirm what TobiSGD has said, there is a lot of misinformation being propagated here.

And, to add to his comment, in most cases on PC architecture, the bootloader is loaded by the BIOS from spinning media or other local media (such as USB flash disk). It may also be loaded via a network using a DHCP extension (PXE), and once the PXE bootloader starts, typically loads the kernel & initrd from a TFTP server. The bootloader gets loaded into memory by the BIOS running in real mode. The real-mode bootloader then (optionally) loads an initrd into memory, loads the a Linux kernel into memory, and then jumps to the Linux ELF format kernel entry point. Early in the kernel's initialization, the CPU is switched to protected mode, drivers are initialized, filesystems are mounted, and the init process, as specified as an argument to the kernel or built into the kernel, is loaded and launched as PID #1. The init process can be any statically linked executable in the filesystem. A bootloader may also load another bootloader; a process known as chainloading, and Grub and Lilo use this method to load Windows bootloaders.

If this is about PC's, it probably doesn't belong in the Embedded forum.

--- rod.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to start Grub2-bootloader from extlinux-bootloader? floppy_stuttgart Linux - Newbie 13 11-13-2011 07:43 PM
[SOLVED] grub as bootloader on partition within vmware virtual machine poly_s Linux - Virtualization and Cloud 5 11-12-2011 06:39 AM
[SOLVED] Destructor called on objects in deque without it being called explicitly Snark1994 Programming 4 07-13-2011 09:05 AM
Windows 2000 Bootloader vs. Mandriva LILO Bootloader Dregnan Mandriva 7 12-03-2007 10:55 PM
How can I disable the grub bootloader and enable the lilo bootloader? abefroman Linux - General 1 08-06-2005 09:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 01: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration