SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
1
Mixing it up with EFI mixed mode
Matt Fleming, SSG/OTC
2
Debian 8 “Jessie” release
“Support for mixed-mode EFI systems like the Intel Bay
Trail: a 64-bit platform crippled with a 32-bit EFI
firmware.”
3
What is EFI mixed mode?
• Fat 64-bit OS on small 32-bit EFI firmware
• Implemented in the x86 kernel
• Translates x86-64 ABI to i386
• Utilises full capabilities of CPU
• Increases virtual address space
4
How does it work?
2 Phases
5
How does it work?
2 Phases
Boot transition Runtime thunking
6
Boot transition
7
Boot transition – Traditional entry point
64-bit kernel image
efi64_stub_entry
• Boot loaders always enter via native entry point
• Legacy +512 bytes for 64-bit loaders
64-bit boot loader
bootx64.efi
8
Boot transition – Mixed mode entry points
64-bit kernel image
efi64_stub_entry
efi32_stub_entry
• 2 entry points are available
• No changes required to Linux boot loaders
• All magic happens in the kernel
• 1 kernel image for both scenarios
32-bit/64-bit boot loaders
bootia32.efi
512bytes
bootx64.efi
9
Runtime transition
(Thunking)
10
Thunking at runtime
• Dedicated kernel page table
• UEFI regions are mapped with VA == PA
• Physical addresses are passed to UEFI
• Luckily never seen address above 4GB
0xffffffffffffffff
0x0
0xffffffff
Virtual AddressesPhysical Addresses
Kernel text/data
11
Thunking at runtime
0x000000fde3c190
1. Convert pointers to physical address
0xffff8800fde3c190
2. Truncate to 32-bits
12
Thunking at runtime
0xfde3c190
3. Push arguments onto stack (convert ABI)
4. Switch to 32-bit CPU mode and call UEFI
0x000000340fdece
0xfde45080
0x000000fde3c190
Stack
0x340fdece
Registers
13
Development gotchas
• “unsigned long” no longer represents natural pointer size
• Some UEFI runtime services not supported (UpdateCapsule())
• If memory existed above 4GB: kaboom!
14
Supported boot loaders
• Grub2
• Used by Debian, Fedora, Ubuntu
• Efilinux
• Kernel support developed using efilinux
• rEFInd
• Support unconfirmed
• Syslinux
15
A quick word on gummiboot
• Gummiboot is an UEFI application loader not a boot loader
• It has no understanding of the different Linux kernel entry points
• It simply uses the UEFI boot services to load and run applications
• Linux kernel masquerades as PE/COFF application
16
Ingredients for rolling your own solution
• 32-bit boot loader from the supported list
• Drop it in EFI System Partition (ESP) at EFIBOOTBOOTIA32.EFI
• Build your x86 kernel with the following options
• CONFIG_EFI_STUB
• CONFIG_EFI_MIXED
• Profit!
17
Q & A

Mais conteúdo relacionado

Mais procurados

A Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech ThingA Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech Thingyeokm1
 
Description of GRUB 2
Description of GRUB 2Description of GRUB 2
Description of GRUB 2iamumr
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedureDhaval Kaneria
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting ProcessGaurav Sharma
 
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-knowbccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-knowICS User Group
 
Simple Sheet for resource calculation of openstack compute node
Simple Sheet for resource calculation of openstack compute nodeSimple Sheet for resource calculation of openstack compute node
Simple Sheet for resource calculation of openstack compute nodeAsmaa Ibrahim
 
Determine 64 or 32 bit unix kernel and hw
Determine  64 or 32 bit unix kernel and hwDetermine  64 or 32 bit unix kernel and hw
Determine 64 or 32 bit unix kernel and hwMuqthiyar Pasha
 
OpenIO Summit'17 - ARM, Object Storage and more
OpenIO Summit'17 - ARM, Object Storage and moreOpenIO Summit'17 - ARM, Object Storage and more
OpenIO Summit'17 - ARM, Object Storage and moreOpenIO Object Storage
 
