Skip to main content

System Components of OS

Article No: 2

System Components

An operating system provides the environment within which programs are executed. Internally, operating systems vary greatly in their makeup being organized along many different lines. The design of a new operating system is a major task. The goals of the system must be well defined before the design begins.

We can create a system as large and complex as an operating system only by partitioning it into smaller pieces. Each piece should be a well-delineated portion of the system, with carefully defined inputs, outputs, and functions. Obviously, not all the systems have the same structure.

Process Management

A program does nothing unless its instructions are executed by a CPU. A process can be thought of as a program in execution. For example, a system task such as sending an output to a printer is a process, a word-processing program being run by an individual user on a PC is a process.

A process needs a certain resources – including CPU time, memory, files and I/O devices – to achieve its task. These resources are either given to the process when it is created, or allocated to it while it is running. In addition to the various physical and logical resources that a process obtains when it is created, various initialization data (or input) may be passed along. For example, consider a process whose function is to display the status of a file on the screen of a terminal. The process will be given as an input the name of the file, and will execute the appropriate instructions and system calls to obtain and display on the terminal the desired information. When the process terminates, the operating system will reclaim any reusable resources.

We emphasize that a program by itself is not a process; a program is a passive entity, such as the contents of a file stored on disk, whereas a process is an active entity, with a program counter specifying the next instruction to execute. The execution of a process must be sequential. The CPU executes instruction of the process one after another, until the process completes. Further, at any time, at most one instruction is executed on behalf of the process. Thus although two processes may be linked with the same program, they are nevertheless considered two separate execution sequences. It is common to have a program that spawns (calls) many processes as it runs.

A process is the unit of work in a system. Such a system consists of a collection of processes, some of which are operating-system processes (those that executes system code) and the rest of which are user process (those that execute user code). All these processes can potentially execute concurrently by multiplexing the CPU among them.

Activities

·         Creating and deleting both user and system process.
·         Suspending and resuming process.
·         Providing mechanisms (facilities) for process management.
·         Providing mechanisms for process communication.
·         Providing mechanisms for deadlock handling.

Main-Memory Management

Every computer has some main memory that it uses to hold executing programs. In a very simple operating system, only one program at a time is in memory. To run a second program, the first one has to be removed and the second one is placed in the memory.

More sophisticated operating systems allow multiple programs to be in memory at the same time. To keep them from interfering with one another (and with the operating system), some kind of protection mechanism is needed. While this mechanism has to be in the hardware, it is controlled by the operating system.

The above viewpoint is concerned with managing and protecting the computer’s main memory. A different, but equally important memory – related issue, is managing the address space of the processes. Normally, each process has some set of addresses it can use, typically running from 0 to some maximum. In the simplest case, the maximum amount of address space a process has is less than memory. In this way, a process can fill up its address space and there will be enough room in main memory to hold it all.
Activities

·         Keeping track of which parts of memory are currently being used and by whom.
·         Deciding which processes are to be loaded into memory when memory space becomes available.
·         Allocating and deallocating memory space as needed.

File Management

The file management is the most visible component (the one which user can see on a screen as any file like .txt, .doc files) of an operating system. It provides the mechanism for on-line storage of and access to both data and programs of the operating system and all the users of the computer system. The file system consists of two distinct parts a collection of files, each storing related data, and a directory structure, which organizes and provides information about all the files in the system. Some file systems have a third part, partitions, which are used to separate physically or logically large collections of directories.
A file is named collection of related information that is recorded on secondary storage; that is, data cannot be written to secondary storage unless they are within a file. Commonly, files represent programs (both source and object forms) and data. Data files may be numeric, alphabetic, alphanumeric, or binary. Files may be free form, such as text files, or may be formatted rigidly. In general, a file is a sequence of bits, bytes, lines or records, the meaning of which is defined by the files creator and user.
The information in a file is defined by its creator. Many different types of information may be stored in a file: source programs, object programs, executable programs, numeric data, text, payroll records, graphic images, sound recordings and so on. A file has a certain defined structure according to its type. A text file is a sequence of characters organized into lines (and possibly pages). A source file is a sequence of subroutines and functions, each of which is further organized as declarations followed by executable statements. An object file is a sequence of bytes organized into blocks understandable by the system’s linker. An executable file is a series of code sections that the loader can bring into memory and execute.
Activities
·         Creating and deleting files.
·         Creating and deleting directories.
·         Supporting primitives for manipulating files and directories.
·         Mapping files onto secondary storage.
·         Backing up files on stable (nonvolatile) storage media.

