APPENDIX CStartup Code
To understand the startup code, let us first understand various software components that make up a program.
C.1 OS-LESS SYSTEM
The system we have discussed in this book is standalone, without any operating system (OS), commonly known as a bare-metal system. Figure C.1 shows the structure of a typical OS-less system.
Figure C.1 Software components of a OS-less system
C.1.1 Vector Table
Vector table is the first component, typically located at address 0. This is the only component that needs to be at a fixed address; all other components can be placed in any order.
The first two entries of the vector table are initial stack pointer (SP) and the reset handler addresses. On reset, these are loaded into SP and program counter (PC) registers to begin program execution.
C.1.2 Exception Handlers
A program includes routines to handle various exceptions ...
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