SlideShare a Scribd company logo
2
Most read
3
Most read
* Based on kernel 6.2 (x86_64) – QEMU
* 2-socket CPUs (4 cores/socket)
* 16GB memory
* Kernel parameter: nokaslr norandmaps
* KASAN: disabled
* Userspace: ASLR is disabled
* Host OS: Ubuntu 20.04.1
qemu + gdb + sample_code: Run sample code in
QEMU OS and observe Linux Kernel behavior
Adrian Huang | Apr, 2023
qemu + gdb: The efficient way to
understand/debug Linux kernel code/data
structure
Refer this slide first:
Console #2: gdb console
Console #1: QEMU: Guest OS
Observe page fault behavior about mmap address:
Conditional breakpoint
gdb-files/gdb-linux-kernel-real-mode.txt
• 0x7ffff7ff9000 is the mmap address provide by Linux Kernel
 Reference: Memory Mapping Implementation (mmap) in Linux Kernel
• Sample code to trigger the conditional breakpoint: t_mmap.c
Note

More Related Content

PDF
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
PDF
Physical Memory Models.pdf
PDF
malloc & vmalloc in Linux
PDF
Physical Memory Management.pdf
PDF
Process Address Space: The way to create virtual address (page table) of user...
PDF
Page cache in Linux kernel
PDF
semaphore & mutex.pdf
PDF
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
Physical Memory Models.pdf
malloc & vmalloc in Linux
Physical Memory Management.pdf
Process Address Space: The way to create virtual address (page table) of user...
Page cache in Linux kernel
semaphore & mutex.pdf
Vmlinux: anatomy of bzimage and how x86 64 processor is booted

What's hot (20)

PPTX
Linux Kernel Booting Process (2) - For NLKB
PDF
Arm device tree and linux device drivers
PDF
Memory Mapping Implementation (mmap) in Linux Kernel
PPTX
Linux Initialization Process (1)
PPTX
Slab Allocator in Linux Kernel
PDF
Memory Management with Page Folios
PDF
Linux Kernel - Virtual File System
PDF
spinlock.pdf
PDF
Memory Compaction in Linux Kernel.pdf
PDF
Decompressed vmlinux: linux kernel initialization from page table configurati...
PPTX
Linux Kernel Booting Process (1) - For NLKB
ODP
Linux Internals - Kernel/Core
PDF
LISA2019 Linux Systems Performance
PDF
The Linux Block Layer - Built for Fast Storage
PPTX
U-Boot Porting on New Hardware
PDF
Reverse Mapping (rmap) in Linux Kernel
PDF
Qemu device prototyping
PPTX
Linux Device Tree
PDF
Linux Synchronization Mechanism: RCU (Read Copy Update)
Linux Kernel Booting Process (2) - For NLKB
Arm device tree and linux device drivers
Memory Mapping Implementation (mmap) in Linux Kernel
Linux Initialization Process (1)
Slab Allocator in Linux Kernel
Memory Management with Page Folios
Linux Kernel - Virtual File System
spinlock.pdf
Memory Compaction in Linux Kernel.pdf
Decompressed vmlinux: linux kernel initialization from page table configurati...
Linux Kernel Booting Process (1) - For NLKB
Linux Internals - Kernel/Core
LISA2019 Linux Systems Performance
The Linux Block Layer - Built for Fast Storage
U-Boot Porting on New Hardware
Reverse Mapping (rmap) in Linux Kernel
Qemu device prototyping
Linux Device Tree
Linux Synchronization Mechanism: RCU (Read Copy Update)
Ad

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
history of c programming in notes for students .pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
System and Network Administraation Chapter 3
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Introduction to Artificial Intelligence
PDF
Nekopoi APK 2025 free lastest update
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
medical staffing services at VALiNTRY
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
Odoo Companies in India – Driving Business Transformation.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
history of c programming in notes for students .pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
System and Network Administraation Chapter 3
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Wondershare Filmora 15 Crack With Activation Key [2025
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Introduction to Artificial Intelligence
Nekopoi APK 2025 free lastest update
Which alternative to Crystal Reports is best for small or large businesses.pdf
medical staffing services at VALiNTRY
How Creative Agencies Leverage Project Management Software.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
2025 Textile ERP Trends: SAP, Odoo & Oracle
VVF-Customer-Presentation2025-Ver1.9.pptx
Ad

qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel behavior

  • 1. * Based on kernel 6.2 (x86_64) – QEMU * 2-socket CPUs (4 cores/socket) * 16GB memory * Kernel parameter: nokaslr norandmaps * KASAN: disabled * Userspace: ASLR is disabled * Host OS: Ubuntu 20.04.1 qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel behavior Adrian Huang | Apr, 2023
  • 2. qemu + gdb: The efficient way to understand/debug Linux kernel code/data structure Refer this slide first:
  • 3. Console #2: gdb console Console #1: QEMU: Guest OS Observe page fault behavior about mmap address: Conditional breakpoint gdb-files/gdb-linux-kernel-real-mode.txt • 0x7ffff7ff9000 is the mmap address provide by Linux Kernel  Reference: Memory Mapping Implementation (mmap) in Linux Kernel • Sample code to trigger the conditional breakpoint: t_mmap.c Note