Lec 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 49

COURSE CODE :BTEC101/COMP200

COURSE NAME: INTRODUCTION


OPERATING SYSTEM
LECTURE TITLE: OS OVERVIEW

Lecture 1
Dr.Hend Mancy
IT MUST VISION

?
100 Marks = 50 (final exam) + 20 Midterm +10 Attendance
+20 Tasks
SYLLABUS

1. O.S Overview: (covered in Chapters 1


and 2)
2. Process management: (Chapters 3
through 7)
3. Memory management: (Chapters 8 and
9)
4. Storage management: (Chapters 10
through 13)
5. Protection and security: (Chapters 14
and 15)
OBJECTIVES

• To describe the basic organization of computer systems


• To provide a grand tour of the major components of operating
systems
• To give an overview of the many types of computing environments
• To explore several open-source operating systems
WHAT IS AN OPERATING SYSTEM?

• It is a program.
• It is the first piece of software to run after the
system boots.
• It coordinates the execution of all other software.
• It provides various common services needed by
users and applications.
OPERATING SYSTEM DEFINITION

Short definition:
• a program that manages a computer’s resources and acts
as an intermediary between a user and those resources
computer
user application
operating system
application
user hardware application
OPERATING SYSTEM TERMINOLOGY

• Kernel
– Software component that controls the
hardware directly, and implements the core
privileged OS functions.
• Process
– An executing program.
OPERATING SYSTEM GOALS:

• Executing user programs and make solving


user problems easier
• Using the computer hardware in an efficient
manner
COMPUTER SYSTEM STRUCTURE

• Computer system can be divided into four components:


• Hardware – provides basic computing resources
• CPU, memory, I/O devices
• Operating system
• Controls and coordinates use of hardware among various applications and
users
• Application programs – define the ways in which the system resources are
used to solve the computing problems of the users
• Word processors, compilers, web browsers, database systems, video games
• Users
• People, machines, other computers
FOUR COMPONENTS OF A COMPUTER SYSTEM
THEN OPERATING SYSTEM

• OS is a resource allocator
• Manages all resources
• Decides between conflicting requests for efficient and fair resource use

• OS is a control program
• Controls execution of programs to prevent errors and improper use of the
computer
WHAT OPERATING SYSTEMS DO

Depends on the point of view


• Users want convenience, ease of use and good performance
• But shared computer such as mainframe or minicomputer
must keep all users happy
• Users of dedicate systems such as workstations have dedicated
resources but frequently use shared resources from servers
• Handheld computers are resource poor, optimized for usability
and battery life
Note that, Some computers have little or no user interface, such as
embedded computers in devices and automobiles
❑High-Performance Computing
❑Parallel Computing
COMPUTING ❑Distributed Computing
ENVIRONMENTS
(MODELS) ❑Cluster Computing
❑Grid Computing
❑Cloud Computing
❑Biocomputing
❑Mobile Computing
❑Quantum Computing
❑Optical Computing
❑Nanocomputing
❑Network Computing
COMPUTING ENVIRONMENTS –(CONT.)

Mobile Computing
• Handheld smartphones, tablets, etc
• What is the functional difference between them and a “traditional”
laptop?
o Extra feature – more OS features (GPS)
o Allows new types of Apps
o Use IEEE 802.11 wireless, or cellular data networks for connectivity
• As Apple IOS and Google Android
COMPUTING ENVIRONMENTS (CONT.)

Distributed computing
• Collection of separate, possibly heterogeneous
systems networked together.

• Network is a communications path where,


Network Operating System provides features
between systems across network.
COMPUTING ENVIRONMENTS (CONT.)

Network Computing
• Dumb terminals supplanted by smart PCs
Many systems now servers, responding to
requests generated by clients
Compute-server system provides an
interface to client to request services (i.e.,
database)
File-server system provides interface for
clients to store and retrieve files
COMPUTING ENVIRONMENTS (CONT.)

Cloud Computing

• Def. Delivers computing, storage, even apps as a service across a network.

• Logical extension of virtualization because it uses virtualization as the base for its functionality.
• E.g.Amazon, Microsoft Azure, and Google Cloud.

• Many types
• Public cloud – available via Internet to anyone willing to pay
• Private cloud – run by a company for the company’s own use
• Hybrid cloud – includes both public and private cloud components
Software as a Service (SaaS) – one or more applications available via the Internet
Platform as a Service (PaaS) – software stack ready for application use via the Internet
Infrastructure as a Service (IaaS) – servers or storage available over Internet (i.e., storage
available for backup use)
COMPUTING ENVIRONMENTS (CONT.)

