codescracker


operating system os

OS Backing Store



« Previous Tutorial Next Tutorial »


The easiest algorithm for allocating the page space on disk is to have a special area on the disk. Basically, this special area is empty when the system is booted and is represented as a single entry giving its origin and size in the memory.

When first process is started when a chunk of swap area the size of the first process is reserved and remaining area is reduced by that amount.

Since the new processes are started, they are assigned chunks of swap area equal in size to their core images. Their disk space is freed when they finishes. And the swap area is managed as a list of free chunks. Associated with each process is the disk address of its swap area are kept in the process table.

It becomes too simple to calculate the address to write a page just by adding the offset of page within virtual address space to start of the swap area.

But the swap area must be initialized before a process can start. One way is to copy the whole process image to swap area so that it can be brought in as needed. And the other way is to load the whole process in memory and let it be paged out as needed.

But generally processes can increase in size when it is started. Here the program text is usually fixed, and sometime the data area can grow and stack can always grow.

Therefore, it is better to swap the reserve separate swap areas for text, data and the stack, allow each of the area consist of multiple chunk on disk.


« Previous Tutorial Next Tutorial »




Tools
Calculator

Quick Links
Signup - Login - Give Online Test