The firmware has the BootEntry variables in the NVRAM (non-volatile random-access memory). This contains a list of bootable devices and programs on the computer.
The BootOrder is the sequence that the firmware will check for system boot files.
To view the boot entry on a UEFI enabled system, run efibootmgr -v
$ efibootmgr -v
BootCurrent: 0012
Timeout: 1 seconds
BootOrder: 0012,0010,0011,000D,0001,0009,0008,0000,0002
Boot0000* Windows Boot Manager VenHw(99e27c00cb...)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................
Boot0001* debian VenHw(99e275eb...)
Boot0002* ubuntu VenHw(99e27b...)
Boot0008* Generic Usb Device VenHw(99e275b...)
Boot0009* CD/DVD Device VenHw(99e275cb...)
Boot000D* Realtek PXE B01 D00 BBS(Network,,0x0)..BO
Boot0010* TOSHIBA DT01ACA050 LENOVO BBS(HD,,0x0)..BO
Boot0011* TOSHIBA HDWD130 BBS(HD,,0x0)..BO
Boot0012* ubuntu HD(2,GPT,14fc7215-4232-53ac-dbd0-9a1e007acead,0x1000,0x100800)/File(\EFI\Ubuntu\shimx64.efi)..BO
From the output above, shim is going to be loaded first on the system.
Shim is the pre-bootloader that runs on UEFI systems. It is signed by Microsoft, and it is used to load the “real” bootloader: GRUB.
Lab 2: OS main components
Environment Preparation
Exercise 1: GPT partition
MBR Dump and Analysis
MBR starts at logical block address (LBA) 0 of the GPT layout. Use dd to dump the first 512 bytes from LBA 0.
Use hexedit to view the MBR dump.
GPT Header Dump and Analysis
GPT header starts from LBA 1. Use dd to dump the 512 bytes in sector 1:
View the GPT dump with hexedit
Questions to answer
count
, thebs
, and theskip
options when using dd?Exercise 2 - UEFI Booting
The Unified Extensible Firmware Interface Specification describes an interface between the operating system and the platform firmware.
1. Boot sequence
Platform initialization to prepare the hardware (memory, storage devices, peripherals).
Power on Self Test (POST)
The firmware has the BootEntry variables in the NVRAM (non-volatile random-access memory). This contains a list of bootable devices and programs on the computer.
The BootOrder is the sequence that the firmware will check for system boot files.
To view the boot entry on a UEFI enabled system, run
efibootmgr -v
From the output above, shim is going to be loaded first on the system.
The firmware validates and loads the shim binary.
Shim then loads GRUB bootloader.
The UEFI boot manager selects the GRUB file located at
/boot/efi/EFI/ubuntu/grub*.efi
and runs it.GRUB will determine which operating system kernel to start based on the configuration. The operating system kernel is loaded into memory and the control of the system is transferred to it.
Once loaded, the kernel will disable the firmware’s Boot Services.
Questions to answer
Exercise 3: Filesystem
/dev
filesystems/proc
filesystemQuestions to answer
/
directory? Show proof./dev/zero
?