OPERATIN
G SYSTEM
Operating System
Operating system is a program that controls the execution
of application programs and acts as an interface between
the user of a computer and the computer hardware.
An Operating system is concerned with the allocation of
resources and services, such as memory, processors,
devices and information. The Operating System
correspondingly includes programs to manage these
resources, such as a traffic controller, a scheduler, memory
management module, I/O programs, and a file system.
Functions of Operating System
Operating system performs three functions:
1. Convenience: An OS makes a computer more convenient to use.
2. Efficiency: An OS allows the computer system resources to be
used in an efficient manner.
3. Ability to Evolve: An OS should be constructed in such a way
as to permit the effective development, testing and introduction of
new system functions without at the same time interfering with
service.
Operating System as User Interface
The operating system is a set of special programs that run on a computer system that
allow it to work properly. It performs basic tasks such as recognizing input from the
keyboard, keeping track of files and directories on the disk, sending output to the
display screen and controlling a peripheral devices.
OS is designed to serve two basic purposes :
1. It controls the allocation and use of the computing system’s resources among the
various user and tasks.
2. It provides an interface between the computer hardware and the programmer that
simplifies and makes feasible for coding, creation, debugging of application programs.
Basics of Operating System (Computer
System Operation)
Some basic knowledge of Computer System is required to
understand how operating systems work.
A moderngeneral-purpose computer system consists of CPU
and a number of device controllers connected through a
common bus that provides access to shared memory.
Each device controller is in charge of a specific type of device
The CPU and the device controllers can execute concurrently, competing for memory
cycles.
To ensure orderly access to the shared memory, a memory controller is provided whose
function is to synchronize access to the memory
Some important terms:
1. Bootstrap program
The initial program that runs when a
computer is powered up or rebooted.
It is stored in the ROM
It must know how to load the OS and start
executing that system.
It must locate and load into memory the
OS kernel.
BOOTING
o Bootstrap program:
Initialize all aspects of the system, e.g., CPU registers, device controllers,
memory, etc.
Load and run the OS
o Operating system: run init to initialize system processes, e.g., various daemons, login
processes,after the kernel has been bootstrapped. (/etc/rc* & init or /sbin/rc* & init)
2. Interrupt
The occurrence of an event is usually
signalled by an interrupt from hardware or software.
Hardware may trigger an interrupt at any
time by sending a signal to the CPU, usually by the
way of the system bus.
3. System Call (Monitor Call)
Software may trigger an interrupt by
executing a special operation called
SYSTEM CALL.
When the CPU is interrupted, it stops what it is doing and
immediately transfers execution to a fixed location.
The fixed location usually contains the starting address
where the Service Routine of the interrupt is located.
Where the interrupt is written.
Interrupt service routine (ISR).
On completion, the CPU resumes its interrupted computation.
INTERRUPT
o Hardware interrupt, e.g. services requests of I/O
devicesSoftware interrupt, e.g. signals, invalid memory
access, division by zero, system calls, etc –(trap)
o Procedures: generic handler or interrupt vector (MS-
DOS,UNIX)
Interrupt Handling Procedure
o Saving of the address of the interrupted
instruction: fixed locations or stack
o Interrupt disabling or enabling issues: lost
interrupt?!
prioritized interrupts masking
Interrupt Handling Procedure
o Saving of the address of the interrupted
instruction: fixed locations or stack
o Interrupt disabling or enabling issues: lost
interrupt?!
prioritized interrupts masking
I/O SYSTEM MANAGEMENT
The module that keeps track of the status of devices is called the I/O traffic
controller. Each I/O device has a device handler that resides in a separate
process associated with that device.
The I/O subsystem consists of :
1. A memory management component that includes buffering, caching and
spooling.
2. A general device driver interface.
ASSEMBLER
Input to an assembler is an assembly language program. Output is an object program
plus information that enables the loader to prepare the object program for execution.
At one time, the computer programmer had at his disposal a basic machine that
interpreted, through hardware, certain fundamental instructions. He would program
this computer by writing a series of ones and zeros(machine language), place them
into the memory of the machine.
COMPILER
The high level languages – examples are FORTRAN, COBOL, ALGOL and PL/I
– are processed by compilers and interpreters. A compilers is a program that
accepts a source program in a “high-level language” and produces a
corresponding object program. An interpreter is a program that appears to execute
a source program as if it was machine language. The same name (FORTRAN,
COBOL etc) is often used to designate both a compiler and its associated
language.
LOADER
A loader is a routine that loads an object program and prepares it for execution.
There are various loading schemes: absolute, relocating and direct-linking. In
general, the loader must load, relocate, and link the object program. Loader is a
program that places programs into memory and prepares them for execution. In a
simple loading scheme, the assembler outputs the machine language translation of
a program on a secondary device and a loader is placed in core. The loader places
into memory the machine language version of the user’s program and transfers
control to it. Since the loader program is much smaller than the assembler, thUs
makes more core available to user’s program