From UEFI Shell to Linux - UEFI Linux BootLoader Zhang Rui Software Engineer Sep 28 th 2011.

Slides:



Advertisements
Similar presentations
Hardware Lesson 3 Inside your computer.
Advertisements

Booting the TS-7300 boards VHDL and C. Overview After looking at the general approach to booting machines (generally PCs) we will now look at the TS-7300.
PC bootup Presented by: Rahul Garg (2003CS10183) Rajat Sahni (2003CS10184) Varun Gulshan(2003CS10191)
Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Linux+ Guide to Linux Certification Chapter Nine System Initialization.
Linux Booting Procedure
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Booting the Linux Kernel Dr. Michael L. Collard 1.
DIT314 ~ Client Operating System & Administration CHAPTER 4 CONFIGURING HARDWARE DEVICES AND STARTUP PROCESS Prepared By : Suraya Alias.
Startup. Major phases  BIOS  MBR program  Boot loader (Partition boot program )  OS’s kernel Loader  CPU always starts running at x’FFFF0’=1,048,560.
Chapter 3 Understanding the Boot Process and Command Line.
11/13/01CS-550 Presentation - Overview of Microsoft disk operating system. 1 An Overview of Microsoft Disk Operating System.
System initialisation
The Boot process. Booting on a PC POST –Hardware test – may not run CPU ie fan not working CPU start-up –Jumps to fixed location to execute BIOS code.
Operating Systems What do you have left on your computer after you strip away all of the games and application programs you bought and installed? Name.
Linux+ Guide to Linux Certification, Third Edition
Tel : 同济大学软件学院 UEFI 与固件程序设计.
hardware and operating systems basics.
Chapter 5 Basic Input/Output System (BIOS)
Basic Input Output System
Linux Booting Procedure
Booting. Booting is the process of powering it on and starting the operating system. power on your machine, and in a few minutes your computer will be.
BIOS. Accessing System BIOS You can use the System Setup utility to change variable BIOS information, such as the type of hard drive you have installed.
How Hardware and Software Work Together
Linux Kernel 101 Sriram Sundararajan. Linux : /lee'nuhks/ or /li'nuks/, not /li:'nuhks/ n. /lee'nuhks/ or /li'nuks/, not /li:'nuhks/ n. The free Unix.
Laface Operating System Design Booting a PC to run a kernel from Low memory VGA display.
Hardware Boot Sequence. Vocabulary BIOS = Basic Input Output System UEFI = Unified Extensible Firmware Interface POST= Power On Self Test BR = Boot Record.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
Unit - VI. Linux and Real Time: Real Time Tasks Hard and Soft Real Time Tasks Linux Scheduling Latency Kernel Preemption Challenges in Kernel Preemption.
Bootstrapping Steve Muckle Dave Eckhardt. Carnegie Mellon University1 Synchronization Project 3 checkpoint 1 Bboard post, web page Paging, COW optional.
1.4 Hardware Review. CPU  Fetch-decode-execute cycle 1. Fetch 2. Bump PC 3. Decode 4. Determine operand addr (if necessary) 5. Fetch operand from memory.
COMP075-OS2.
3A.List and describe the events that take place during the boot process. POWER SUPPLY THE POWER SUPPLY SENDS A SIGNAL TO THE COMPENENTS IN THE SYSTEM UNIT.
Genesis: From Raw Hardware to Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
Linux Kernel Programming (LKP). LKP New sub-course New sub-course We will learn together We will learn together Evaluation of this part of course will.
Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 8- 0 Lesson 8 Secondary Management.
IT Essentials 1 v3 Module 4 JEOPARDY IT Essentials 1 RouterModesWANEncapsulationWANServicesRouterBasicsRouterCommands RouterModesWANEncapsulationWANServicesRouterBasicsRouterCommands.
Linux Boot Process on the Raspberry Pi 2 1 David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis,
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
This courseware is copyrighted © 2016 gtslearning. No part of this courseware or any training material supplied by gtslearning International Limited to.
File System Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki CS 314.
WP1- Documentation Booting Petalinux from TFTP and using Network file system Section for developers Zynq 7020 R. Assiro.
Overview A) Power on or reset B) 1st stage boot loader C) 2nd stage boot loader D) Operate system.
Linux Introduction Linux was developed in the early 1990’s by Linus Torvald computer science student at the University of Helsinki Linux is distributed.
The GRUB bootloader Michael Opdenacker Thomas Petazzoni Free Electrons
Tech Level Cyber Security
The Boot Process The process of bringing the system from an "off" status to a running state is known as “booting”. The boot process takes place in four.
Chapter 6: BIOS.
GUID Partition Table Unified Extensible Firmware Interface (UEFI)
Lesson Objectives Aims Key Words
GUID Partition Table Unified Extensible Firmware Interface (UEFI)
Computer System Structures
Key Terms By: Kelly, Jackson, & Merle
Introduction to Computers
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Booting Up 15-Nov-18 boot.ppt.
Starting the computer. Every day we are using an operating system and most specifically a Windows operating system but most of us are not aware of the.
Genesis: From Raw Hardware to Processes
The Boot Process The process of bringing the system from an "off" status to a running state is known as “booting”. The boot process takes place in four.
Chapter Overview Operating System Basics
SUSE Linux Enterprise Desktop Administration
BIOS Chapter 6.
Modern PC operating systems
TPM, UEFI, Trusted Boot, Secure Boot
GUID Partition Table Unified Extensible Firmware Interface (UEFI)
GUID Partition Table Unified Extensible Firmware Interface (UEFI)
Department of Computer Science
Lecture 10 review Booting sequence in Brief
Memory Addresses.
The Boot Process The process of bringing the system from an "off" status to a running state is known as “booting”. The boot process takes place in four.
Presentation transcript:

From UEFI Shell to Linux - UEFI Linux BootLoader Zhang Rui Software Engineer Sep 28 th 2011

2 BootLoader Tridition Linux BootLoader UEFI BootLoader UEFI Linux BootLoader Elilo – the standard UEFI Linux BootLoader Agenda

3 The program invoked by the BIOS to load the image of an operating system kernel into RAM Why BootLoader -CPU can only execute program code found in ROM, RAM. -Modern operating systems and application program code and data are stored on nonvolatile data storage devices, such as hard disk, CD, DVD, flash memory cards, USB, foppy, etc… BootLoader

4 Traditional Linux Bootloader

5 UEFI application –Loaded by Boot Manager/Other UEFI applications. –Firmware allocates memory and copies the image. –Unloaded when the application returns from its entry points or when it calls the boot service Exit(). UEFI driver –Same as UEFI application but Optionally unloaded unless EFI_SUCCESS is not returned. UEFI OS loader –A special type of UEFI application that normally takes over control of the system from firmware. –Never unloaded unless something bad happens –If success, take control of the system by using ExitBootService(). UEFI BootLoader

6 UEFI conceptual overview

7 A UEFI OS loader A Linux BootLoader No MBR involved Single stage Follows Linux/X86 Boot Protocol Elilo/Grub EFI/efiLinux, etc. UEFI Linux BootLoader

8 Elilo is the standard Linux boot loader for UEFI-based PC hardware Elilo is a UEFI OS loader that can be launched in EFI shell Source code : Can be built directly in Linux Elilo – the uEfi LInux LOader

9 Build a UEFI system partition Copy elilo.efi, Linux kernel image, init ramdisk, and elilo configure file to the system partition Boot into UEFI shell “elilo.efi –C elilo.conf” How to launch Elilo

10 Get Boot services table and RuntimeServices table. Get application options, “-C elilo.conf” <- LoadedImageProtocol Parse the options Install the FileSystem <- FileSystemProtocol Read elilo configuration file, “elilo.conf”. Parse config file Load kernel image (bzImage) Load init ramdisk Setup boot parameters for Linux kernel Uninstall the FileSystem Jump to Linux kernel How Elilo works

11 bzImage. –setup.bin.bstext +.bsdata +.header +.entrytext + … –.bstext &.bsdata : legacy code for booting from floppy –.header : setup_header (kernel attributes, used by setup) –.entrytext: start_of_setup – the real mode kernel entry Boot sector : the first 512 bytes of setup.bin –vmlinux.bin Protect mode kernel entry + Compressed Linux kernel Linux kernel image

12 bzImage Code for floppy.header(setup_header) Real mode entry: start_of_setup … Protect mode entry: startup_32 Compressed kernel: start_kernel bzImage Setup.bin Vmlinux.bin

13 Linux Boot process start_of_setup:arch/x86/boot/header.S main:arch/x86/boot/main.c mount rootfs :/init startup_32:arch/x86/boot/compress/header_32.S decompress_kernel:arch/x86/boot/compress/misc.c start_kernel:init/main.c

14 Every field in it has a story –kernel_src/Documentation/x86/boot.txt struct boot_params –APM BIOS information –EFI information System table Memory map –Setup header (offset 0x1F1) –E820 entries –… boot_params structure

15 Read boot sector Check if it is bzImage If no, fail Read setup data Get the kernel protect mode entry in setup data Allocate memory for kernel image Copy kernel image to Memory Loading Linux kernel image

16 create new boot_params for Linux kernel –Allocate memory for boot_params –Copy kernel command line –Get setup header from setup data –Set loader type –Set the kernel start address in boot_params –Set initrd start address in boot_params –Set cmdline address in boot_params –Set EFI system table pointer in boot_params –Set Memory Map <- GetMemoryMap() Initializing boot_params

17 Now we are ready! Kernel image/initrd image/cmdline/boot_params are all in memory now Jump to kernel image right now? NO! Invoke ExitBootServices Save boot_params so that the kernel can get it (esi) Initialize GDT asm volatile ( “movl %0, %ecx” : : “m” (kernel_entry) ); asm volatile ( “jmp *%ecx” : : ); startup_32() – the protect mode kernel entry Yeah! Jumping to Linux

References Unified Extensible Firmware Interface Specification Understanding Linux kernel, 3rd Edition oader

19 Q&A