Marrying U-Boot, UEFI and grub About Me Alexander Graf KVM and - - PowerPoint PPT Presentation

marrying u boot uefi and grub about me
SMART_READER_LITE
LIVE PREVIEW

Marrying U-Boot, UEFI and grub About Me Alexander Graf KVM and - - PowerPoint PPT Presentation

Marrying U-Boot, UEFI and grub About Me Alexander Graf KVM and QEMU developer for SUSE Server class PowerPC KVM port Nested SVM Founding member of SUSE ARM team Booting on ARM Booting on ARM Boot ROM Booting on ARM Boot


slide-1
SLIDE 1

Marrying U-Boot, UEFI and grub

slide-2
SLIDE 2

About Me

  • Alexander Graf
  • KVM and QEMU developer for SUSE
  • Server class PowerPC KVM port
  • Nested SVM
  • Founding member of SUSE ARM team
slide-3
SLIDE 3

Booting on ARM

slide-4
SLIDE 4 Boot ROM

Booting on ARM

slide-5
SLIDE 5 Firmware Flash Boot ROM

Booting on ARM

slide-6
SLIDE 6 Firmware Flash Boot ROM SD / USB / etc

Booting on ARM

custom extlinux vboot UEFI
slide-7
SLIDE 7 Firmware, do not care Firmware Flash Boot ROM SD / USB / etc

Ideal Distro boot flow

custom extlinux vboot UEFI
slide-8
SLIDE 8 Firmware, do not care Firmware Flash Boot ROM SD / USB / etc

Ideal Distro boot flow

One protocol to
 rule them all
slide-9
SLIDE 9

UEFI boot flow

slide-10
SLIDE 10

UEFI boot flow

UEFI
slide-11
SLIDE 11

UEFI boot flow

UEFI NVRAM
slide-12
SLIDE 12

UEFI boot flow

UEFI NVRAM sda2/foo.efi mmc0/bar.efi eth0/dhcp4
slide-13
SLIDE 13

UEFI boot flow

NVRAM sda2/foo.efi mmc0/bar.efi eth0/dhcp4 UEFI
slide-14
SLIDE 14

UEFI boot flow

NVRAM sda2/foo.efi mmc0/bar.efi eth0/dhcp4

UEFI
slide-15
SLIDE 15

UEFI boot flow

NVRAM sda2/foo.efi mmc0/bar.efi eth0/dhcp4

✗ ✗

UEFI
slide-16
SLIDE 16

UEFI boot flow

NVRAM sda2/foo.efi mmc0/bar.efi eth0/dhcp4

✗ ✗ ✗

UEFI
slide-17
SLIDE 17

UEFI boot flow

Removable NVRAM UEFI
slide-18
SLIDE 18

UEFI boot flow

Removable NVRAM sda/ESP/efi/
 boot/bootaa64.efi mmc0/ESP/efi/
 boot/bootaa64.efi cd0/eltorito/efi/
 boot/bootaa64.efi UEFI
slide-19
SLIDE 19

UEFI boot flow

Removable NVRAM sda/ESP/efi/
 boot/bootaa64.efi cd0/eltorito/efi/
 boot/bootaa64.efi mmc0/ESP/efi/
 boot/bootaa64.efi UEFI
slide-20
SLIDE 20

UEFI boot flow

Removable NVRAM sda/ESP/efi/
 boot/bootaa64.efi cd0/eltorito/efi/
 boot/bootaa64.efi

mmc0/ESP/efi/
 boot/bootaa64.efi UEFI
slide-21
SLIDE 21 mmc0/ESP/efi/
 boot/bootaa64.efi

UEFI boot flow

Removable NVRAM sda/ESP/efi/
 boot/bootaa64.efi cd0/eltorito/efi/
 boot/bootaa64.efi

✗ ✗

UEFI
slide-22
SLIDE 22 mmc0/ESP/efi/
 boot/bootaa64.efi

UEFI boot flow

Removable NVRAM sda/ESP/efi/
 boot/bootaa64.efi cd0/eltorito/efi/
 boot/bootaa64.efi

✗ ✗

UEFI
slide-23
SLIDE 23 mmc0/ESP/efi/
 boot/bootaa64.efi

UEFI boot flow

Removable NVRAM sda/ESP/efi/
 boot/bootaa64.efi cd0/eltorito/efi/
 boot/bootaa64.efi

✗ ✗