Cloud Computing Cont.


• Using Virtualization
Allows operating systems to run applications
within other OSes
Emulation used when source CPU type
different from target (Gust & Host).
As VMM (virtual machine Manager) provides virtualization
services.
COMPUTING ENVIRONMENTS (CONT.)

• Cloud computing Cont.


composed of (traditional OSes,+ VMMs + cloud management tools)
COMPUTING ENVIRONMENTS (CONT.)
• Parallel Computing
Multi-processor systems with more than one CPU in close
communication.
• Symmetric multiprocessing (SMP)
• Each processor runs an identical copy of the operating
system.
• Many processes can run at once without performance
deterioration.
❖Most modern operating systems support SMP
• Asymmetric multiprocessing
• Each processor is assigned a specific task; master processor
schedules and allocates work to slave processors.
❖More common in extremely large systems
COMPUTING ENVIRONMENTS (CONT.)
Clustered Computing Systems

• Like multiprocessor systems, but multiple systems working


together
• Usually sharing storage via a storage-area network (SAN)
• Provides a high-availability service which survives failures
• Asymmetric clustering has one machine in hot-standby mode
• Symmetric clustering has multiple nodes running applications,
monitoring each other
❖Some clusters are for high-performance computing (HPC)
• Applications must be written to use parallelization
• Some have distributed lock manager (DLM) to avoid conflicting operations
CLUSTERED COMPUTING SYSTEMS
OPERATING SYSTEM IN REAL-TIME SYSTEMS

• Real-time embedded systems most prevalent form of


computers
• Special purpose, limited purpose OS,
• Use expanding

• Real-time OS has well-defined fixed time constraints


• Processing must be done within constraint.
• Correct operation only if constraints met.
OPEN-SOURCE OPERATING SYSTEMS

