Paging
Both unequal fixed size and variable size partitions are inefficient in the use of memory. It has been observed that both schemes lead to memory wastage. Therefore we are not using the memory efficiently. There is another scheme for use of memory which is known as paging. In this scheme, The memory is partitioned into equal fixed size chunks that are relatively small. This chunk of memory is known as frames or page frames. Each process is also divided into small fixed chunks of same size. The chunks of a program is known as pages. A page of a program could be assigned to available page frame. In this scheme, the wastage space in memory for a process is a fraction of a page frame which corresponds to the last page of the program. At a given point of time some of the frames in memory are in use and some are free. The list of free frame is maintained by the operating system.
Process A , stored in disk , consists of pages . At the time of execution of the process A, the operating system finds six free frames and loads the six pages of the process A into six frames. These six frames need not be contiguous frames in main memory. The operating system maintains a page table for each process. Within the program, each logical address consists of page number and a relative address within the page. In case of simple partitioning, a logical address is the location of a word relative to the beginning of the program; the processor translates that into a physical address. With paging, a logical address is a location of the word relative to the beginning of the page of the program, because the whole program is divided into several pages of equal length and the length of a page is same with the length of a page frame. A logical address consists of page number and relative address within the page, the process uses the page table to produce the physical address which consists of frame number and relative address within the frame. The figure on next page shows the allocation of frames to a new process in the main memory. A page table is maintained for each process. This page table helps us to find the physical address in a frame which corresponds to a logical address within a process.
Both unequal fixed size and variable size partitions are inefficient in the use of memory. It has been observed that both schemes lead to memory wastage. Therefore we are not using the memory efficiently. There is another scheme for use of memory which is known as paging. In this scheme, The memory is partitioned into equal fixed size chunks that are relatively small. This chunk of memory is known as frames or page frames. Each process is also divided into small fixed chunks of same size. The chunks of a program is known as pages. A page of a program could be assigned to available page frame. In this scheme, the wastage space in memory for a process is a fraction of a page frame which corresponds to the last page of the program. At a given point of time some of the frames in memory are in use and some are free. The list of free frame is maintained by the operating system.
Process A , stored in disk , consists of pages . At the time of execution of the process A, the operating system finds six free frames and loads the six pages of the process A into six frames. These six frames need not be contiguous frames in main memory. The operating system maintains a page table for each process. Within the program, each logical address consists of page number and a relative address within the page. In case of simple partitioning, a logical address is the location of a word relative to the beginning of the program; the processor translates that into a physical address. With paging, a logical address is a location of the word relative to the beginning of the page of the program, because the whole program is divided into several pages of equal length and the length of a page is same with the length of a page frame. A logical address consists of page number and relative address within the page, the process uses the page table to produce the physical address which consists of frame number and relative address within the frame. The figure on next page shows the allocation of frames to a new process in the main memory. A page table is maintained for each process. This page table helps us to find the physical address in a frame which corresponds to a logical address within a process.
No comments
Post a Comment