Subscribe by Email

Wednesday, April 10, 2013

What are different components of operating system? – Part 2

All the components of an OS must exist in order so as to make the different parts of a system work together in cooperation. All the hardware needs of a software application are satisfied only through the operating system, be it as simple as mouse movement or as complex at Ethernet.

4. Modes: 
- A number of modes of operations are supported by today’s CPUs. 
- CPUs having the capability to support multiple modes at the least use the following two basic modes:
Ø  The supervisor mode: The kernel of the operating system uses this mode for accomplishing low level tasks i.e., the tasks that have no restricted access to the computer hardware. Few examples of such tasks are: communicating with devices such as the graphic cards and maintaining a control over the read, write and erase operations of the memory.
Ø  The protected mode: This mode is just the opposite of the previous one and so is use for everything else. Application software which runs under the protected mode can access the computer hardware only by going through the kernel which in turn controls the tasks only in supervisor mode.
- There are other types of modes similar to the above two, such as virtual modes that might be used by the CPUs for emulating old types of processors such as the following: 32 bit processor on a 64 bit processor or a 16 – bit one on a 32 bit one etc.
- The former one is the mode in which a computer runs automatically after start up. 
- The first programs that run include EFI or BIOS, OS and the boot loader. 
These programs require unlimited access to the computer hardware because a protected environment can only be initialized outside of one. 
- The CPU is transferred to protected mode only when the control is passed to some other program by the operating system. 
- When a program is running under the protected mode, the number of CPU instructions to which it is granted access might be very limited. 
- If a user wishes to leave the protected mode, he / she can raise a interrupt that will pass the control again to the operating system. 
- This is how an operating system maintains an exclusive control over the issues concerning access to the memory and the hardware. 
- One or more CPU registers that consist of information that is prohibited to be accessed by the currently executing program are collectively termed as the ‘protected mode resources’. 
- If at all an attempt is made for altering this resource, the system switches to supervisor mode.
- Now it is the OS who deals with such illegal operations. It may kill the program.

5. Memory management: 
- Kernel of a multi–programming OS is held responsible for the management of the system memory that is currently under use by the programs. 
- Kernel ensures that the programs under execution do not interfere with the memory being used by the each other.
- Since time sharing principle is followed; each of the programs is given an independent access to the system memory. 
- Early operating systems used to have a cooperative memory management system. 
- It was assumed that all the programs used the memory manager of kernel voluntarily without exceeding the memory limit assigned to them. 
- However,this system of memory management is extinct now because there are bugs in programs that cause them to exceed the limits.
Failure of a program might cause the memory to be overwritten by the other programs using it. 
- Memory being used by the other programs might be altered by some viruses or malicious code for some purpose which in turn may affect the working of the OS. 
- In such management, the misbehaving programs can crash the whole system. 
- Kernel limits the access to memory for various programs through various methods of memory protection such as paging and segmentation. 

Read the next post (What are different components of operating system? – Part 3)

No comments:

Facebook activity