Subscribe by Email

Thursday, April 11, 2013

What are different components of operating system? – Part 3

6.   Virtual memory: 
- This is that component of the operating system that lets it trick programs to use the memory that scattered all around the RAM and hard disk as one continuous memory location. 
- This chunk of memory is called the virtual memory.
- Using various means of virtual memory addressing such as segmentation and paging implies that it is up to the kernel for choosing the type of memory that might be used by the program at a given time. 
- This enables the use of same memory locations by the operating system for executing multiple tasks. 
- If a program makes an attempt for accessing memory that does not lie in the present range of memory that is accessible but has not been allocated, an interrupt is raised for the kernel in the same way as it would be done for the program if it would exceed its memory. 
- Such an interrupt is called as a page fault.
- When a page fault is detected by the kernel, the virtual memory range of the application is adjusted through which the access to memory is granted to it. 
- In this way, discretionary power is given to the kernel over the memory storage of a particular application. 
- The frequently accessed memory is stored temporarily on the hard disk or other types of media in today’s operating systems. 
- This is done to make some space for the other programs.
- This process is termed as swapping because a memory area is used by a number of programs and its contents can be exchanged or swapped with that of the other memory locations up on demand. 
- Virtual memory is a way of gaining a perception such that amount of RAM is larger than usual in the system.  

7. Multi – tasking: 
- Execution of multiple programs that are also independent on the same system is termed as multi–tasking. 
- It gives appearance that the tasks are being performed at the same time. 
There are computers that are capable of running at the most two programs simultaneously through the principle of time sharing. 
- A share of computer time is used by each of the programs for their execution. 
A piece of software known as the scheduler is contained in the operating system whose purpose is to determine how much time will be spent for the execution of every program, and in which order it would take place.
- It also determines how the control will be passed to the programs. 
- The kernel then passes the control to the process allowing the program to access the memory and the CPU. 
- Later on, through some mechanism the control is returned to the kernel so that CPU might be used by some other program. 
- This process of passing control between the application and the kernel is referred to as the context switch. 
- The concepts concerning the application preemption have been extended and used by the modern operating systems in order to maintain preemptive control over the internal run times. 
- The philosophy that governs the preemptive multi–tasking is to make sure that regular time of CPU is given to all the programs.

Read the next post "What are different components of operating system? – Part 4"

No comments:

Facebook activity