Re: doubt regarding partition table and bootloader

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




thank you  luca, arshad, adam for participating in the discussion and correcting my concepts.  thanks a lot!!.. :)

 I have one more doubt, as the primary boot loader transfers control to the 1.5 staged boot loader located just after the end of MBR, which (1.5) loads the secondary boot loader.

My doubt is--
           How does the 1.5 staged boot loader know the exact location of the secondary boot loader on the device.Does it reads the partition table to know the location on the device drive, if yes then, if the partition table contains more than one active partition then how does the 1.5 boot loader decides which active partition has the secondary boot loader.

thanks
Raja Roy

 

On Mon, Jun 28, 2010 at 3:22 AM, luca ellero <lroluk@xxxxxxxxx> wrote:
arshad hussain ha scritto:

On Mon, Jun 28, 2010 at 3:40 AM, raja roy <raja.roy84@xxxxxxxxx> wrote:
 
Hi All,
     I was trying to understand the booting steps,

 BIOS loads the first sector (MBR) of a bootable device(considering disk
only) in RAM (0000:7c00)and then jumps to that addr to execute the primary
boot loader which in turn loads the secondary boot loader(grub) pointed to
by an active partition in the partition table.
   

Expanding it a little...

Under x86 Architecture, BIOS starts executing at fff0, that is
one paragraph less than 65535. Here its still in real mode. After
the BIOS does its 'stuff' , the last instruction executed by BIOS
is int 0x19 which causes it to jump to  7c00 where it starts executing
code.  This code is responsible for loading the operating system or
the kernel.

Now, the primary and the secondary boot-loader you mention
are the same. Grub in this case. Its only because there is just
500 bytes (taking away 55AA) to execute. This 500 bytes
is sometimes (most of the time actually) very less to put in
substantial amount of code to boot load any Kernel. Grub uses
this to jump to stage1.5 and then stage2 to completely load
any kernel.

 
 If i m wrong above,please correct me.

 Now my doubt is that-

If the partition table has multiple active partitions(in case of multiple
OS) , in that case, are those other partitions are read by the primary boot
loader ,if yes then when??
  how does the secondary boot loader(grub) come to know about the various
active partitions in the disk (since it does not read the partition table in
MBR)??
   
Grub (any modern bootloader)does not care about
active partitions. Once grub is installed you have to
register ( let grub know, if not done automatically)
where all your multiple OS are in the disk. It is not
true grub does not read partition table, once you do
something like (hd0,0) it know about first partition
'start / end ' by going through partition table.

There is also new version of grub. Which they say is very scriptable.
Not tried that though.


 
Trying to explaining a little further the good Arshad's job.
Grub also have cognition of filesystems through his Stage1.5 (something that LILO didn't have). So it can read a configuration file (usually /boot/grub.menu.lst) where all options are listed and boot the operating system(s) accordingly.



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux