SlideShare a Scribd company logo
8
Most read
10
Most read
11
Most read
Copyright@Embedkari
QEMU
BIOS
U-Boot
UEFI
Agenda
●
QEMU or Quick EMUlator
●
Bootloader overview
●
X86 booting mechanism
●
BIOS to boot sector code transfer demo
●
U-Boot demo for x86 using QEMU
Disclaimer
●
Presenter will not be responsible for for any
damage to USB or HDD due to experiments
followed.
●
Take a note of all the instructions carefully
●
Don’t use your hard disk for bootloader
experiments.
●
Presenter will use either QEMU or old x86
based system
QEMU
●
QEMU is a generic open source machine emulator and
virtualizer
●
Emulates program written for one architecture in another
●
It can run virtual machines like KVM in host CPU
●
Installation
–
sudo apt install qemu-system
–
If error
–
sudo apt install qemu-system --fix-missing
Bootloader
●
BIOS →UEFI
●
8xxROM→PPCboot—Armboot merged--→U-boot
●
TianoCore
–
open source implementation of UEFI
●
LinuxBIOS-->Coreboot
●
Libreboot
●
Both Coreboot and Libreboot are aimed to replace
proprietary boot firmware
X86 booting mechanism
●
Hardware Reset
●
BIOS(Basic Input/Output System) or Platform Firmware in ASM
–
Resides in non-volatile memory and prepares all POST procedures
–
Interactive hardware configuration
–
Boot mode
●
UEFI / CSM(Compatibility Support Mode)/BIOS
●
Boot Loader
–
Extensible Firmware Interface (EFI)
–
Unified Extensible Firmware Interface(UEFI) written in C
●
Boot Partition Format
–
Boot loader support also depends on type of partition
●
MBR(Master Boot Record) disk partition
●
GPT(GUID Partion Table) disk partition
Custom boot.asm●
org 0x7C00 ;BIOS loads program here
●
bits 16 ;16-bit mode
●
start:
●
cli ;Disable Interrupts
●
mov si, welcm ;SI points to custom data
●
mov ah, 0x0E ; Tell BIOS to print characters
●
.loop lodsb ;load byte into AL
–
or al, al
–
jz halt
–
jmp .loop
●
halt: hlt
●
welcm: db “Embedkari Welcomes You! “
●
times 510 - ($ - $$) db 0 ;Fills remaining bytes except last two
●
dw 0xAA55
Custom boot sector
Experiment
●
nasm(Netwide Assembler) Open source s/w for x86
–
sudo apt update
–
Check and install build-essential if not present
–
sudo apt list | grep build | grep essential
–
sudo apt install nasm
●
nasm boot.asm -f bin -o boot.bin
●
You may verify assembly listing using
–
nasm boot.asm -l boot.lst
●
Check the binary in QEMU
●
qemu-system-i386 -fda boot.bin
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
Program boot.bin to USB
●
USB data can be
verified if required
●
Start Cygwin as
adminstrator
●
dd if=/dev/sdb bs=512
count=4 of=test.bin
U-Boot-x86 @QEMU
●
git clone git://git.denx.de/u-boot-x86.git
●
cd u-boot-x86
●
export BUILD_ROM=y
●
make qemu-x86_defconfig
●
make all
●
Test U-boot in QEMU
●
qemu-system-i386 -nographic -bios u-
boot.rom -net nic -net user,tftp=/tftpboot
U-Boot build issue
●
You may get error due to absence of required
Libraries and this may lead to following additional
installation
●
For missing swig
–
sudo apt install swig
●
For Python 2
–
sudo apt install python-dev
●
For Python 3
–
sudo apt install python3-dev
Reference
●
https://firmware.intel.com/learn/uefi/about-uefi
●
http://www.uefi.org/
●
https://www.qemu.org/
●
https://manpages.debian.org/stretch/qemu-system-
●
https://pci-ids.ucw.cz/read/PC/8086
●
THANKS
If you found this information usefule < Please
like this video AND subscribe to
www.youtube.com/c/embedkari
Embedded Career Information :
www.facebook.com/embedkari
Blog:www.embedkari.com