Yum server ( FTP Server )
Yum server ( FTP Server ) Yum server ( FTP Server )
Yum server ( FTP Server ) MOHSIN HASAN
 

Mais procurados (20)

A Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech ThingA Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech Thing
 
Pentium processor
Pentium processorPentium processor
Pentium processor
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Os2
Os2Os2
Os2
 
Description of GRUB 2
Description of GRUB 2Description of GRUB 2
Description of GRUB 2
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Grub
GrubGrub
Grub
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting Process
 
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-knowbccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
bccon-2014 adm04 ibm-domino-64bit-all-you-need-to-know
 
Linux booting sequence
Linux booting sequenceLinux booting sequence
Linux booting sequence
 
Linux kernel booting
Linux kernel bootingLinux kernel booting
Linux kernel booting
 
Simple Sheet for resource calculation of openstack compute node
Simple Sheet for resource calculation of openstack compute nodeSimple Sheet for resource calculation of openstack compute node
Simple Sheet for resource calculation of openstack compute node
 
Make own you kernel os
Make own you kernel osMake own you kernel os
Make own you kernel os
 
Determine 64 or 32 bit unix kernel and hw
Determine  64 or 32 bit unix kernel and hwDetermine  64 or 32 bit unix kernel and hw
Determine 64 or 32 bit unix kernel and hw
 
Linux booting process
Linux booting processLinux booting process
Linux booting process
 
QEMU in Cross building
QEMU in Cross buildingQEMU in Cross building
QEMU in Cross building
 
MySQL on ZFS
MySQL on ZFSMySQL on ZFS
MySQL on ZFS
 
OpenIO Summit'17 - ARM, Object Storage and more
OpenIO Summit'17 - ARM, Object Storage and moreOpenIO Summit'17 - ARM, Object Storage and more
OpenIO Summit'17 - ARM, Object Storage and more
 
Linux kernel development
Linux kernel developmentLinux kernel development
Linux kernel development
 
Yum server ( FTP Server )
Yum server ( FTP Server ) Yum server ( FTP Server )
Yum server ( FTP Server )
 

Semelhante a Mixing it up with EFI mixed mode

BlueHat v18 || First strontium uefi rootkit unveiled
BlueHat v18 || First strontium uefi rootkit unveiledBlueHat v18 || First strontium uefi rootkit unveiled
BlueHat v18 || First strontium uefi rootkit unveiledBlueHat Security Conference
 
Unified Extensible Firmware Interface (UEFI)
Unified Extensible Firmware Interface (UEFI)Unified Extensible Firmware Interface (UEFI)
Unified Extensible Firmware Interface (UEFI)k33a
 
Raj Amrutiya PPT.pptx
Raj Amrutiya PPT.pptxRaj Amrutiya PPT.pptx
Raj Amrutiya PPT.pptxRajAmrutiya1
 
Linux booting process, Dual booting, Components involved
Linux booting process, Dual booting, Components involvedLinux booting process, Dual booting, Components involved
Linux booting process, Dual booting, Components involveddivyammo
 
Emulating Game Boy in Java
Emulating Game Boy in JavaEmulating Game Boy in Java
Emulating Game Boy in JavaTomasz Rękawek
 
XPDS14 - Xen in EFI World - Daniel Kiper, Oracle
XPDS14 - Xen in EFI World - Daniel Kiper, OracleXPDS14 - Xen in EFI World - Daniel Kiper, Oracle
XPDS14 - Xen in EFI World - Daniel Kiper, OracleThe Linux Foundation
 
1 study of motherboard
1 study of motherboard1 study of motherboard
1 study of motherboardAnkit Dubey
 
