1OPERATING SYSTEMS
1OPERATING SYSTEMS
1OPERATING SYSTEMS
• Hardware
• System Software
• Users
Hardware
• It provides basic computing resources
• CPU, memory, I/O devices
• It may be composed of two or more levels.
• The lowest level consists of the basic resources.
• The next level is the micro architecture level where physical resources are
grouped together as functional units. The basic level operations involve
internal registers, CPU and the operation of the data path is controlled either
by micro program or by hardware control unit.
• The next level is the Instruction set architecture level which deals with the
execution of instructions.
System Software:
• Operating System: It hides the underlying complex hardware. It controls and
coordinates use of hardware among various applications and users.
• Utilities and Application Software: define the ways of in which the system
resources are used to solve the computing problems of the users. The system
programs like compiler, assembler, editor etc. run in the user mode where the
OS run in the supervisor mode or kernel mode.
Program Interface
User Programs
O.S. Interface
O.S.
Hardware Interface/
Privileged Instructions
Disk/Tape/Memory
OS
• Operating System (OS) is a program or set of programs, which acts as
an interface between a user of the computer & the computer
hardware.
• It is written in low-level languages (i.e. machine-dependent).
• When the computer is on, OS will first load into the main memory
Computer Startup
• bootstrap program is loaded at power-up or reboot
• Typically stored in ROM or EPROM, generally known as firmware
• Initializes all aspects of system including the CPU registers, device controllers,
and memory contents
• Locates and loads operating system kernel and starts execution of the first
process (such as “init”) and waits for events to occur.
Definitions
OS
• is a layer of software that manages all the hardware and software components in
an effective and efficient manner.
• is a resource allocator that decides between conflicting requests for efficient and
fair resource use.
• acts as a mediator, thereby making it easier for the programmer to access and
use of the facilities and services of the computing system.
• implements a virtual machine that is easier to program than bare hardware.
• provides an abstraction of the hardware for all the user programs thereby hiding
the complexity of the underlying hardware and gives the user a better view of the
computer.
• is a control program that controls execution of programs to prevent errors and
improper use of computer.
Why do we need operating systems?
• The primary need for the OS arises from the fact that user needs to
be provided with services and OS has to facilitate the provisioning of
these services.
• Convenience: OS provides a high-level abstraction of physical
resources; make hardware usable by getting rid of warts and specifics;
enables the construction of more complex software systems and
enables portable code.
• Efficiency: It shares limited or expensive physical resources and
provides protection.
Need for Operating System
• Operating System is a program that acts as an Interface between the system hardware and the user making the
tasks easier. It is important software which runs on a computer and controls the set of instructions and wisely
utilizes each part of the Computer.
• OS as a platform for Application programs: The operating system provides a platform, on top of
which, other programs, called application programs can run. These application programs help users
to perform a specific task easily. It acts as an interface between the computer and the user. It is
designed in such a manner that it operates, controls, and executes various applications on the
computer.
• Managing Input-Output unit: The operating system also allows the computer to manage its own
resources such as memory, monitor, keyboard, printer, etc. Management of these resources is
required for effective utilization. The operating system controls the various system input-output
resources and allocates them to the users or programs as per their requirements.
• Multitasking: The operating system manages memory and allows multiple programs to run in their own
space and even communicate with each other through shared memory. Multitasking gives users a good
experience as they can perform several tasks on a computer at a time.
• A platform for other software applications: Different application programs are needed by users to
carry out particular system tasks. These applications are managed and controlled by the OS to ensure
their effectiveness. It serves as an interface between the user and the applications, in other
words.
• Controls memory: It helps in controlling the computer’s main memory. Additionally, it allows and
deallocates memory to all tasks and applications.
• Looks after system files: It helps with system file management. As far as we are aware, all of the data
on the system exists as files. It facilitates simple file interaction.
• Provides Security: It helps to maintain the system and applications safe through the authorization
process. Thus, the OS provides security to the system.
What is an Operating System?
• It is a resource manager
• provides orderly and controlled allocation for programs in terms of
time and space, multiplexing
• Resource management keeps track of the resource, decides who
gets the access and resolves conflicting requests for resources by
enforcing policy, allocates the resource and after use reclaims the
resource.
What is an Operating System?
• It is an extended, or virtual, machine
• creates the functionalities of a computer in software i.e. creating copies of
processors, memory etc. using software.
• provides a simple, high-level abstraction, i.e., hides the “messy details” which
must be performed
• presents user with a virtual machine, easier to use
• provides services; programs obtain these by system calls
Services Provided by the OS
• An OS provides standard services (an interface), such as Processes,
CPU scheduling, memory management, file system, networking, etc.
In addition to this, OS provides services in the following areas:
• Program development: These services are in the form of utility
programs such as editors, debuggers to assist programmers in
creating programs. These are referred as application development
tools.
• Program execution: The tasks that are performed to execute a
program are loading of instructions and data into the main memory,
initializing I/O devices and files and preparing other resources.
• Access to I/O devices: Each I/O device requires its own peculiar set of
instructions or control signals for operation. OS provides a uniform
interface that hides these details so that the programmer can access
such devices using simple reads and writes.
• Controlled access to files: For accessing files, control must include a
detailed understanding of the nature of I/O device as well as the
structure of the data contained in the files on the storage medium.
For system with multiple users, OS should provide protection
mechanisms to control access to the files.
• System access: For shared or public systems, the access function must
provide protection of resources and data from unauthorised users
and must resolve conflicts for resource contention.
• Error Detection and Responses: OS must provide responses to
runtime errors such as internal or external hardware errors, software
errors like arithmetic overflow etc. The response may be terminating
the program or reporting error to the application.
• Accounting: OS collects usage statistics for various resources and
monitor performance parameters to improve performance. On a
multiuser system, the information can be used for billing purposes.
Common Functions of Interrupts
• Interrupt transfers control to the interrupt service routine generally,
through the interrupt vector, which contains the addresses of all the
service routines
• Interrupt architecture must save the address of the interrupted
instruction
• Incoming interrupts are disabled while another interrupt is being
processed to prevent a lost interrupt
• A trap is a software-generated interrupt caused either by an error
such as divide by 0 or a user request (system call).
• An operating system is interrupt driven
Interrupt Timeline
Interrupt Handling
• The operating system preserves the state of the CPU by storing
registers and the program counter
• The higher levels in the hierarchy are expensive but fast. As we move
down the hierarchy, the cost per bit generally decreases, whereas the
access time generally increases.