To understand firmware, you have to visualize the stack: