Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
271 views5 pages

Paging in Operating System

PAGING IN OPERATING SYSTEM

Uploaded by

harishms276
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
271 views5 pages

Paging in Operating System

PAGING IN OPERATING SYSTEM

Uploaded by

harishms276
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

PAGING IN OPERATING SYSTEM(OS)

Paging is a memory management technique ,it is a process of retrieving a processes from


secondary memory to main memory in the terms of pages.

Paging permits the physical address space of a process to be non-contiguous. It is a fixed-


size partitioning scheme. In the Paging technique, the secondary memory and main
memory are divided into equal fixed-size partitions.

Paging solves the problem of fitting memory chunks of varying sizes onto the
backing store and this problem is suffered by many memory management schemes.

Paging helps to avoid external fragmentation and the need for compaction.

Basic Method of Paging:

The paging technique divides the physical memory(main memory) into fixed-size
blocks that are known as Frames and also divide the logical memory(secondary
memory) into blocks of the same size that are known as Pages.

This technique keeps the track of all the free frames.

The Frame has the same size as that of a Page. A frame is basically a place where a
(logical) page can be (physically) placed.
Each process is mainly divided into parts where the size of each part is the same as
the page size.

There is a possibility that the size of the last part may be less than the page size.

• Pages of a process are brought into the main memory only when there is a
requirement otherwise they reside in the secondary storage.
• One page of a process is mainly stored in one of the frames of the memory.
Also, the pages can be stored at different locations of the memory but always
the main priority is to find contiguous frames.

Translation of Logical Address into Physical Address:

• The CPU always generates a logical address.


• In order to access the main memory always a physical address is needed.

The logical address generated by CPU always consists of two parts:

1. Page Number(p)
2. Page Offset (d)

where,

Page Number is used to specify the specific page of the process from which the CPU
wants to read the data. and it is also used as an index to the page table.

and Page offset is mainly used to specify the specific word on the page that the CPU
wants to read.
Page Table in OS

The Page table mainly contains the base address of each page in the Physical
memory. The base address is then combined with the page offset in order to define
the physical memory address which is then sent to the memory unit.

Thus page table mainly provides the corresponding frame number (base address of
the frame) where that page is stored in the main memory.

As we know that the frame number is combined with the page offset and forms
the required physical address.

So, The physical address consists of two parts:

1. Page offset(d)
2. Frame Number(f)

where,

The Frame number is used to indicate the specific frame where the required page is
stored.

and Page Offset indicates the specific word that has to be read from that page.

The Page size (like the frame size) is defined with the help of hardware. It is
important to note here that the size of the page is typically the power of 2 that varies
between 512 bytes and 16 MB per page and it mainly depends on the architecture of
the computer.

If the size of logical address space is 2 raised to the power m and page size is 2
raised to the power n addressing units then the high order m-n bits of logical
address designates the page number and the n low-order bits designate the page
offset.

The logical address is as follows:

where p indicates the index into the page table, and d indicates the displacement
within the page.
The above diagram indicates the translation of the Logical address into the Physical
address. The PTBR in the above diagram means page table base register and it
basically holds the base address for the page table of the current process.

The PTBR is mainly a processor register and is managed by the operating system.
Commonly, each process running on a processor needs its own logical address
space.

HARISH M S

1SI22CS064

You might also like