bootaa64.efi UEFI
slide-24
SLIDE 24

UEFI boot flow

bootaa64.efi UEFI
slide-25
SLIDE 25

UEFI boot flow

bootaa64.efi EFI Runtime Data Console Boot Services Runtime Services Tables UEFI
slide-26
SLIDE 26

UEFI boot flow

bootaa64.efi EFI Runtime Data Console Runtime Services Tables UEFI Boot Services
slide-27
SLIDE 27

UEFI boot flow

bootaa64.efi UEFI Boot Services
slide-28
SLIDE 28 btrfs

UEFI boot flow

bootaa64.efi UEFI Boot Services
slide-29
SLIDE 29 btrfs

UEFI boot flow

bootaa64.efi UEFI Boot Services
slide-30
SLIDE 30 btrfs

UEFI boot flow

bootaa64.efi UEFI Boot Services
slide-31
SLIDE 31 btrfs

UEFI boot flow

bootaa64.efi

✗ ✗

UEFI Boot Services

slide-32
SLIDE 32

UEFI boot flow

Runtime Services NVRAM UEFI
slide-33
SLIDE 33

UEFI boot flow advantages

slide-34
SLIDE 34 UEFI boot flow advantages UEFI
slide-35
SLIDE 35 Firmware, do not care UEFI boot flow advantages UEFI
slide-36
SLIDE 36 Firmware, do not care UEFI boot flow advantages UEFI
slide-37
SLIDE 37 Firmware, do not care UEFI boot flow advantages UEFI btrfs
slide-38
SLIDE 38 zfs Firmware, do not care UEFI boot flow advantages UEFI btrfs
slide-39
SLIDE 39 ext4 extension 593 zfs Firmware, do not care UEFI boot flow advantages UEFI btrfs
slide-40
SLIDE 40 ext4 extension 593 zfs Firmware, do not care UEFI boot flow advantages btrfs UEFI
slide-41
SLIDE 41 Firmware, do not care UEFI boot flow advantages UEFI
slide-42
SLIDE 42 UEFI boot flow advantages
slide-43
SLIDE 43
slide-44
SLIDE 44
slide-45
SLIDE 45 U-Boot
slide-46
SLIDE 46 U EFI_STATUS EFIAPI GetNextMonotonicCount ( OUT UINT64 *Count ) { if (Count == NULL) { return EFI_INVALID_PARAMETER; } *Count = gCurrentMonotonicCount++; return EFI_SUCCESS; }
slide-47
SLIDE 47 static efi_status_t EFIAPI efi_get_next_monotonic_count(uint64_t *count) { static uint64_t mono = 0; EFI_ENTRY("%p", count); *count = mono++; return EFI_EXIT(EFI_SUCCESS); } U-Boot
slide-48
SLIDE 48 U
slide-49
SLIDE 49 U UEFI
slide-50
SLIDE 50 U
slide-51
SLIDE 51 U Black Boxes
slide-52
SLIDE 52 U-Boot
slide-53
SLIDE 53 U-Boot Monolithic
slide-54
SLIDE 54 U-Boot
slide-55
SLIDE 55 U-Boot core
slide-56
SLIDE 56 U-Boot core BBB
slide-57
SLIDE 57 U-Boot core BBB Open
 Platform
slide-58
SLIDE 58 U-Boot core BBB Open
 Platform $ grep -R ARM configs/ | wc -l
 684
slide-59
SLIDE 59 U-Boot Foundation for black box modules Monolithic, GPL Windows coding style Linux coding style Built to fork Built to include
slide-60
SLIDE 60

UEFI interfaces

slide-61
SLIDE 61

UEFI interfaces

slide-62
SLIDE 62

UEFI interfaces

slide-63
SLIDE 63

UEFI interfaces

slide-64
SLIDE 64

UEFI interfaces

u32 block_size u64 last_block char read_only read_blocks() write_blocks()
slide-65
SLIDE 65

UEFI interfaces

u8 mac_address[32] u8 ip_address[16] u8 media_present transmit() receive()
slide-66
SLIDE 66

U-Boot interfaces

slide-67
SLIDE 67

U-Boot interfaces

ulong blksz u64 lba char removable blk_dread() blk_dwrite() 
 
 
 eth_get_ethaddr() net_send_packet() eth_rx()
slide-68
SLIDE 68

UEFI interfaces

slide-69
SLIDE 69

UEFI interfaces

