Subscribe by Email


Showing posts with label Program execution. Show all posts
Showing posts with label Program execution. Show all posts

Sunday, April 14, 2013

What are different components of operating system? – Part 5



10. Networking: 
- Presently, many different types of protocols along with applications and hardware for using them are supported by most of the operating systems. 
The computers running different operating systems can easily become a part of the network and participate in resource sharing activities such as sharing of printers, scanners and of course files. 
- They may connect to network either through wired connection or a wireless one. 
- Through this component, OS of one computer system can access the resources of another computer system at a remote location. 
- Almost anything can be shared including remote computer’s sound and graphics card. 
- There are network services that allow transparent access to a computer’s resources like SSH.
- Client/ server networking allows a system to connect to a server which offers various services to its clients.
- Numbered access points or ports are used for providing these services beyond the network address of the server. 
- Maximum one running program can be associated to each of the port number which will handle all the requests.
- A user program can then access the local hardware resources by making a request to the kernel of its operating system.

11. Security: 
- The security of a computer system depends on the proper working of the technologies involved in it. 
- A modern OS lets you access many resources both for the internal applications and external devices through the kernel. 
- The operating system must have the capability of deciding which requests are to be allowed and which are to be rejected. 
- There are some systems which decide this on the basis of some requester identity which they further classify as privileged or non–privileged. 
- For establishing the identity there has to be some form of authentication. 
Mostly a username or ID is quoted along with a password. 
- Some other methods are bio-metric data or magnetic cards. 
- There are cases where no authentication is required for accessing resources. 
Another concept under security is the authorization. 
- The services which can be accessed by the requester are tied to his/ her account or to group in which he/ she belongs. 
- Some auditing options are also offered by systems having a high security level. 
- With these the requests from various sources can be tracked. 
- Internal security is also essential from the programs that are currently executing. 
- It is maintained by raising interrupts to the kernel of the OS. 
- If direct access is provided to the programs for hardware, then security cannot be maintained.

12. User Interface: 
- For an operating system to be operated by a user, a user interface is required. 
- This interface is termed as the shell and is vital if the operating system is to work according to the user’s instructions. 
- The directory structure is observed by the user interface and then it sends requests for the services wanted by the OS from the input hardware devices. 
- It also sends requests to the operating system demanding for the status messages and prompts to be displayed on output hardware devices. 
- There are two most common forms of the user interface namely the GUI (graphical user interface) and the CLI (command line interface). 
In the former, the environment is visual and in the latter case the commands have to be typed line by line. 
- Almost, all the modern operating systems come with a graphical user interface.
- In some operating systems such as Mac OS, the GUI is already integrated in to its kernel. 
- There are some operating systems that are modular in nature.  


Saturday, April 13, 2013

What are different components of operating system? – Part 4



8. Disk access and file systems: 
- Through this component of the operating system, the users as well as the programs they use are able to sort and organize files on a computer system. 
This is done through the use of folders or directories. 
- This is another central feature of the operating systems. 
- Data is stored by the computers on disks in the form of files which are then structured in some certain predefined ways so as to enable faster access, better use of available memory and higher reliability. 
- These specific ways of the storing the data on disk together constitute the file system. 
- This makes it possible to assign names and attributes to the files. 
- This in turn helps in maintaining the hierarchy of directories and folders in the directory tree. 
- Only one type of file system and one disk drive was supported by the old operating systems. 
- Those file systems had a limited capacity in terms of directory structures and file names that could be used and speed. 
- These limitations were actually the reflection of the operating system’s limitations making it difficult for it to support multiple file systems. 
- There are other simple operating systems that have a limited range of storage accessing options.
- On the other hand Unix and Linux like operating systems support the VFS technology or virtual file system. 
- Unix offers support for a wide range of storage devices irregardless of their file system or design. 
- This enables them to be accessed via a common API (application programming interface). 
- For programs this avoids the need of having knowledge about the devices which they may require to access.
- With virtual file system, the OS can provide access of unlimited devices to the programs having many file systems operating in them.
- This it does through the use of file system drivers and other device drivers. 
- A device driver lets you access a connected storage device such as flash drives. 
- Every drive has a specific language which is only understood by the device driver and it translates it in to a standard one used by the OS for accessing the drives.
- The contents of the drive can be accessed by the kernel only if the device driver is in place. 
- The purpose of the file system driver is to translate the commands used for accessing the file systems in to the standard set recognized by the operating system. 
- These file systems are then dealt by the programs based on their directories or folders and file names organized in hierarchy. 
- These files can be created, deleted or modified by the programs.