• Operating systems made available in source-code format rather than just binary
closed-source
• Counter to the copy protection and Digital Rights Management (DRM)
movement
• Examples include Linux and UNIX (including core of Mac OS X), and many more
• Can use VMM like VMware Player (Free on Windows),Virtualbox (open source and
free on many platforms - http://www.virtualbox.com )
• Use to run guest operating systems for exploration
CPU EXECUTION MODES

• CPUs supports (at least) 2 execution modes:

• User mode The code of the user programs

• Kernel mode (supervisor mode, system mode,


or privileged mode) The code of OS.
PROTECTING KERNEL MODE

• OS code executes in the Kernel mode


via interrupts and system calls
Note
• Only the OS code can be executed in the Kernel mode
• The user code must never be executed in the Kernel mode
OPERATING SYSTEM OPERATIONS
AS:

• Interrupt Control
• Timer
• System Call
INTERRUPTS
• Type of interrupts polling & vectored (interrupt system)
• An operating system is interrupt driven
• Interrupt transfers control to the interrupt service
routine. generally, through the interrupt vector, which
contains the addresses of all the service routines.
• A trap or exception is a software-generated interrupt
caused either by an error or a user request.
INTERRUPT TIMELINE
TIMER
• Timer to prevent infinite loop / process hogging resources
• Timer is set to interrupt the computer after some time period
• Keep a counter that is decremented by the physical clock.
• Operating system set the counter (privileged instruction)
• When counter zero generate an interrupt, Set up before scheduling process to
regain control or terminate program that exceeds allotted time
OPERATING SYSTEM STRUCTURE
➢ Multiprogramming (Multi-jobs)
Single user cannot always keep CPU and I/O devices busy.
• Multiprogramming organizes jobs (code and data) so CPU always has one to
execute.
• A subset of total jobs in system is kept in memory, One job selected and run via
job scheduling
When it must wait (for I/O for example), OS switches to another job.

➢ Timesharing (multitasking) is logical extension in which CPU switches jobs so


frequently that users can interact with each job while it is running, creating interactive
computing
• Response time should be < 1 second
• Each user has at least one program executing in memory process
• If several jobs ready to run at the same time  CPU scheduling
• If processes don’t fit in memory, swapping moves them in and out to run
• Virtual memory allows execution of processes not completely in memory
MULTIPROGRAMMING SYSTEM
I/O STRUCTURE
• After I/O starts, control returns to user program
without waiting for I/O completion
• System call – request to the OS to allow user to wait for
I/O completion
• Device-status table contains entry for each I/O device
indicating its type, address, and state
• OS indexes into I/O device table to determine device
status and to modify table entry to include interrupt
STORAGE STRUCTURE
• Main memory – only large storage media that the CPU can access directly
• Random access
• Typically volatile

• Secondary storage – extension of main memory that provides large nonvolatile


storage capacity
• Hard disks – rigid metal or glass platters covered with magnetic recording material
• Disk surface is logically divided into tracks, which are subdivided into sectors
• The disk controller determines the logical interaction between the device and the computer

• Solid-state disks – faster than hard disks, nonvolatile


• Various technologies
• Becoming more popular
STORAGE-DEVICE HIERARCHY

• Storage systems organized in


hierarchy
• Speed
• Cost
• Volatility
CACHING

• Important principle, performed at many levels in a computer


(in hardware, operating system, software)
• Information in use copied from slower to faster storage
temporarily
• Faster storage (cache) checked first to determine if
information is there
• If it is, information used directly from the cache (fast)
• If not, data copied to cache and used there

• Cache smaller than storage being cached


COMPUTER-SYSTEM ARCHITECTURE
➢ Systems use a single general-purpose processor OR Special-purpose
processor.
➢ Multiprocessors systems growing in use and importance called (parallel systems,
or tightly-coupled systems).
• Advantages include:

1. Increased throughput
2. Economy of scale
3. Increased reliability – fault tolerance
• Two types:
1. Asymmetric Multiprocessing – each processor is assigned a specie
task.
2. Symmetric Multiprocessing – each processor performs all tasks
SYMMETRIC MULTIPROCESSING ARCHITECTURE
HOW A MODERN COMPUTER WORKS

A von Neumann architecture


• Four independent CPU cores .
Two-way multithreading per CPU core
A built-in two-channel DDR3 DRAM controller
Integrated L1, L2, and L3 caches
direct media interface (DMI) connection
PROCESS MANAGEMENT

• A process is a program in execution. It is a unit of work


within the system. Program is a passive entity; process is an
active entity.
• Process needs resources to accomplish its task
• Process termination requires reclaim of any reusable
resources
• Single-threaded process has one program counter
specifying location of next instruction to execute (sequential)
• Multi-threaded process has one program counter per
thread
PROCESS MANAGEMENT ACTIVITIES

The operating system is responsible for the following activities in


connection with process management:

• Creating and deleting both user and system processes


• Suspending and resuming processes
• Providing mechanisms for process synchronization
• Providing mechanisms for process communication
• Providing mechanisms for deadlock handling
MEMORY MANAGEMENT

• To execute a program all (or part) of the instructions must be in memory


• All (or part) of the data that is needed by the program must be in memory.
• Memory management determines what is in memory and when
• Memory management activities
• Keeping track of which parts of memory are currently being used and by whom
• Deciding which processes and data to move into and out of memory
• Allocating and deallocating memory space as needed
STORAGE MANAGEMENT
• OS provides uniform, logical view of information storage
• Abstracts physical properties to logical storage unit - file
• Each medium is controlled by device (i.e., disk drive, tape drive).
• Varying properties include access speed, capacity, data-transfer rate,
access method (sequential or random)

• File-System management
• Files usually organized into directories
• Access control on most systems to determine who can access what.
➢OS activities include
• Creating and deleting files and directories
• Primitives to manipulate files and directories (how to open)
• Mapping files onto secondary storage
• Backup files onto stable (non-volatile) storage media
STORAGE MANAGEMENT
• Usually disks used to store data that does not fit in main memory or
data that must be kept for a “long” period.
• Proper management is of central importance.
• Entire speed of computer operation hinges on disk subsystem and
its algorithms.
• OS activities
• Free-space management
• Storage allocation
• Disk scheduling
MIGRATION OF DATA “A” FROM DISK TO REGISTER

• Multitasking environments must be careful to use most recent


value, no matter where it is stored in the storage hierarchy

• Multiprocessor environment must provide cache coherency in


hardware such that all CPUs have the most recent value in their
cache
PROTECTION AND SECURITY
• Protection – any mechanism for controlling access of processes
or users to resources defined by the OS.

• Security – defense of the system against internal and external


attacks

➢including denial-of-service, worms, viruses, theft of service

• Systems generally first distinguish among users, to determine who can


do what.
ASSIGNMENT 1

Compare Between any 3 Operating systems


Package
(at least 3 criteria)

You might also like