I/O-System Management

All computers have physical devices for receiving input and producing output. After all, what good would a computer be if the users could not tell it what to do and could not get the results after it did the work requested. Many kinds of input and output devices exist, including keyboards, monitors, printers and so on. It is up to the operating system to manage these devices.
Consequently, every operating system has an I/O subsystem for managing its I/O devices. Some of the I/O software is device independent, that is, applies to many or all I/O devices equally well. Other parts of it, such as device drivers, are specific to particular I/O devices.

Activities

·         A memory–management component that includes buffering, caching and spooling.
·         A general device – driver interface.
·         Drivers for specific hardware devices.

Secondary-Storage Management

The main purpose of a computer system is to execute programs. These programs, with the data they access, must be in main memory, or primary storage, during execution. Because main memory is too small to accommodate all data and programs, and because the data that it holds are lost when power is lost, the computer system must provide secondary storage to back up main memory. Most modern computer systems use disks as the principal on-line storage medium, for both programs and data. Most programs – including compilers, assemblers, sort routines, editors, and formatters – are stored on a disk until loaded into memory, and then use the disks as both the source and destination of their processing. Hence, the proper management of disk storage is of central importance to a computer system.

Activities

·         Free-space management.
·         Storage allocation.
·         Disk – scheduling.

Networking

A distributed system is a collection of processors that do not share memory, peripheral devices, or a clock. Instead, each processor has its own local memory and clock, and processors communicate with one another through various communication lines, such as high-speed buses or networks. The processors in a distributed system vary in size and function. They may include small micro-processors, workstations, minicomputers, and large, general-purpose computer systems.

The processors in the system are connected through a communication network, which can be configured in a number of different ways. The network may be fully or partially connected. The communication-network design must consider message routing and connection strategies, and the problems of connection and security.

A distributed system collects physically separate, possibly heterogeneous systems into a single coherent system, providing the user with access to the various resources that the system maintains. Access to a shared resource allows computation speedup, increased functionality, increased data availability, and enhanced reliability. Operating systems usually generalize network access as a form of file access, with the details of networking being contained in the network interface’s device driver. The protocols that create distributed systems can have a great effect on that system’s utility and popularity. The innovative of the World Wide Web was to create a new access method for information sharing. It improved on the existing file-transfer protocol (FTP) and network file-system (NFS) protocol by removing the need for a user log in before he/she is allowed to use a remote resource. It defined a new protocol, hypertext transfer protocol (http), for use in communication between a web server and a web browser. A web browser then just needs to send a request for information to remote machine’s web server, and the information (text, graphics, links to other information) is returned. This increase in convenience fostered huge growth in the use of http and of the Web in general.

Protection System

If a computer system has multiple users and allows the concurrent execution of multiple processes, then the various processes must be protected from one another’s activities. For that purpose, mechanisms ensure that the files, memory segments, CPU, and other resources can be operated on by only those processes that have gained proper authorization from the operating system.

For example, memory-addressing hardware ensures that a process can execute only within its own address space. The timer ensures that no process can gain control of the CPU without eventually relinquishing control. Device control registers are not accessible to users, so that the integrity of the various peripheral devices is protected.
Protection is any mechanism for controlling the access of programs, processes, or users to the resources defined by a computer system. This mechanism must provide means for specification of the controls to be imposed and means for enforcement.

Protection can improve reliability by detecting latent errors at the interface between component subsystems. Early detection of interface errors can often prevent contamination of a healthy subsystem by another subsystem that is malfunctioning. An unprotected resource cannot defend against use (or misuse) by an unauthorized user. A protection-oriented system provides a means to distinguish between authorized and unauthorized usage.