slide-70
SLIDE 70

UEFI interfaces

efi_loader
slide-71
SLIDE 71 efi_loader
slide-72
SLIDE 72 efi_loader bootefi
slide-73
SLIDE 73 bootefi
slide-74
SLIDE 74 bootefi
slide-75
SLIDE 75 bootefi
slide-76
SLIDE 76 bootefi U-Boot> load mmc 0:1 $kernel_addr_r Image
slide-77
SLIDE 77 bootefi U-Boot> load mmc 0:1 $kernel_addr_r Image reading Image 568320 bytes read in 165 ms (3.3 MiB/s)
slide-78
SLIDE 78 bootefi U-Boot> bootefi $kernel_addr_r $fdt_addr_r
slide-79
SLIDE 79 bootefi U-Boot> bootefi $kernel_addr_r $fdt_addr_r ## Starting EFI application at 0x01000000 … EFI stub: Booting Linux Kernel... EFI stub: UEFI Secure Boot is enabled. EFI stub: Using DTB from configuration table EFI stub: Exiting boot services and installing virtual address map...
slide-80
SLIDE 80 bootefi U-Boot> bootefi $kernel_addr_r $fdt_addr_r ## Starting EFI application at 0x01000000 … EFI stub: Booting Linux Kernel... EFI stub: UEFI Secure Boot is enabled. EFI stub: Using DTB from configuration table EFI stub: Exiting boot services and installing virtual address map...
slide-81
SLIDE 81 bootefi
slide-82
SLIDE 82 bootefi
slide-83
SLIDE 83 bootefi KASLR
slide-84
SLIDE 84 efi_loader bootefi
slide-85
SLIDE 85 efi_loader bootefi distro boot
slide-86
SLIDE 86 distro boot
slide-87
SLIDE 87 distro boot boot_targets=mmc0 usb0 pxe dhcp
slide-88
SLIDE 88 distro boot boot_targets=mmc0 usb0 pxe dhcp extlinux
slide-89
SLIDE 89 distro boot boot_targets=mmc0 usb0 pxe dhcp extlinux boot.script
slide-90
SLIDE 90 distro boot boot_targets=mmc0 usb0 pxe dhcp extlinux boot.script EFI
slide-91
SLIDE 91 EFI distro boot
slide-92
SLIDE 92 EFI distro boot
slide-93
SLIDE 93 EFI distro boot Partition Table ESP
slide-94
SLIDE 94 EFI distro boot ESP $fdtfile
slide-95
SLIDE 95 EFI distro boot ESP $fdtfile / /dtb/ /dtb/current/ /boot/ /boot/dtb/ /boot/dtb/current/
slide-96
SLIDE 96 EFI distro boot ESP $fdtfile efi/boot/bootaa64.efi
slide-97
SLIDE 97 EFI distro boot ESP $fdtfile
slide-98
SLIDE 98 EFI distro boot ESP $fdtfile
slide-99
SLIDE 99 EFI distro boot ESP $fdtfile
slide-100
SLIDE 100 EFI distro boot
slide-101
SLIDE 101 EFI distro boot
slide-102
SLIDE 102 EFI distro boot
slide-103
SLIDE 103 EFI distro boot ISO9660 el torito
slide-104
SLIDE 104 EFI distro boot ISO9660 el torito el torito
slide-105
SLIDE 105 Partition Table EFI distro boot el torito el torito
slide-106
SLIDE 106 Partition Table EFI distro boot el torito $fdtfile el torito
slide-107
SLIDE 107 EFI distro boot ✔ ✔
slide-108
SLIDE 108 EFI distro boot DHCP Distro Boot
slide-109
SLIDE 109 EFI distro boot DHCP Distro Boot DHCP Server
slide-110
SLIDE 110 EFI distro boot DHCP Distro Boot DHCP Server DHCP req
slide-111
SLIDE 111 EFI & Arch VCI EFI distro boot DHCP Distro Boot DHCP Server DHCP req
slide-112
SLIDE 112 filename EFI & Arch VCI EFI distro boot DHCP Distro Boot DHCP Server DHCP req DHCP ack
slide-113
SLIDE 113 TFTP filename EFI & Arch VCI EFI distro boot DHCP Distro Boot DHCP Server DHCP req DHCP ack
slide-114
SLIDE 114 EFI distro boot ✔ ✔ ✔
slide-115
SLIDE 115