9. Device Drivers: 
- This specifically developed computer software enables the interaction with the hardware devices. 
- It creates an interface through which communication can be done with the device via communications sub system or bus i.e., the means through which the hardware is connected to the system. 
- This computer program depends up on the hardware but is also specific to the operating system.
- It enables an applications software package running under kernel in order to interact with the hardware device transparently.
- Further, it raises the requisite interrupt required for handling asynchronous time dependent interfacing needs of the hardware. 
- Abstraction is the key goal of the device drivers.
- Every hardware model is different and so the operating system cannot know about how each device will be controlled. 
- The way the devices should be controlled is now dictated by the operating systems as a solution to this problem. 
- Therefore, translating the function calls from the OS into calls specific to the device becomes the purpose of the device drivers. 
- Any device would function properly if a device driver suitable to it is available which will ensure the normal operation of the device from the viewpoint of the OS. 

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


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"


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)


Tuesday, April 9, 2013

What are different components of operating system? – Part 1


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.

1. Kernel: 
- This component of the OS is the medium through which application software can connect to the computer’s hardware system. 
- This component is aided by many device drivers and firmware. 
- With the help of these, it provides a very basic control level for all the hardware devices of a system.
- For programs, the memory access in RAM and ROM is managed by kernel only. 
- It is the authority of the kernel to decide which program should get what access and at what level. 
- The operating state of the CPU is set up the kernel itself all the time. 
- It prepares the data to be stored in long term non–volatile storage like in flash memory, tapes, and disks and so on.

2. Program execution or process: 
- The OS is actually an interface between the hardware and the application software.
- An interaction between the two can be established only if the application abides by the rules and procedures of the operating system as programmed in to it. 
- It is another purpose of the operating system to provide a set of services for simplifying the execution as well as development of the programs. 
- Whenever a program is to be executed, a process is created by the kernel of the operating system and then other required resources such as memory are assigned to it. 
- A priority is assigned to this process if it is a multi–tasking environment. 
- The binary code for the program is loaded in to the memory and the execution is initiated.

3. Interrupts: 
- This component is the central requirement of the operating systems. 
- This is so because the interrupts provide a way of interaction between the OS and its environment which is not only reliable but also effective. 
- The older operating systems worked with very small stacks and therefore watched for the various input sources requiring action for initiating some event (called polling).
- This strategy is not useful in today’s OS that use very large stacks. 
- Here, interrupt - based programming is fruitful. 
- The modern CPU have in – built direct support for these interrupts. 
- With the use of interrupts, a computer knows when to automatically save the contexts of the local registers or run some specific code in response to the occurring events. 
- Hardware interrupts are supported by very basic of the computers. 
Interrupts let the programmer to specify what code is to be run when a certain even occurs. 
- When hardware receives an interrupt, it automatically suspends the current program being executed by it. 
- The status of the program is saved and the code associated with the interrupt is executed. 
- In modern operating systems, the kernel is responsible for handling the interrupts. 
- Either of the running program or the computer’s hardware might raise an interrupt. 
- When an interrupt is triggered by a hardware device, it is left to the OS’s kernel to decide what to do now through execution of some code. 
- The code that has to be run is decided based up on the interrupt’s priority. 
The device driver is the software to which all the task of the processing hardware interrupts is assigned. 
- A device driver might be a part of the kernel, or some other program or both.


Facebook activity