Introduction To Operating System



Operating System: -
                                     It is a program that acts as a layer between user and computer hardware. The purpose of operating system is to provide an environment in which user can execute programs in a consistent and efficient manner. Operating system controls all the computer resources and provides the base upon which application programs can be written and run.


Computer Software: -
Computer software can be generally divided into two main categories:
   1. System Programs
   2. Application Programs


System Programs: -
                         System programs are those programs, which manages the operation of the computer itself. It is system oriented. The example of system programs is any device driver and operating system. It deals with the computer hardware.


Application Programs: -
                                          Application programs are those programs, which performs user specified task. These programs are user oriented. The examples of application programs are MS Office, Paint Shop etc. These programs are used to perform as for the requirements of the user.


Physical Layer: -
                                The lowest layer contains physical devices. In this layer all the physical devices, wires, power supplies, catharode tubes comes under this layer.


Micro-programming: -
                                        Micro-programming directly controls the devices and provides base to the next layer. This software is located in ROM. It is actually an interpreter, which interprets the machine instructions such as ADD, MOV.


Machine Language: -
                                       Machine Language is not a part of hard machine, but computer manufacturers always describe it in their manuals. It consists of 50-300 instructions for moving data, doing arithmetic calculations and comparing values. In this layer, special registers called Device Registers control the input/output devices.


System Program: -
                                 It is a command interpreter (shell), compiler, editor, and similar application independent program. This program deals with application program to run it efficiently.

v Functions Of Operating System: -
                                                         There are mainly two types of functions performed by the operating system: -

1. As a Resource Manager: -
                                                Operating System has to manage all the pieces of complex system. Computer consists of processors, timers, memories, magnetic tapes, drives, network enterprises and a wide variety of physical devices. The job of operating system is to provide controlled environment to the processors, memories and input/output devices among various programs, which are competing for them.
          The view of the operating system keeps track of who is using which resource request, how much time the resource is used and to solve conflicting request from different programs and users.

2. as an Extended Machine: -
                                                    Operating System hides the truth about the hardware from the user and presents a nice, simple view of named files that can be read and written by operating system. It presents a simple file oriented interface to the user. It also does a lot of business with timers, memory management and other low level features.

In this view the function of operating system is to present the use with the equivalent thought and extended machine or virtual machine i.e. it is easier to program than the under link hardware. It provides one type of abstraction to the user.

Concept of Operating System:-
                                                       The interface between the operating system and the user program is defined by a set of extended instructions known as system calls. The job of system call is to create, delete and use various software objects or applications. For e.g. processes and files.

(1) Processes: -
                    It is a key concept in all operating system. It is basically a program which is in execution. All the information about each process is stored in a table called process table which is maintained by operating system. The process table is an array of structure for each process. A process can execute in its own address space. To run a process, another process is required. At that time the second process becomes child process or first process. One process requires executing more than one child process.
The suspended process which consists of its own address space is called Core 

 
(2) Files: -
            This is a broad category of system calls. Major function of operating system is to hide the truth about the input/output devices and present the user with abstract model of device independent files. System calls are needed to remove and write files. Before a file can be read or written, it must be open at the time at which file permission are checked. If the access is permitted, the system returns a small integer called file descriptor to handle subsequent file operation. If the access is prohibited then an error code is returned.

File descriptor:
0      -  Standard Input.
1      -  Standard Output
2      -  Standard Error

Standard Input refers to file for the purpose of reading. Standard Output refers to the file for the purpose of writing. Standard Error refers to writing an error message on display.

Many operating systems including MS-Dos and UNIX provide an abstraction to the user to perform input/output without knowing the details about the hardware.

 This abstraction represents each input/output device has special file. Special file are provided in order to make input/output devices look like special files.

Pseudo Files (Pipe):-
                          It can be used to connect 2 processes together. When process A wants to send a data to process B it writs on that files as like it on output files. Process B can read data by reading from that file as it is an output file. It is also called a pipe between processes.


 



There are two types of special files: -

1.    Block Special File : -
                                        This type of special file is used to refer devices that consists of randomly addressable blocks. A program can directly access the user’s demandable block from the device without knowing the structure of the file system. These files are used for system maintenance purpose.

2.    Character Special Files : -
                                                   Character special files are used to refer the device that consists of character strings rather than fixed size randomly addressable blocks. Terminal line printers and adapters are examples of such files.





(3) Shell: -
             It is a UNIX based command interpreter. It uses many operating system features and also provide primary interface between user sitting at his terminal and the operating system. When any UNIX system starts, it will ask for username and password. After verifying the username and password, when user logs in shell is started. The shell the terminal as standard input and output. After starting the shell, it waits to accept a command from the user. It will perform the output as the user types the command at the command prompt. Date command will display the current date. The shell creates a child process and run the date program as a child. While the child process is running the shell waits for it to terminate. When child process finishes the shell types prompt $ again and tries to read next command. When you write this command the file contents will be printed on the printer. The “&” sign identifies that this process runs under the background process. When printing continues you can perform another operation at the same time.
It provides a multi-tasking environment in which user can perform more than one task at same time.

(4) System Calls: -
                          User program communicate with the operating system and requests services from it by making system calls. Corresponding to each system call there is a library procedure that read system calls
              COUNT = READ ( file, buffer, n bytes )
This system call is used to read only files from disk. It accepts three parameters i.e. file = files which user wants to read, buffer = it is one type of storage for files data, n bytes = it identifies how many bytes user wants to  
read from the file. The effect of calling read procedure is to cause data from the specified file to be copied into the buffer, where the program can get kicked. The procedure returns the number of bytes actually read in the count variable. This value is normally same as “n” bytes but it may be smaller. In case system call cannot be carried out if invalid parameters passing or disk error, count is set to -1 and the error message will be displayed. System calls are used to create processes manage memory, read and write files, input/output such as reading from terminal and printing on the printer.






Introduction To Operating System Introduction To Operating System Reviewed by Unknown on 7:58:00 AM Rating: 5

No comments:

Powered by Blogger.