liveBook · Manning

Virtual address

As explained in Embedded Software with Rust

A virtual address is the runtime address at which a program section or object is located and accessed.

A virtual memory address (VMA) is where a program section must reside during execution. In microcontroller examples, “virtual” is largely historical: there is no MMU translating virtual addresses to physical ones, so the addresses are treated as the same. section 4.1.1

A section’s VMA describes its runtime location; its load memory address (LMA) describes where its contents are stored at load time.

Idx Name         Size     VMA        LMA        File off  Algn
  0 .vector_table 00000040 08000000  08000000   00010000  2**2
  1 .text         00001a00 08000040  08000040   00010040  2**2
  2 .rodata       00000200 08001a40  08001a40   00011a40  2**2
  3 .data         00000100 20000000  08001c40   00014000  2**2
  4 .bss          00000080 20000100  20000100   00014100  2**2

Compare the VMA and LMA columns: .data has a RAM VMA and FLASH LMA, while .text has matching addresses. section 4.1.5

How Embedded Software with Rust covers it

How deep it goes
Defines VMA against LMA, traces .data relocation and .bss zeroing, and notes that microcontroller addresses are not MMU-translated.
Examples
Uses Rust statics, section mappings, and cargo objdump output to illustrate runtime addresses.
What you can do after
Diagnose section placement with cargo objdump by checking VMAs against intended FLASH and RAM regions.
How it connects
Connects virtual address to load memory address, linker scripts, FLASH, RAM, and startup initialization.

Also explained in

Compare how 2 books explain virtual address →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Embedded Software with Rust. The section links point to the parts of the book it draws on.