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.
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
Post a Comment