0% found this document useful (0 votes)
28 views28 pages

Lecture1 OS

Uploaded by

Avan Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
28 views28 pages

Lecture1 OS

Uploaded by

Avan Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 28

LECTURE 1

Introduction to Operating Systems

Dr. Akshi Kumar


Objectives

• We have all heard about operating systems like


Windows, Linux, Android, MAC etc.

• But, the question is


• What is operating system?
• What does it do?
• Why do we need it?

“An operating system is an interface between the


user and the hardware.“
What is an Operating System?

• A program that acts as an intermediary between


a user of a computer and the computer hardware

• Operating system goals:


• Execute user programs and make solving user
problems easier
• Make the computer system convenient to use
• Use the computer hardware in an efficient
manner
Computer System Components
● Hardware
● Provides basic computing resources (CPU, memory, I/O
devices).
● Operating System
● Controls and coordinates the use of hardware among application

programs.
● Application Programs
● Solve computing problems of users (compilers, database

systems, video games, business programs such as banking


software).
● Users
● People, machines, other computers 4
Abstract View of System

5
Need of OS
● Let’s suppose you want to add two numbers: c=a+b;

No OS With OS
If you are working on MC6800 hardware then Use any High Level Language like C.
the instructions will be:
• LDAA $80 – Loading the number at memory Write c=a+b;
location 80
• LDAB $81 – Loading the number at memory The underlying hardware does not matter
location 81 because OS takes care of conversion.
• ADDB – Adding these two numbers
• STAA $55 – Storing the sum to memory Infact this is what we always do. Have we ever
location 55 bothered what hardware are we using.
But the moment you hardware changes, for Our focus is just writing the code correctly in C,
example, say to 8086 or 8088, all the above C++, Python etc. 6
instructions will change, a problem!
Need of OS

7
Why should I study Operating Systems?

● Need to understand interaction between the hardware and applications


● New applications, new hardware..
● Inherent aspect of society today

● Need to understand basic principles in the design of computer systems


● efficient
resource management, security, flexibility
● Increasing need for specialized operating systems

● e.g. embedded operating systems for devices - cell phones, sensors


and controllers
● real-time operating systems - aircraft control, multimedia
8
services
Operating System Views

The use of operating system


depends upon who is using it and
what is the need in that particular
scenario.

Hence, there are different views.


Broadly you can categorize them
into
● User view
● System view

9
Operating System Views

● From a user’s point of view, the


operating system should offer ease
of use and performance.

● For example, Windows is very


popular because it is very easy to
use as it is having a graphical user
interface.

● Similarly, Android became very


popular and it became one of the
reasons that Nokia’s Symbian OS
lost its market value. 10
Operating System Views

● But from the system’s point of


view, the OS should act as
a Resource Manager, which
means that the OS should be
able to manage all the hardware
resources in the system.

● Hence, all hardware should be


used in the most efficient
manner and the process should
be kept waiting for a minimum
amount of time if they require
any resource. 11
Operating System Views

● Resource allocator
● to allocate resources (software and
hardware) of the computer system
and manage them efficiently.
● Control program
● Controls execution of user
programs and operation of I/O
devices.
● Kernel
● The program that executes forever
(everything else is an application
12
with respect to the kernel).
The OS Shell

● Defines interface between OS and users


● Windows GUI
● UNIX command line
● UNIX users can choose among a
variety of shells
● csh is the “C shell”
● tcsh is an enhanced “C shell”
● Shell programming
The OS Kernel

● The internal part of the OS is often called the Kernel

● Kernel Components
● File Manager
● Device Drivers
● Memory Manager
● Scheduler
● Dispatcher
The OS Kernel vs Shell
● Kernel is program that represent the central core of a computer
operating system. It controls everything that occurs in the system.
Kernel interacts with the hardware on demand from applications.
● A kernel can be contrasted with a shell (such as bash, csh or ksh in
Unix-like operating systems), which is the outermost part of an
operating system and a program that interacts with user commands. The
kernel itself does not interact directly with the user, but rather interacts
with the shell and other programs as well as with the hardware devices
on the system, including the processor (also called the central processing
unit or CPU), memory and disk drives.
● Because of its critical nature, the kernel code is usually loaded into
a protected area of memory, which prevents it from being overwritten by
other, less frequently used parts of the operating system or by
application programs.
The OS Kernel vs Shell
Shell:
● A shell is a program that provides the traditional,
text-only user interface for Linux and other
Unix-like operating system. The term shell
derives its name from the fact that it is an outer
layer of an operating system.

● Shell is a program which gives us the ability to


interact with the operating system. The shell is a
program layer which understands and execute
the commands that user enters. shell is also
called as command interpreter .
OS File Manager

● Maintains information about the files that are available on the system

● Where files are located in mass storage, their size and type and their
protections, what part of mass storage is available

● Files usually allowed to be grouped in directories or folders. Allows


hierarchical organization.
OS Device Drivers

● Software to communicate with peripheral devices or controllers

● Each driver is unique

● Translates general requests into specific steps for that device


OS Memory Manager

● This unit is responsible for coordinating the use of the machine’s main
memory.

● It decides what area of memory is to be allocated for a program and its


data

● It allocates and deallocates memory for different programs and always


knows what areas are free.
OS Scheduler

● Maintains a record of processes that are present, adds new processes,


removes completed processes
● memory area(s) assigned
● priority
● state of readiness to execute (ready/wait)
OS Dispatcher

● Ensures that processes that are ready to run are actually executed

● Time is divided into small (50 ms) segments called a time slice.

● When the time slice is over, the dispatcher allows scheduler to update
process state for each process, then selects the next process to run
OS Summary

● Shell -- interface to user

● File Manager -- manages mass memory

● Device Drivers -- communicate with peripherals

● Memory Manager -- manages main memory

● Scheduler & Dispatcher -- manage processes


Computer System Architecture (traditional)
Systems Today

24
Hardware Complexity Increases

25
OS needs to keep pace with hardware
improvements

26
Operating System Spectrum: Evolution of OS

Next Week…..
27

You might also like