Page 135 - DCAP403_Operating System
P. 135

Operating System




                    Notes                        Figure 7.7: Sharing of Segments in a Segmented Memory System




                                                    editor

                                                  segment 0                    43062
                                                                     limit  base
                                                         data 1    0 25286 43062
                                                       segment 1   1  4425 68348       editor
                                                                    segment table
                                                   logical memory    process P 1  68348  data 1
                                                     process P 1               72773


                                                                               90003
                                                    editor                             data 2
                                                                               98553
                                                  segment 0
                                                         data 2      limit  base   physical memory
                                                                   0 25286 43062
                                                       segment 1   1  8850 90003
                                                                    segment table
                                                   logical memory    process P
                                                     process P 2            2




                                       Task    Differentiate between paging and segmentation technique.


                                   7.7 Segmentation with Paging

                                                      Figure 7.8: Diagram of Segmentation with Paging

                                            Virtual Address
                                         Seg# Page# Offset












                                                                                           Main Memory




                                                   Segment Table   Page Table

                                   Segments can be of different lengths, so it is harder to find a place for a segment in memory than
                                   a page. With segmented virtual memory, you get the benefits of virtual memory but you still

                                   have to do dynamic storage allocation of physical memory. In order to avoid this, it is possible
                                   to combine segmentation and paging into a two-level virtual memory system. Each segment



          128                              LOVELY PROFESSIONAL UNIVERSITY
   130   131   132   133   134   135   136   137   138   139   140