title: operating system memory allocation
body: <p>I understand each process is given a block of memory,which contains code segment,data segment ,heap and stack.And also that the code segment is read only.But when a process starts running,where is this read only memory allocated and how does the OS distinguish the read only 
  part of memory for each process?</p>