This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > The Zynq Book > Linux Booting > Stages of the Desktop Linux Boot Process

TABLE OF CONTENTS

Xilinx FPGA FPGA Forum

Stages of the Desktop Linux Boot Process

FONT SIZE : AAA

BIOS

The BIOS is responsible for the initial system startup and locating the available bootable devices. When the system is powered on the processor will begin execution of the BIOS, which is split into two parts - the Power-On Self Test (POST) and runtime services.  The first operation carried out by the BIOS is dependent on whether the system was  powered on (cold boot) or reset (warm boot). If the system has been powered on, the first operation is the initialisation and testing of the basic system hardware components - a process known as the POST [1]. Once all hardware devices have been initialised and verified, the POST function is flushed from memory. If, however, the system has been reset  a special flag is raised in memory and the BIOS will not carry out the POST in order to save  time.  

Once the POST has been flushed from memory, the BIOS will advance to runtime services.This function searches for bootable devices that are available to the system; the devices must also be active to be found. The order in which the devices are located is defined in the Complementary Metal Oxide Semiconductor (CMOS) settings. Typically  the Linux boot device is a hard disk; it can, however, be anything from a floppy disk,  network device, USB memory or CD-ROM. 

When booting Linux from a hard disk, the Master Boot Record (MBR), a 512 byte sector located in the first sector of the device, contains the primary bootloader. The last task carried out by the BIOS is the loading of the MBR into memory. Once loaded, the BIOS relinquishes control [1].

First-Stage Bootloader (FSBL)

The FSBL is a section of code contained in the MBR. The remainder of the MBR is a partition table and a validation signature. The largest section of the MBR (446 bytes) is known as the primary bootloader and contains executable code and error messages [1]. The partition table is contained in the next 64 bytes, which itself contains records of four primary partitions, of 16 bytes each. The final section of the MBR is a 2 byte boot signature  — 0xAA55 — for validating the MBR. The structure of the MBR is provided in Figure

Structure of the Master Boot Record (MBR).png

The primary bootloader’s job is to locate, and then load, the SSBL by searching the partition table for an active partition. Once an active partition is located, all further partitions are scanned to ensure that they are inactive. The boot record from the active partition  is then loaded into memory for execution.

The SSBL will present you with a list of operating systems that are available to be booted  by the system. Once the desired operating system has been selected, the kernel image is decompressed and loaded into memory before the control of the processor is passed to the  OS [4].

Two main bootloaders exist: Linux Loader (LILO) and Grand Unified Bootloader  (GRUB). Both LILO and GRUB are made up of the combination of both the FSBL and  SSBL. LILO has been around for long time and has, in most cases, been replaced with  GRUB. While LILO requires that the kernel files be stored on raw disk sectors, GRUB is  able to load kernels from ext2 or ext3 file systems [1]. GRUB is able to do this by adding an  extra step to the bootloader process, between the first- and second-stages, which allows it  to understand a specific file system.

Other methods of booting a Linux kernel exist, such as Syslinux or Loadlin which allow  you to load Linux from, and replace, the currently running Windows/DOS environment.

Kernel

With control of the CPU handed over by the second-stage bootloader, a routine will run  to perform a small amount of hardware setup before decompressing the kernel image.  Once decompressed, the kernel image will be transferred to high memory - the part of  physical memory not mapped directly by the kernel page tables. If a RAM disk image is  present this will also be moved into memory and marked for later use [1]. At this point the  kernel will be called for the first time and will boot. 

During the kernel boot further hardware setup is carried out, including setting up the  stack, configuring the page tables, enabling memory paging and the detection of the CPU  and FPU type [1].

Init

The final stage of the Linux boot process is the initialisation of init - the first user-space  application. Once invoked, init looks for the file /etc/inittab and determines whether it has  an entry of the type initdefault, which details the initial runlevel of the Linux system. The  various Linux distributions will have different configurations for the runlevels of the  system. Taking the Linux standard base specification as an example, there are 7 runlevels,  as detailed in Table 24.1 [3].

Init is the first program to be invoked that has been compiled with the standard C  library. No standard C applications will have been executed prior to this point [1].

Default runlevels for Linux Standard Base [3].png


  • XC2C384-10FT256C

    Manufacturer:Xilinx

  • CPLD CoolRunner -II Family 9K Gates 384 Macro Cells 125MHz 0.18um Technology 1.8V 256-Pin FTBGA
  • Product Categories: CPLDs

    Lifecycle:Active Active

    RoHS: No RoHS

  • XC2C384-10PQ208C

    Manufacturer:Xilinx

  • CPLD CoolRunner -II Family 9K Gates 384 Macro Cells 125MHz 0.18um Technology 1.8V 208-Pin PQFP
  • Product Categories: CPLDs

    Lifecycle:Active Active

    RoHS: No RoHS

  • XC3S50-4PQ208C

    Manufacturer:Xilinx

  • FPGA Spartan-3 Family 50K Gates 1728 Cells 630MHz 90nm Technology 1.2V 208-Pin PQFP
  • Product Categories: FPGAs

    Lifecycle:Active Active

    RoHS: No RoHS

  • XC3S50-4TQG144I

    Manufacturer:Xilinx

  • FPGA Spartan-3 Family 50K Gates 1728 Cells 630MHz 90nm Technology 1.2V 144-Pin TQFP
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Active Active

    RoHS:

  • XCS10XL-5VQG100C

    Manufacturer:Xilinx

  • FPGA Spartan-XL Family 10K Gates 466 Cells 250MHz 3.3V 100-Pin VTQFP
  • Product Categories:

    Lifecycle:Obsolete -

    RoHS:

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.