notes - - This contains the elements are not initialized by...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
8/21/11 Every process consists of basically 4 portions of address space that are accessible to the process when it is running Text - This portion contains the actual m/c instructions to be executed. On many Operating Systems this is set to read only, so that the process can't modify its instructions. This allows multiple instances of the program to share the single copy of the text. Data - This portion contains the program's data part. It furthere divided into 1) Initialized Read Only Data - This contains the data elements that are initialized by the program and they are read only during the execution of the process. 2) Initialized Read Write Data - This contains the data elements that are initialized by the program and will be modified in the course of process execution. 3)Uninitalized Data
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: - This contains the elements are not initialized by the program and are set 0 before the processes executes. These can also be modified and referred as BSS(Block Started Symbol). The adv of such elements are, system doesn't have to allocate space in the program file for this area, b'coz it is initialized to 0 by OS before the process begins to execute. Stack - This portion is used for local variables, stack frames Heap - This portion contains the dynamically allocated memory Example :: int abc = 1; ----> Initialized Read-Write Data char *str; ----> BSS const int i = 10; -----> Initialized Read-Only Data main() { int ii,a=1,b=2,c; -----> Local Variables on Stack char *ptr; ptr = malloc(4); ------> Allocated Memory in Heap c= a+b; ------> Text }...
View Full Document

This note was uploaded on 01/22/2012 for the course COMPUTER S 302 taught by Professor Stewart during the Spring '11 term at N.C. State.

Ask a homework question - tutors are online