Re: Linux boot question



On Sun, 21 Jan 2007 06:55:33 -0800, dspfun wrote:

Question:
How come the bioses always are able to read the hard drives? I.e. load
the MBR (first stage boot loader) and the second stage boot loader from
the hard drive.

Because the bios is written to support the particular disk controller that
is fitted to that particular motherboard.

How can the bios have support for (be able to read/write) the hard drive
controller and the hard drive file system?

The bios knows nothing of filesystems, boot sector into ram, then run it,
that is a simplified model of what the bios does. This all happens in real
mode (X86), the first stage bootloader then uses a set of bios calls to
cause the real mode bios to load a few other sectors whose locations have
been patched into the first sector (Still no file system as such), which
the first stage loader then runs. This second stage loader then does some
magic,loads the kernel and its ramdisk and then calls the kernel entry
point.

The kernel then does some setting up, switches to protected mode, then
relocates itself, loads modules from the ramdisk, then calls pivot_root to
mount the real root device on /. Finally, init is called and the boot
scripts take the system the rest of the way.

The bios mus have
support for reading the hard drive since the bios loads the MBR from the
hard drive to ram, as well as the second stage boot loader from the hard
drive to ram. What is the problem for the linux kernel to have the same
support that the bios software has?

A 16 bit real mode bios is not a lot of use to a 32/64 bit kernel. It
cannot address all the memory, and so cannot load things where they need
to go, hence why the kernel relocates itself early in the proceedings.

Why is a ramdisk containing appropriate drivers for the hard drive
needed for the linux kernel?
Wouldn't it be possible for the linux kernel to use the services
provided by the bios to access the hard drive?

Possible? Sure. Worth it? Not a chance.

I guess the answer is that all computers have custom made bioses for
specific hard drive controllers residing on that motherboard and the
bios only supports common file systems.

The bios does not support any filesystems! That is purely an operating
system issue.

Regards, Dan.
.



Relevant Pages

  • Re: My troublesome P5W DH De Luxe boards
    ... The last problem I recall appeared to be the floppy controller failing, but I couln't pin that down definitely, as I might have got the power connector the wrong way round. ... Not to mention a lot of data on the hard drives that I would like to access or recover. ... Power light comes on on the board, CPU and video card fans both spin up, but can't get into BIOS and see no video. ...
    (alt.comp.periphs.mainboard.asus)
  • Re: Multi-Boot Question...
    ... > use the BIOS to switch between the two, ... >>> Install the drive into the tray. ... computerwith removable hard drives holds enormous ...
    (microsoft.public.windowsxp.general)
  • Re: Boot stops at countdown
    ... Thanks for the responses Ernie I will work on them tonight. ... By hardware I take it you mean the parts inside the tower, ... am working off 2 seperate towers and 2 seperate hard drives. ... you may have to make a change in bios to boot from the cd. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Boot stops at countdown
    ... By hardware I take it you mean the parts inside the tower, ... am working off 2 seperate towers and 2 seperate hard drives. ... you may have to make a change in bios to boot from the cd. ... You are looking for a line such as boot order or boot sequence. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Boot stops at countdown
    ... By hardware I take it you mean the parts inside the tower, ... am working off 2 seperate towers and 2 seperate hard drives. ... you may have to make a change in bios to boot from the cd. ... You are looking for a line such as boot order or boot sequence. ...
    (microsoft.public.windowsxp.help_and_support)