Skip to main content

The operating system

1.1 The Operating system


Computers re designed to run programs. But a program can run only if the computer it is running on has some basic intelligence to begin with .

This intelligence allocates memory for the program runs each program instruction on the CPU and accesses the hardware on behalf of the program.

A special piece of pre-installed software performs this job, and this software is known as the computer's operating system.


An Operating system is the software that manages the computer's  hardware and provides a convenient and safe environment  for running programs.

It acts as an interface between programs and the hardware resources that these programs access(like memory, hard disk and printer).

It is loaded into memory when a computer  is booted and remains active as the machine is up.

To grasp the key features of an operating system, Let 's consider the management tasks it has to perform when we run a program. 

These operations also depend on the operating system we are using, but the following actions are common to most systems:

*) The operating system allocates memory for the program and loads the program to the allocated memory.

*) It also loads the CPU registers with control information related to the program. The registers maintain the memory locations where each segment of a program is stored.

*) The instructions provided in the program are executed by the CPU. The operating system keeps track of the instruction that was last executed.This enables it to resume a program if it had to be taken out of the CPU before it completed execution.

*) If the program needs to access the hardware, it make a call to the operating system rather than attempt to do the job itself. For instance, if the program needs to read a file on disk, the operating system directs the disk controller to open the file and make the data available to the program.


*) After the program has completed execution, the operating system cleans up the memory and registers and make them available for the next program.


Modern operating systems are MULTIPROGRAMMING, i.e., they allow multiple programs to be in memory.

However, on computers with a single CPU, only one program can run at any instant.

Rather than allow a single program to run to completion without interruption, an operating system generally allows a program to run for a small instant of time, save its current state and then load the next program in the queue.

The operating system creates a PROCESS for each program and then controls the switching of these processes.

Most programs often access the disk or the terminal to read and write data.

These I/O operations keep the CPU idle, so the operating system takes the program out of the CPU while the I/O operation is in progress.

It then schedules another program to run. The previous program can resume execution only after the I/O operation completes.

this ensures maximum utilization of the CPU.

In addition to these basic services, operating systems provide a wide range of services---from creating files and directories, copying files across a network and performing backups.

These tools are often standalone programs that don't form the core of the operating system, but may be considered as additional services that benefit the users, programmers and system administrators.

Knowledge of the functions performed by an operating system and the way they are implemented on your computer often help in writing better programs.

True, a lot can be done without even knowing the operating system running on your computer, but a UNIX professional needs to look beyond the big picture to know how thigs actually work.

NOTE : In a multiprogramming environment,the operating system has to ensure that a process performing an I/O operation doesn't hold the CPU. It  must schedule another process while the I/O operation is in progress. The process is said to block,i.e., wait for the event to complete.

Comments

Popular posts from this blog

(*) Logging In and Out

The good old dumb terminal connected to the computer's serial port was once the only means of connecting to a UNIX system. Later, the TELNET program became popular for connecting in a network.  For security reasons, the TELNET facility could be disabled on your system and the SECURE SHELL( SSH ) could be the only means of connecting to a remote UNIX box. In that case, UNIX and LINUX users can use the SSH command if available. Windows users may use PUTTY or any of the free SSH programs available on the Net. If you are using a workstation or desktop PC running Linux, then you can log in directly.

(*) The system Administrator

On a large system serving hundreds of users, someone has to be given charge of administration of the system.  This person is known as the system administrator . The administrator is responsible for the management of the entire setup. She allocates user accounts, maintains file systems, takes backups,manages disk space and performs several other important functions. She is the person to be contacted in case of a genuine problem. If you own a workstation or PC that runs some flavor of UNIX, then you are probably its administrator . You are then directly responsible for its startup, shutdown and maintenance. If you lose a file, it's your job to get it from a backup. If things don't work properly, you have to try all possible means to set them right before you decide to call a maintenance person. You can use a UNIX machine only after the administrator has opened an account with a user-id and password for your use. These authentication parameters are maintained in two separate files...

(*) The UNIX operating System

There have been many operating systems in the past, one at least from each hardware vendor. They were written in a near-machine language known as ASSEMBLER. The systems were proprietary( relating to an owner or ownership or  (of a product) marketed under and protected by a registered trade name .)  because assembler code developed on one machine wouldn't run on another. Vendors required consumers to purchase expensive proprietary hardware and software if two dissimilar machines needed to talk to each other. Ken Thompson and Dennis Ritchie changed all that forever. They created UNIX . This UNIX operating system marks a strong departure from tradition.It has practically everything an operating system should have, but also introduced a number of concepts previously unknown to the computing community. Beginners with some experience in Windows think of UNIX in terms of it, quite oblivious to the fact that the similarities are only superficial. UNIX is way ahead of othe...