3. WrmOS: bootloader

← 2. WrmOS: configuration

4. WrmOS: kernel →

Contents
3.1 Overview
3.2 Configuration parameters
3.3 Architecture specific actions

3.1 Overview [up]


Bootloader is the first part of WrmOS witch is executed on target CPU. The following actions must be done by bootloader:

  • first system initialization;
  • load kernel.elf, sigma0.elf and roottask.elf from RAMFS to memory;
  • add information about sigma0.elf and roottask.elf to KIP memory descriptors;
  • go to kernel.

3.2 Configuration parameters [up]


Bootloader has the next configuration parameters:

Name Location Description
usr_ldr_dbg cfg/prj/<project-name>.prj Bootloader debug flag. My be 0 or 1. It allows to use debug configuration with asserts, additional debug outputs and other (for 1) or use release configuration (for 0).
ldr_uart_paddr cfg/plt/<platform-name>.prj Bootloader UART physical address.
ldr_uart_bitrate Bootloader UART bitrate.

    3.3 Architecture specific actions [up]


    First system initialization is differ for each CPU architecture.

    SPARC

    1. Initialize trap table.
    2. Setup stack.
    3. Go to main() function.

    ARM

    1. Setup stack.
    2. Go to main() function.

    x86

    1. Execute boot0:
      • initialize segment registers
      • setup stack
      • load boot1 from disk to RAM
      • switch to protected mode
      • go to boot1
    2. Execute boot1:
      • load whole image from disk to RAM
      • go to main() function

    x86_64

    1. Execute boot0:
      • initialize segment registers
      • setup stack
      • load boot1 from disk to RAM
      • switch to protected mode
      • go to boot1
    2. Execute boot1:
      • set up 1:1 mapping
      • switch to long mode
      • load whole image from disk to RAM
      • go to main() function

    ← 2. WrmOS: configuration

    4. WrmOS: kernel →