Nios® II Processor Reference Guide

ID 683836
Date 8/28/2023
Public
Document Table of Contents

7.9.4. Linux Process Initialization

The stack pointer, sp, points to the argument count on the stack.
Table 86.  Stack Initial State at User Process Start
Purpose Start Address Length
Unspecified High addresses  
Referenced strings   Varies
Unspecified    
Null auxilliary vector entry   4 bytes
Auxilliary vector entries   8 bytes each
NULL terminator for envp   4 bytes
Environment pointers sp + 8 + 4 × argc 4 bytes each
NULL terminator for argv sp + 4 + 4 × argc 4 bytes
Argument pointers sp + 4 4 bytes each
Argument count sp 4 bytes
Unspecified Low addresses  

If the application should register a destructor function with atexit, the pointer is placed in r4. Otherwise r4 is zero.

The contents of all other registers are unspecified. User code should set fp to zero to mark the end of the frame chain.

The auxiliary vector is a series of pairs of 32-bit tag and 32-bit value, terminated by an AT_NULL tag.