Skip to Content
Programming Embedded Systems in C and C++
book

Programming Embedded Systems in C and C++

by Michael Barr
January 1999
Beginner to intermediate
200 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Programming Embedded Systems in C and C++
Building das Blinkenlights 27
text rom : /* The actual instructions. */
{
*(.text)
}
}
This script informs the GNU linker’s built-in locator about the memory on the tar-
get board and instructs it to locate the data and bss sections in RAM (starting at
address 0x00000) and the text section in ROM (starting at 0x80000). However,
the initial values of the variables in the data segment will be made a part of the
ROM image by the addition of >rom at the end of that section’s definition.
All of the names that begin with underscores (_TopOfStack, for example) are
variables that can be referenced from within your source code. The linker will use
these symbols to resolve references in the input object files. So, for example, there
might be a part of the embedded software (usually within the startup code) that
copies the initial values of the initialized variables from ROM to the data section
in RAM. The start and stop addresses for this operation can be established symbol-
ically, by referring to the integer variables _DataStart and _DataEnd.
The result of this final step of the build process is an absolutely located binary
image that can be downloaded to the embedded system or programmed into a
read-only memory device. In the previous example, this memory image would be
exactly 1 MB in size. However, because the initial values for the initialized data
section are stored in ROM, the lower 512 kilobytes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

You might also like

Embedded Systems Object-Oriented Programming in C and C++

Embedded Systems Object-Oriented Programming in C and C++

Israel Gbati

Publisher Resources

ISBN: 1565923545Catalog PageErrata