UEFI Tables

slide-116
SLIDE 116

UEFI Tables

bootaa64.efi EFI Runtime Data Console Boot Services Runtime Services UEFI Tables
slide-117
SLIDE 117

UEFI Tables

Tables
slide-118
SLIDE 118

UEFI Tables

Tables ACPI
slide-119
SLIDE 119

UEFI Tables

Tables ACPI

slide-120
SLIDE 120

UEFI Tables

Tables ACPI

slide-121
SLIDE 121

UEFI Tables

Tables
slide-122
SLIDE 122

Missing Features

slide-123
SLIDE 123

Missing Features

NVRAM
slide-124
SLIDE 124

Missing Features

NVRAM
slide-125
SLIDE 125

Missing Features

NVRAM UEFI RTS
slide-126
SLIDE 126

Missing Features

NVRAM UEFI RTS

slide-127
SLIDE 127

Missing Features

NVRAM UEFI RTS

✗ ✗

slide-128
SLIDE 128

Missing Features

slide-129
SLIDE 129

Missing Features

init
slide-130
SLIDE 130

Missing Features

init
slide-131
SLIDE 131

Missing Features

init
slide-132
SLIDE 132

Missing Features

bootefi
slide-133
SLIDE 133

Missing Features

bootefi
slide-134
SLIDE 134

Missing Features

bootefi

slide-135
SLIDE 135

Missing Features

slide-136
SLIDE 136

Missing Features

slide-137
SLIDE 137

Missing Features

EFI Shell
slide-138
SLIDE 138

Missing Features

EFI Shell
slide-139
SLIDE 139

Missing Features

EFI Shell

slide-140
SLIDE 140

Why?

slide-141
SLIDE 141

Why?

slide-142
SLIDE 142

Why?

Department A Department B
slide-143
SLIDE 143

Why?

+

slide-144
SLIDE 144

Why?

+

slide-145
SLIDE 145

Why?

+

slide-146
SLIDE 146

Why?

+

slide-147
SLIDE 147

Why?

+

slide-148
SLIDE 148

Why?

+

slide-149
SLIDE 149

Why?

+

slide-150
SLIDE 150

Why?

+

slide-151
SLIDE 151

Why?

+

slide-152
SLIDE 152

Why?

+

slide-153
SLIDE 153

Why?

+

slide-154
SLIDE 154

Thank You

slide-155
SLIDE 155

Further Information

https://events.opensuse.org/conference/oSC16/program/proposal/946
slide-156
SLIDE 156 External Sources https://commons.wikimedia.org/wiki/File:Raspberry_Pi_B%2B_illustration.svg https://commons.wikimedia.org/wiki/File:Sd-card-1377140.svg http://eu.mophie.com/shop/media/catalog/product/cache/3/small_image/270x330/9df78eab33525d08d6e5fb8d27136e95/u/s/usb-micro3-40-blk_usb-tip-detail_front-back_540px.jpg https://commons.wikimedia.org/wiki/File:Circle-icons-submarine.svg https://commons.wikimedia.org/wiki/File:150-8-DIP.jpg https://commons.wikimedia.org/wiki/File:Hdd_icon.svg https://commons.wikimedia.org/wiki/File:ARM_CPU_icon.svg http://findicons.com/icon/177982/memory#
slide-157
SLIDE 157

OSA Icons

Icons received from http://www.opensecurityarchitecture.org/cms/library/icon-library
slide-158
SLIDE 158

emojione Icons

Icons received from http://www.opensecurityarchitecture.org/cms/library/icon-library
slide-159
SLIDE 159

Other Icons

http://findicons.com/icon/download/234261/clock/128/png http://findicons.com/icon/439269/button_power https://fosdem.org/2017/schedule/event/grub_new_maintainers/attachments/slides/1768/export/events/attachments/grub_new_maintainers/slides/1768/slides.pdf https://de.wikipedia.org/wiki/BeagleBoard#/media/File:Beagle_Board_big.jpg https://thenounproject.com/term/folder-tree/27307/ https://commons.wikimedia.org/wiki/File:Crystal_Project_Hardware.png http://findicons.com/icon/202613/folder_library
slide-160
SLIDE 160

Other Icons

http://tumboy.tumblr.com/post/10052361836 http://findicons.com/icon/132807/b_leg_embossed http://findicons.com/icon/237892/text_plain http://findicons.com/icon/226957/package_games_board