More Related Content

PPT
PPT
Qemu - Raspberry | while42 Singapore #2
PDF
QEMU in Cross building
PDF
Libvirt API Certification
PDF
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
PDF
Kvm optimizations
PDF
NetBSD workshop
Qemu - Raspberry | while42 Singapore #2
QEMU in Cross building
Libvirt API Certification
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
Kvm optimizations
NetBSD workshop

What's hot (18)

ODP
coreboot@Budapest 10.2009 Meetup
PDF
NetBSD on Google Compute Engine (en)
PDF
Linux fundamental - Chap 16 System Rescue
PDF
Androidx86 Installation For Virtualbox
PDF
My First BCC
PPTX
Programming OpenRISC on Altera De0_nano
PDF
Creación de máquinas virtuales basada en kernel usando qemu y virsh
PDF
Quickly Debug VM Failures in OpenStack
DOCX
Wowza project
PDF
OpenBTS AirPutih
PDF
Server Room Configuration
PDF
VM - Talk
RTF
1. openvpn simple
KEY
Grabbing the PostgreSQL Elephant by the Trunk
PDF
Control-M 800 - Infrastructure Example
PDF
Look Into Libvirt Osier Yang
PDF
Dave Gilbert - KVM and QEMU
ODP
Ansible & Vagrant
coreboot@Budapest 10.2009 Meetup
NetBSD on Google Compute Engine (en)
Linux fundamental - Chap 16 System Rescue
Androidx86 Installation For Virtualbox
My First BCC
Programming OpenRISC on Altera De0_nano
Creación de máquinas virtuales basada en kernel usando qemu y virsh
Quickly Debug VM Failures in OpenStack
Wowza project
OpenBTS AirPutih
Server Room Configuration
VM - Talk
1. openvpn simple
Grabbing the PostgreSQL Elephant by the Trunk
Control-M 800 - Infrastructure Example
Look Into Libvirt Osier Yang
Dave Gilbert - KVM and QEMU
Ansible & Vagrant
Ad

Similar to Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc (20)

PDF
U-Boot - An universal bootloader
PDF
3. configuring a compute node for nfv
PDF
Launch the First Process in Linux System
PPTX
U-Boot Porting on New Hardware
PDF
Install power linux through cdrom and network redhat and suse
ODP
Grub and dracut ii
PDF
NFD9 - Matt Peterson, Data Center Operations
PPT
101 1.2 boot the system
PDF
Study on Android Emulator
PDF
syzkaller: the next gen kernel fuzzer
PDF
Linux: the first second
ODP
The Deck by Phil Polstra GrrCON2012
PDF
Jagan Teki - U-boot from scratch
PPT
U Boot or Universal Bootloader
PDF
XS Boston 2008 Self IO Emulation
PDF
Uboot startup sequence
PDF
Linux Containers From Scratch
PDF
Introduction of unit test on android kernel
ODP
5. boot process
PPTX
Bootloaders (U-Boot)
U-Boot - An universal bootloader
3. configuring a compute node for nfv
Launch the First Process in Linux System
U-Boot Porting on New Hardware
Install power linux through cdrom and network redhat and suse
Grub and dracut ii
NFD9 - Matt Peterson, Data Center Operations
101 1.2 boot the system
Study on Android Emulator
syzkaller: the next gen kernel fuzzer
Linux: the first second
The Deck by Phil Polstra GrrCON2012
Jagan Teki - U-boot from scratch
U Boot or Universal Bootloader
XS Boston 2008 Self IO Emulation
Uboot startup sequence
Linux Containers From Scratch
Introduction of unit test on android kernel
5. boot process
Bootloaders (U-Boot)
Ad

Recently uploaded (20)

PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
GDM (1) (1).pptx small presentation for students
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Pharma ospi slides which help in ospi learning
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Pre independence Education in Inndia.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cell Structure & Organelles in detailed.
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Institutional Correction lecture only . . .
O7-L3 Supply Chain Operations - ICLT Program
GDM (1) (1).pptx small presentation for students
2.FourierTransform-ShortQuestionswithAnswers.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Pharma ospi slides which help in ospi learning
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Pre independence Education in Inndia.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cell Structure & Organelles in detailed.
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
TR - Agricultural Crops Production NC III.pdf
Microbial diseases, their pathogenesis and prophylaxis
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Cell Types and Its function , kingdom of life
Abdominal Access Techniques with Prof. Dr. R K Mishra
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Final Presentation General Medicine 03-08-2024.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Institutional Correction lecture only . . .

Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc

  • 2. Agenda ● QEMU or Quick EMUlator ● Bootloader overview ● X86 booting mechanism ● BIOS to boot sector code transfer demo ● U-Boot demo for x86 using QEMU
  • 3. Disclaimer ● Presenter will not be responsible for for any damage to USB or HDD due to experiments followed. ● Take a note of all the instructions carefully ● Don’t use your hard disk for bootloader experiments. ● Presenter will use either QEMU or old x86 based system
  • 4. QEMU ● QEMU is a generic open source machine emulator and virtualizer ● Emulates program written for one architecture in another ● It can run virtual machines like KVM in host CPU ● Installation – sudo apt install qemu-system – If error – sudo apt install qemu-system --fix-missing
  • 5. Bootloader ● BIOS →UEFI ● 8xxROM→PPCboot—Armboot merged--→U-boot ● TianoCore – open source implementation of UEFI ● LinuxBIOS-->Coreboot ● Libreboot ● Both Coreboot and Libreboot are aimed to replace proprietary boot firmware
  • 6. X86 booting mechanism ● Hardware Reset ● BIOS(Basic Input/Output System) or Platform Firmware in ASM – Resides in non-volatile memory and prepares all POST procedures – Interactive hardware configuration – Boot mode ● UEFI / CSM(Compatibility Support Mode)/BIOS ● Boot Loader – Extensible Firmware Interface (EFI) – Unified Extensible Firmware Interface(UEFI) written in C ● Boot Partition Format – Boot loader support also depends on type of partition ● MBR(Master Boot Record) disk partition ● GPT(GUID Partion Table) disk partition
  • 7. Custom boot.asm● org 0x7C00 ;BIOS loads program here ● bits 16 ;16-bit mode ● start: ● cli ;Disable Interrupts ● mov si, welcm ;SI points to custom data ● mov ah, 0x0E ; Tell BIOS to print characters ● .loop lodsb ;load byte into AL – or al, al – jz halt – jmp .loop ● halt: hlt ● welcm: db “Embedkari Welcomes You! “ ● times 510 - ($ - $$) db 0 ;Fills remaining bytes except last two ● dw 0xAA55
  • 8. Custom boot sector Experiment ● nasm(Netwide Assembler) Open source s/w for x86 – sudo apt update – Check and install build-essential if not present – sudo apt list | grep build | grep essential – sudo apt install nasm ● nasm boot.asm -f bin -o boot.bin ● You may verify assembly listing using – nasm boot.asm -l boot.lst ● Check the binary in QEMU ● qemu-system-i386 -fda boot.bin
  • 10. Program boot.bin to USB ● USB data can be verified if required ● Start Cygwin as adminstrator ● dd if=/dev/sdb bs=512 count=4 of=test.bin
  • 11. U-Boot-x86 @QEMU ● git clone git://git.denx.de/u-boot-x86.git ● cd u-boot-x86 ● export BUILD_ROM=y ● make qemu-x86_defconfig ● make all ● Test U-boot in QEMU ● qemu-system-i386 -nographic -bios u- boot.rom -net nic -net user,tftp=/tftpboot
  • 12. U-Boot build issue ● You may get error due to absence of required Libraries and this may lead to following additional installation ● For missing swig – sudo apt install swig ● For Python 2 – sudo apt install python-dev ● For Python 3 – sudo apt install python3-dev
  • 14. THANKS If you found this information usefule < Please like this video AND subscribe to www.youtube.com/c/embedkari Embedded Career Information : www.facebook.com/embedkari Blog:www.embedkari.com