Chaitu Tech Bits

what is segmentation ? how to overcome segmentation

Wednesday, December 15, 2010


In computing, memory segmentation is one of the most common ways to achieve memory protection; another common one is paging.

In a computer system using segmentation, an instruction operand that refers to a memory location includes a value that identifies a segment and an offset within that segment.

A segment has a set of permissions, and a length, associated with it.
If the currently running process is allowed by the permissions to make the type of reference to memory that it is attempting to make, and the offset within the segment is within the range specified by the length of the segment, the reference is permitted; otherwise, a hardware exception is raised.


Moreover, as well as its set of permissions and length, a segment also has associated with it information indicating where the segment is located in memory. It may also have a flag indicating whether the segment is present in main memory or not; if the segment is not present in main memory, an exception is raised, and the operating system will read the segment into memory from secondary storage. The information indicating where the segment is located in memory might be the address of the first location in the segment, or might be the address of a page table for the segment, if the segmentation is implemented with paging. In the first case, if a reference to a location within a segment is made, the offset within the segment will be added to address of the first location in the segment to give the address in memory of the referred-to item; in the second case, the offset of the segment is translated to a memory address using the page table.

Build and Integration
---------------------
What the build and integration process
What are the outcome once the build completed How much time take to complete the build What are the conflicts faced while doing build

PS/DD/Embedded questions. Most of the questions are simple on C/C++/Data Structures/OS Concepts
1.Optimum way to remove spaces from a given string.(one function use single buffer only, pointer to  which is passed)
char temp;
for (i=0; i<n/2; i++)
{
if(str[i] = “ “)
{
            for(j=i;j<=n-i;j++)
            {
                        Str[j] = str[j+1];
            }
}
           
           
temp = str[i];
str[i] =str[n-1-i];
str[n-1-i] = temp;
}
2.Find error in a given program (non integer integer to ASCIII string conversion.) 3.Design a scheduler (Way the interview went question may not necessarily be the same) 4.Questions on project(GPS, in my case).
5.Questions on memory organization.

Memory Related Questions:
Data segment, Code Segment, Stack, Heap, Auto, Static, Register
Share/Bookmark

Related Posts Plugin for WordPress, Blogger...