Page 130 - DCAP403_Operating System
P. 130

Unit 7: Memory Management




          operating system which reprogram the MMU to map the address to some physical memory,   Notes
          perhaps writing the old contents of that memory to disk and reading back from disk what the
          memory should contain at the new logical address. In this case, the logical address may be
          referred to as a virtual address.
          Logical vs. Physical Address Space


          An address generated by the CPU is commonly referred to as a logical address, whereas an
          address seen by the memory unit – that is, the one loaded into the memory-address register of
          the memory – is commonly referred to as a physical address.

          The compile-time and load-time address-binding methods generate identical logical and physical
          addresses. However, the execution-time address-binding scheme results in differing logical and
          physical addresses. In this case, you usually refer to the logical address as a virtual address.
          The set of all logical addresses generated by a program is a logical-address space; the set of all
          physical addresses corresponding to these logical addresses is a physical-address space. Thus, in
          the execution-time address-binding scheme, the logical- and physical-address spaces differ.

          7.3 Swapping


          Any operating system has a fixed amount of physical memory available. Usually, application
          need more than the physical memory installed on your system, for that purpose the operating
          system uses a swap mechanism: instead of storing data in physical memory, it uses a disk fi le.
          Swapping is the act of moving processes between memory and a backing store. This is done to
          free up available memory. Swapping is necessary when there are more processes than available
          memory. At the coarsest level, swapping is done a process at a time.
          To move a program from fast-access memory to a slow-access memory is known as “swap out”,

          and the reverse operation is known as “swap in”. The term often refers specifically to the use of
          a hard disk (or a swap file) as virtual memory or “swap space”.

          When a program is to be executed, possibly as determined by a scheduler, it is swapped into
          core for processing; when it can no longer continue executing for some reason, or the scheduler
          decides its time slice has expired, it is swapped out again.

                                     Figure 7.3: Memory Swapping



                                               SWAP-IN







                                               SWAP-OUT   Operating
                                Swapping device            system
                               (usually, a hard disk)     Memory





              Task    Differentiate PROM and EPROM type memory.






                                           LOVELY PROFESSIONAL UNIVERSITY                                   123
   125   126   127   128   129   130   131   132   133   134   135