What Is Paging In Operating System?

  • Characteristics of Paging
  • Address Translation
  • Page Table (PT)
  • Paging with TLB
  • Advantages of Paging
  • Disadvantages of Paging
  • Finds a sufficient number of empty page frames to assist.
  • All pages must be contiguous to be loaded into memory.

Characteristics of Paging

  • External fragmentation is not present.
  • By procedure, any frame may be employed.
  • Only on the last page of a process, internal fragmentation may occur.
  • A process’s physical memory is no longer contiguous.
  • A process’ s logical memory is still contiguous.

Example of Paging

Address Translation

  • Page Number (p)
  • Page Offset (d)
  • Frame Number (f)
  • Frame Offset (d)

Page Table (PT)

Page Table Entry

  • Frame Number: The frame number identifies the memory frames in paging in which the page is stored. The size of the frame number is determined by the number of frames in the main memory. Number of bits for frame = Size of Physical memory/Frame size.
  • Present/Absent Bit: This bit is also referred to as the valid/invalid bit. This bit indicates whether or not the page is in the main memory space. This bit is set to 0 if the page is not available in the main memory; otherwise, it is set to 1.
  • Protection bit: This bit is also known as the “Read / Write bit.” This bit is about page security. It determines whether or not the user has permission to read and write to the page. This bit is set to 0 if only read operations are allowed and no writing operations are allowed. If both read and write operations are permitted, this bit will be set to 1.
  • Reference bit: The reference bit indicates whether or not the page was referred to in the previous clock cycle. If the page has recently been referenced, this bit is set to 1, otherwise, it is set to 0.
  • Caching Enabled/Disabled: The reference bit indicates whether or not the page was referred to in the previous clock cycle. If the page has recently been referenced, this bit is set to 1, otherwise, it is set to 0.
  • Dirty bit: This bit is also known as the “Modified bit.” This bit indicates whether or not the page has been changed. This bit is set to 1 if the page has been updated; otherwise, it is set to 0.
  • In the main memory, a single-level page table is stored.
  • Main Memory stores a multi-level page table.
  • Single or multilevel page tables, associative memory (Register or TLB), and associative memory (Register or TLB).
  • Page table that is inverted.

Single Level Page Table

Multi-Level Page Table

  • The level-0 page table’s entries are pointers to a level-1 page table.
  • The level-1 page table’s entries are pointers to a level-2 page table.

Paging with TLB (Translation Look-aside Buffer)

Advantages of Paging

  • Memory management that is effective.
  • Simplicity in partitioning (non-contiguous memory allocation).
  • Allocating memory is simple and inexpensive.
  • Pages are simple to share.
  • No compaction is necessary.
  • no external fragmentation.
  • more efficient swapping.

Disadvantages of Paging

  • Internal fragmentation (only at the last page of the process).
  • Address translation necessitates the use of specialized hardware.
  • The page table is stored in the main memory.
  • Address translation lengthens memory cycle times.
  • Memory reference overhead is caused by multi-level paging.
  • Memory access time is longer.
  1. 10 Best React Projects Ideas You Must Build in 2022
  2. Difference Between Hardware and Software
  3. 10 Most Important Programming Language for AI
  4. Difference Between JavaScript And jQuery

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store