Getting started with LinuxBoot Firmware on AArch64 Server
Getting started with LinuxBoot Firmware on AArch64 Server Getting started with LinuxBoot Firmware on AArch64 Server
Getting started with LinuxBoot Firmware on AArch64 Server Naohiro Tamura
 
DEF CON 27 - JEFF DILEO - evil e bpf in depth
DEF CON 27 - JEFF DILEO - evil e bpf in depthDEF CON 27 - JEFF DILEO - evil e bpf in depth
DEF CON 27 - JEFF DILEO - evil e bpf in depthFelipe Prado
 
What's going on with SPI
What's going on with SPI What's going on with SPI
What's going on with SPI Mark Brown
 
LCA2018 Open Hardware MiniConference: LoliBot Software
LCA2018 Open Hardware MiniConference: LoliBot SoftwareLCA2018 Open Hardware MiniConference: LoliBot Software
LCA2018 Open Hardware MiniConference: LoliBot SoftwareAndy Gelme
 
BIOS__Power-On-Self-Test.pptx
BIOS__Power-On-Self-Test.pptxBIOS__Power-On-Self-Test.pptx
BIOS__Power-On-Self-Test.pptxSamiWhoo
 
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary DemosMM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary DemosAMD Developer Central
 
Pharo 64bits
Pharo 64bitsPharo 64bits
Pharo 64bitsPharo
 
Signature verification of hibernate snapshot
Signature verification of hibernate snapshotSignature verification of hibernate snapshot
Signature verification of hibernate snapshotjoeylikernel
 

Semelhante a Mixing it up with EFI mixed mode (20)

BlueHat v18 || First strontium uefi rootkit unveiled
BlueHat v18 || First strontium uefi rootkit unveiledBlueHat v18 || First strontium uefi rootkit unveiled
BlueHat v18 || First strontium uefi rootkit unveiled
 
Unified Extensible Firmware Interface (UEFI)
Unified Extensible Firmware Interface (UEFI)Unified Extensible Firmware Interface (UEFI)
Unified Extensible Firmware Interface (UEFI)
 
Raj Amrutiya PPT.pptx
Raj Amrutiya PPT.pptxRaj Amrutiya PPT.pptx
Raj Amrutiya PPT.pptx
 
Boot process: BIOS vs UEFI
Boot process: BIOS vs UEFIBoot process: BIOS vs UEFI
Boot process: BIOS vs UEFI
 
Linux booting process, Dual booting, Components involved
Linux booting process, Dual booting, Components involvedLinux booting process, Dual booting, Components involved
Linux booting process, Dual booting, Components involved
 
Emulating Game Boy in Java
Emulating Game Boy in JavaEmulating Game Boy in Java
Emulating Game Boy in Java
 
XPDS14 - Xen in EFI World - Daniel Kiper, Oracle
XPDS14 - Xen in EFI World - Daniel Kiper, OracleXPDS14 - Xen in EFI World - Daniel Kiper, Oracle
XPDS14 - Xen in EFI World - Daniel Kiper, Oracle
 
1 study of motherboard
1 study of motherboard1 study of motherboard
1 study of motherboard
 
3 hardware
3 hardware3 hardware
3 hardware
 
Getting started with LinuxBoot Firmware on AArch64 Server
Getting started with LinuxBoot Firmware on AArch64 Server Getting started with LinuxBoot Firmware on AArch64 Server
Getting started with LinuxBoot Firmware on AArch64 Server
 
Radius
RadiusRadius
Radius
 
DEF CON 27 - JEFF DILEO - evil e bpf in depth
DEF CON 27 - JEFF DILEO - evil e bpf in depthDEF CON 27 - JEFF DILEO - evil e bpf in depth
DEF CON 27 - JEFF DILEO - evil e bpf in depth
 
What's going on with SPI
What's going on with SPI What's going on with SPI
What's going on with SPI
 
