Segmentation
<div class="IPBDescription">Help Rellix Study For His Evil Prelim</div> <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Segmentation and virtual memory
Segmentation, being based on the structure of a program, enhances the effects of locality of reference. It also allows processes to share code and data, and allows dynamic allocation of memory to processes that use dynamic data structures. A segment can be allowed to grow.
The overheads, though, are really quite elaborate. Each segment needs a descriptor which will contain the base address of the segment, its size limit, a bit to indicate whether it's in real memory or not, a segment used bit, and various protection bits (especially important if a segment contains data that might be accessed by more than one process).<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Im studying for my pre-lim tomorw (fake exam used to appeal if my results suck on the real thing), and Im strugling to understand what exactly this is.
From my understanding its sorta like each program gets to share certain parts of memory if the code is similar.
Can anyone explain this better?
Segmentation, being based on the structure of a program, enhances the effects of locality of reference. It also allows processes to share code and data, and allows dynamic allocation of memory to processes that use dynamic data structures. A segment can be allowed to grow.
The overheads, though, are really quite elaborate. Each segment needs a descriptor which will contain the base address of the segment, its size limit, a bit to indicate whether it's in real memory or not, a segment used bit, and various protection bits (especially important if a segment contains data that might be accessed by more than one process).<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Im studying for my pre-lim tomorw (fake exam used to appeal if my results suck on the real thing), and Im strugling to understand what exactly this is.
From my understanding its sorta like each program gets to share certain parts of memory if the code is similar.
Can anyone explain this better?
Comments
Note that this is for a Unix environment, so if you're studying Windows I can't gurantee it'll be the same. I wasn't there for Thursday's notes, but here is (most) of what I did Tuesday. Perhaps it'll help:
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Segments
Memory layout of C program
<b><u>Text Segment</u></b> - portion of RAM that contains machine instructions to be executed. Usually re-entrant (non self-modifying) and therefore, sharable. Usually set up with read-only access.
<b><u>Initialized Data Segment</u></b> (aka Data Segment) - contains initialized variables that are storage class (external & static)
When a program is loaded for execution, additional segments are added to the <u>address scope</u> of the program/process.
<b><u>Uninitialized Data Segment</u></b> - contains variables of static & external data that were not initialized. The kernel initialized all bytes to 0 when memory is allocated.
<u><b>Stack Segment</b></u> (automatic variables) - contains runtime stack. activation records are pushed onto the runtime stack upon entry to a block and they are popped upon exit from the block.
<u>Activation record</u> - storage for formal arguments/parameters; storage for automatic variables; return value of the function; return address; size of the activation record
<u><b>Heap Segment</b></u> - segment alloted for dynamic memory allocation. allowed to grow
<u>address space</u> - space percieved to be available to process.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Hope this helps.
Im hoping this doesnt come up, or most of the stuff for that matter!
But thanks for the help Doom I hope it comes in handy.
Its part of the Operating Systems topic but it gives too much detail for soem things i dont need to know and not even mention stuff ill need to know for the exam. Fortunatly this is the last year of this course running with these exact topics so they wont make new questions up so i just look at the lasst few years exams papers and its a pretty good chance theyl come up. Still the original quote was ALL it said about segmentation leaving the mind to work out what it actualy means.
But as long as i can get part of the marks im happy:
Is it me or does this seem almost the exact same conecept as paging?
EDIT:
Just back from the exam, fortunatly this didnt come up, or at least i donth think it did. I was aiming for 45 to 50% but from how i think it when its probably clsoer to 60-70%.