Nios II Classic Processor Reference Guide

ID 683620
Date 10/28/2016
Document Table of Contents

7.9.4. Linux Process Initialization

The stack pointer, sp, points to the argument count on the stack.
Table 95.  Stack Initial State at User Process Start
Purpose Start Address Length
Unspecified High addresses  
Referenced strings   Varies
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.