LCA2018 Open Hardware MiniConference: LoliBot Software
LCA2018 Open Hardware MiniConference: LoliBot SoftwareLCA2018 Open Hardware MiniConference: LoliBot Software
LCA2018 Open Hardware MiniConference: LoliBot Software
 
Chapter5ccna
Chapter5ccnaChapter5ccna
Chapter5ccna
 
BIOS__Power-On-Self-Test.pptx
BIOS__Power-On-Self-Test.pptxBIOS__Power-On-Self-Test.pptx
BIOS__Power-On-Self-Test.pptx
 
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary DemosMM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
MM-4105, Realtime 4K HDR Decoding with GPU ACES, by Gary Demos
 
Pharo 64bits
Pharo 64bitsPharo 64bits
Pharo 64bits
 
Signature verification of hibernate snapshot
Signature verification of hibernate snapshotSignature verification of hibernate snapshot
Signature verification of hibernate snapshot
 
02-OS-review.pptx
02-OS-review.pptx02-OS-review.pptx
02-OS-review.pptx
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Último (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Mixing it up with EFI mixed mode

  • 1. 1 Mixing it up with EFI mixed mode Matt Fleming, SSG/OTC
  • 2. 2 Debian 8 “Jessie” release “Support for mixed-mode EFI systems like the Intel Bay Trail: a 64-bit platform crippled with a 32-bit EFI firmware.”
  • 3. 3 What is EFI mixed mode? • Fat 64-bit OS on small 32-bit EFI firmware • Implemented in the x86 kernel • Translates x86-64 ABI to i386 • Utilises full capabilities of CPU • Increases virtual address space
  • 4. 4 How does it work? 2 Phases
  • 5. 5 How does it work? 2 Phases Boot transition Runtime thunking
  • 7. 7 Boot transition – Traditional entry point 64-bit kernel image efi64_stub_entry • Boot loaders always enter via native entry point • Legacy +512 bytes for 64-bit loaders 64-bit boot loader bootx64.efi
  • 8. 8 Boot transition – Mixed mode entry points 64-bit kernel image efi64_stub_entry efi32_stub_entry • 2 entry points are available • No changes required to Linux boot loaders • All magic happens in the kernel • 1 kernel image for both scenarios 32-bit/64-bit boot loaders bootia32.efi 512bytes bootx64.efi
  • 10. 10 Thunking at runtime • Dedicated kernel page table • UEFI regions are mapped with VA == PA • Physical addresses are passed to UEFI • Luckily never seen address above 4GB 0xffffffffffffffff 0x0 0xffffffff Virtual AddressesPhysical Addresses Kernel text/data
  • 11. 11 Thunking at runtime 0x000000fde3c190 1. Convert pointers to physical address 0xffff8800fde3c190 2. Truncate to 32-bits
  • 12. 12 Thunking at runtime 0xfde3c190 3. Push arguments onto stack (convert ABI) 4. Switch to 32-bit CPU mode and call UEFI 0x000000340fdece 0xfde45080 0x000000fde3c190 Stack 0x340fdece Registers
  • 13. 13 Development gotchas • “unsigned long” no longer represents natural pointer size • Some UEFI runtime services not supported (UpdateCapsule()) • If memory existed above 4GB: kaboom!
  • 14. 14 Supported boot loaders • Grub2 • Used by Debian, Fedora, Ubuntu • Efilinux • Kernel support developed using efilinux • rEFInd • Support unconfirmed • Syslinux
  • 15. 15 A quick word on gummiboot • Gummiboot is an UEFI application loader not a boot loader • It has no understanding of the different Linux kernel entry points • It simply uses the UEFI boot services to load and run applications • Linux kernel masquerades as PE/COFF application
  • 16. 16 Ingredients for rolling your own solution • 32-bit boot loader from the supported list • Drop it in EFI System Partition (ESP) at EFIBOOTBOOTIA32.EFI • Build your x86 kernel with the following options • CONFIG_EFI_STUB • CONFIG_EFI_MIXED • Profit!