2019-07-15 04:50:16 UTC
processes, minix, have memory divided into segment: text, data, and stack
text is the code
data are the variables
my question is about the data segment and the stack segment
the data segment are the variables that are global, static in the
the stack are variables automatic, local in a program?
no instructions are ever placed on the stack right? they are
all in the text segment.
question example: if a C program has 5 functions and one main(),
each function was two logical variables and one static variable, main() has two
logical variables and the program has one global variable
then the instructions of what to do are all in the text segment?
the data segment has the global variable, and 1 static variable
from each functions?
the stack grows and shrinks as functions are called and the logical
variables of each function is placed on the stack as function is called
and removed from the stack when the function finishes( exits or return)
control to the calling function?
once the program is compiled and running does the data stack grow any more?
does UNIX have more segments?