Command-Interpreter System

One of the most important systems programs for an operating system is the command interpreter, which is the interface between the user and the operating system. Some operating systems include the command interpreter in the kernel. Other operating systems, such as MS-DOS and UNIX, treat the command interpreter as a special program that is running when a job is initiated, or when a user first logs on (on time-sharing systems).

Many commands are given to the operating system by control statements. When a new job is started in a batch system, or when a user logs on to a time-shared system, a program that reads and interprets control statements is executed automatically. This program is sometimes called the control-card interpreter or the command-line interpreter, and is often known as the shell. Its function is simple: to get the next command statement and execute it.

Operating systems are frequently differentiated in the area of shell, with a user-friendly command interpreter making the system more agreeable to some users. One style of user-friendly interface is the mouse-based window-and-menu system used in the Macintosh and in Microsoft Windows. The mouse is moved to position the mouse pointer on images, or icons on the screen that represent programs, files and system functions. Depending on the mouse pointer’s location, clicking a button on the mouse can invoke a program, select a file or directory-known as a folder-or pull down a menu that contains commands. More powerful, complex, and difficult-to-learn shells are appreciated by users. In some of these shells, commands are typed on a keyboard and displayed on a screen or printing terminal, with the enter key signaling that a command is complete and is ready to be executed. The MS-DOS and UNIX shells operate in this way.


Compiled By: Chaudhary Amit V.

Resource Used:

1. Operating System (By: William Stailings)

Comments

Popular posts from this blog

Characteristics of a Good Programming Language

Till now there are many high level languages which are very popular, and there are others, which could not become so popular in-spite of being very powerful. There might be many reasons for the success of a language, but one obvious reason is the characteristics of the language. Several characteristics believed to be important with respect to making a programming language good are briefly discussed below. Simplicity A good programming language must be simple and easy to learn and use. For example, BASIC is liked by many programmers only because of its simplicity. Thus, a good programming language should provide a programmer with a clear, simple and unified set of concepts which can be easily grasped. It is also easy to develop and implement a compiler or an interpreter for a programming language that is simple. However, the power needed for the language should not be sacrificed for simplicity. The overall simplicity of a programming language strongly affects the readability of the pr...

Angular 4 and Firebase Authentication: Setup

If you have come to this article, it means you are keen to learn new technology and that too Firebase. I love Firebase because it provides all basic but important features of any web application. Take for example, authentication, which is cumbersome and risky if not implemented with utmost care. And when we have the integration of Angular and Firebase, it becomes a lot easier for a developer to build such crucial modules in less time with minimal efforts. In this article we will create a simple Angular application using Firebase. I am going ahead with the understanding that you know the benefits of Firebase and have little knowledge about it. There are plenty of posts out on the web if you are behind. Step 1: Install Angular CLI (if not installed). npm install -g angular-cli Step 2: Create new Angular 4 project. By default now angular CLI will create Angular 4 project so you need not fret. ng new firebase-authentication Step 3: Check whether the ne...

Switch-case, simple calculator . . .

11.      Write a program to perform some mathematic functions with the help of “switch-case” statement. #include<stdio.h> #include<conio.h> void main() { int a,b,ans; char c; clrscr(); printf("\ Enter a and b:"); scanf("%d%d",&a,&b); printf("\n Enter operator:"); fflush(stdin); scanf("%c",&c); switch(c) { case'+':ans=a+b;       break; case'-':ans=a-b;       break; case'*':ans=a*b;       break; case'/':ans=a/b;       break; } printf("\n ans %d",ans); getch(); } 12.      Print the Fibonacci series #include<stdio.h> #include<conio.h> void main() { int a=1,b=1,s=3,c,ch; clrscr(); printf("how many steps="); scanf("%d",&ch); printf("%5d%5d",a,b); for(s=3;s<=ch;s++) {       c=a+b;       printf("%5d",c);       a=b;    ...