Re: Boot-up Questions-I.

From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 12/09/04


Date: Thu, 09 Dec 2004 13:03:18 +0100

Uday Mullangi wrote:
>
> Hi,
> 1. What is the typical memory layout used for the bzImage ?

A bit complicated, and I don't know all the details. The first 512 bytes
is a boot record. Prior to 2.6 this could actually be used to load the
kernel from a floppy, that is no longer supported. The image also contains
some decompression code, and finally a compressed image (I think it is
really just a gzip file).

> 2. At what point does the BIOS access the harddisk to get the compressed
> image ?

When the bootloader asks the BIOS to read specific sectors
from the harddisk.

> 3. Which BIOS call(interrupt) is used to get the compressed image from the
> disk

0x13

> and at which location is that image stored?

Depends on the image, zImage and bzImage are loaded on
different addresses.

> 4. Bootloader code starts from 0x7c00.

The boot sector is loaded to that address. The boot sector
decides where the next stage is loaded.

> There is something called kernel bootsector

Obsolete.

> and kernel setup.

AFAIR that is the user mode code used to read various
informations from the BIOS and prepare a nice block with
all the informations, the kernel needs.

> How is it different form bootloader?

The kernel boot sector used to be a primitive bootloader.

> 5. When the kernel uncompresses the image, the uncompressed image will be
> stored at 0x100000. Is that correct?

I think it is.

> 6. In order to uncompress the image, either the bootloader should have this
> facility or it should use the BIOS call which does that job. I believe this
> is usually done using the BIOS call. Which interrupt number is used for this
> purpose?

No, the decompression code is part of the kernel image.

> 7.Before the uncompressed image starts executed, the file system should be
> created. Is that correct?

No.

> Or..Whats the procedure?

The kernel image contains a field specifying which root
device to use (and a few other informations). Unless
overriden by the bootloader, the kernel is going to use
that driver to access the root file system. There are
two ways in which the boot loader can change the root
device, either change that field, or specify another
device in the parameter string.

The boot loader can also load an initial ramdisk to some
address in extended memory, and tell the kernel where to
find it.

When the kernel boots, it will look for this (optionally
compressed) ram disk image. And it will use the driver
in the kernel to access the file systems. You need the
appropriate block device driver and file system driver
in the kernel to successfully boot the system.

-- 
Kasper Dupont


Relevant Pages

  • 2.6.28-rc2: REGRESSION in early boot
    ... I've opened a Kernel Bug to track this regression: ... Essentially, the system panics in early boot, resulting in multiple ... commit d6c88a507ef0b6afdb013cba4e7804ba7324d99a ... # Device Drivers ...
    (Linux-Kernel)
  • Re: Ho to run CF driver before reading hive-based registry
    ... BOOT SECTION": ... so I had to rewrite the driver for it. ... The problem is now the hive-based registry. ... FileSystem Starting - starting with clean file system ...
    (microsoft.public.windowsce.platbuilder)
  • Linux Kernel 2.6 on Artesyn Katana Board (3750) with IBM 750FX PP C
    ... We have Artesyn Katana Boards with ppc boot version 1.2.0 (with different ... We are trying to upgrade the kernel to 2.6. ... Serial: MPSC driver $Revision: 1.00 $ ... Unable to get nfsd port number from server, ...
    (Linux-Kernel)
  • Re: [ARM] Regression ? at91rm9200 machine-type
    ... I cannot boot my board anymore. ... u-boot is not passing the right boot information to the kernel. ... # Device Drivers ... # RAM/ROM/Flash chip drivers ...
    (Linux-Kernel)
  • Re: Is RPMfusion on strike? [SOLVED -- at least for me]
    ... installed the new update for kernel 2.6.29.6-217.2.8.fc11.x86_64. ... Can you boot under one of the kernels? ... down the NVIDIA Driver Version: so you have it handy if things go south. ... dependencies that need to be removed will be included. ...
    (Fedora)

Loading