20091015 - C Runtime Environment NACHOS supports an...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: C Runtime Environment NACHOS supports an application runtime environment that is much like that provided to C programs by original versions of Unix. The next several slides cover things you need to know about C and this runtime environment in order to work on NACHOS. C Storage Classes Variables in C have one of the following storage classes : static variables are not associated with any function activation and persist throughout program execution. automatic variables are associated with a particular function activation, and are deleted when that activation terminates. Also, Global variables in C are static . Local variables in C are automatic by default, but can also be declared static . C Storage Classes: Example /* Globals are declared outside any functions. */ int x; /* A static global variable. */ static int y = 3; /* Another, with initializer. */ /*auto int z;*/ /* An error! */ /* Locals are declared inside of functions. */ void f(int a) { /* Arguments are automatic. */ int w; /* An automatic local variable. */ auto int v; /* Another of the same */ static int u; /* A static local variable. */ ... } Segments of the C Address Space The address space of a running C application is divided into four segments : The text segment (read-only) contains the binary executable code....
View Full Document

Page1 / 22

20091015 - C Runtime Environment NACHOS supports an...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online