Top Banner

of 53

Lecture1-2 (1)

Apr 08, 2018

Download

Documents

Mohamed Essam
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/6/2019 Lecture1-2 (1)

    1/53

    Noha A. Yousri

    1

    Course : Operating Systems

    Lecturer: Noha A. Yousri

    Contact information: [email protected]

    Text Book:Operating Systems, by Deitel, Deitel and Choffnes, 3rd

    edition.

    References:

    Operating Systems, Internals and Design Principles, byWilliam Stallings, 3rd edition.

  • 8/6/2019 Lecture1-2 (1)

    2/53

    Noha A. Yousri

    2

    Course Objectives:

    -What is an Operating System

    -Understanding the major components of an OS

    (Theoretically and practically)-Case Studies

    Grading Scheme:

    Total marks: 125

    Final exam: 90

    Years work: 35

    (Midterm + sheets, quizes and programming assignments)

  • 8/6/2019 Lecture1-2 (1)

    3/53

    Noha A. Yousri

    3

    Course Contents:

    -Introduction (Deitel Ch. 1, Stallings Ch.2)

    -Hardware and Software

    -Processes Concepts-Thread Concepts

    -Concurrent Programming

    -Memory Management

    -Disk Scheduling

    -File management

    -Case studies: linux, Windows XP

  • 8/6/2019 Lecture1-2 (1)

    4/53

    Noha A. Yousri

    4

    Lecture 1

    Introduction

    What is an OS?

    History : Evolution of an OS

    Core components of an OS

    OS goals (characteristics) OS Architecture

  • 8/6/2019 Lecture1-2 (1)

    5/53

    Noha A. Yousri

    5

    Applications

    Operating System

    Hardware

    User(s)What is an OS?

    OS is the software that controls the hardware

    OS is the layer between applications and H.W

    OS is a resource manager

  • 8/6/2019 Lecture1-2 (1)

    6/53

    Noha A. Yousri

    6

    How a user interacts with an OS?

    -One or more user applications

    -Shell or command interpreter

    --Text based

    --GUI

    What is a kernel?

    S.W containing core components of OS

  • 8/6/2019 Lecture1-2 (1)

    7/53

    Noha A. Yousri

    7

    History : Evolution of Operating Systems

    Single Interactive User

  • 8/6/2019 Lecture1-2 (1)

    8/53

    Noha A. Yousri

    8

    -Single Interactive User (Serial processing )

    User uses switches/card reader for input,

    User examines cause of error from

    registers/memory

    Problems:

    Wasting an expensive resource (e.g. Reservingtime more than needed )

  • 8/6/2019 Lecture1-2 (1)

    9/53

    Noha A. Yousri

    9

    Single-job batch streaming:

  • 8/6/2019 Lecture1-2 (1)

    10/53

    Noha A. Yousri

    10

    -Single-job batch streaming:A batch of jobs are ready, read a job at a

    time,Job either uses CPU or I/O

    Job cant make CPU and I/O busy at the

    same time

    (A job is either CPU bound or I/O bound)

  • 8/6/2019 Lecture1-2 (1)

    11/53

    Noha A. Yousri

    11

    -Multiprogramming:

    Several jobs can execute by sharing CPU,and I/O

    Switch from a job using I/O to another job

    Manage resources, security issues, .

    -Interactive users : do not wait for batch outputs

    -Time sharing systems: for multiple users, eachrunning a job

    Interactive time sharing

  • 8/6/2019 Lecture1-2 (1)

    12/53

    Noha A. Yousri

    12

    Interactive time sharing

    Multiple Interactive UsersMultimode:

    Batch Processing, Real Time systems

  • 8/6/2019 Lecture1-2 (1)

    13/53

    Noha A. Yousri

    13

    Following are consequent evolutions:

    file system : Storing users files on the system

    Prioritized scheduling , and Distinguishing Jobs:Doing important jobs first:

    -Real time systems need fast response time.

    (highest level service)-Interactive applications (lower level service)

    -Batch streaming (lowest level: but reasonable

    delay)

    Resource management: disk quota for each user.

  • 8/6/2019 Lecture1-2 (1)

    14/53

    Noha A. Yousri

    14

    Communication between computers:

    Transferring data and information betweenpeople,

    LAN is now feasible

    Networking Issues?Security Issues?

    Graphical user interface :permitted multiple applications (process) to work

    concurrently

    Distributed systems: (appeared withcommunication)

    to exploit the resources that can be distributed atseveral places

  • 8/6/2019 Lecture1-2 (1)

    15/53

    Noha A. Yousri

    15

    Embedded systems:

    e.g. PDA (personal digital assistant), handheldcomputers, etc

    operating systems should consider issues as:

    power management, user friendly interface, limitedresources (memory, etc)..

  • 8/6/2019 Lecture1-2 (1)

    16/53

    Noha A. Yousri

    16

    Period of 1990s

    -Hardware performance improved

    -shift towards distributed computing accelerated

    -Object technology:Object Oriented Operating Systems (e.g. BeOS)

    -Open Source Movement

    -open source software (code available free of charge)

    -Graphical User Interface

    -Enhanced, more user friendly

    -Plug and Play technology

  • 8/6/2019 Lecture1-2 (1)

    17/53

    Noha A. Yousri

    17

    Period of 2000 & Beyond

    -Middleware : acts as a courier that passesmessages between components or applications (e.g.

    web server and database)*

    -Web Services: provides a set of applications thatother applications can invoke (helps enhance

    distributed computing)-Concurrent programming languages

    -Massive Parallelism

    *Middleware is computer software that connects software components or applications. The software

    consists of a set of enabling services that allow multiple processes running on one or more machines tointeract across a network. It sits "in the middle" between application software working on differentoperating systems (wikipedia definition)

  • 8/6/2019 Lecture1-2 (1)

    18/53

    Noha A. Yousri

    18

    Lecture #2

    (Continue Introduction)

    Operating System Environment

    Operating System Components

    Operating System Goals

    Operating System Architecture

  • 8/6/2019 Lecture1-2 (1)

    19/53

    Noha A. Yousri

    19

    Operating System Environments

    -Embedded systems

    -provide functionality to deal with specialized

    resources (e.g. limited storage, etc..)e.g. cell phones, PDAs

    -Real Time systems

    Enable processes to respond immediatelyto a

    criticalevent

    e.g. autopilot feature of an aircraft

    -Business critical systems

    -Fast response time to purchasing transacions

  • 8/6/2019 Lecture1-2 (1)

    20/53

    Noha A. Yousri

    20

    Operating System Environments

    Virtual Machines

    -Software implementation of a computer

    -Executes as an application on top of native OS

    Applications:

    -Allows multiple OSs to operate concurrently

    -Emulation: Mimics functionality of S.W or

    H.W not present in system-Portability

  • 8/6/2019 Lecture1-2 (1)

    21/53

    Noha A. Yousri

    21

    2004, Deitel & Associations, Inc, All Rights reserved

    Virtual Machine

    Operating System Environments

  • 8/6/2019 Lecture1-2 (1)

    22/53

    Noha A. Yousri

    22

    What are the core components ofan

    operating system?

  • 8/6/2019 Lecture1-2 (1)

    23/53

    Noha A. Yousri

    23

    Revise that:

    OS evolved to fill new roles

    Evolution:

    No OS

    Multiprogramming

    Time sharingPersonal Computer

    Distributed System

  • 8/6/2019 Lecture1-2 (1)

    24/53

    Noha A. Yousri

    24

    Memory

    I/O

    CPU

    P1

    P2

    P3

    P4 P5

    Infer the core componentsfrom the diagram.

    What are the main elements?

    Storage

    Processes

  • 8/6/2019 Lecture1-2 (1)

    25/53

    Noha A. Yousri

    25

    Think about these:

    - When Nprocesses are ready, which process executesfirst? Why?

    -Can a process access any address in memory? How is

    memory shared among different processes?

    -When the total memory is occupied, what otherresources can be used to extend it? How?

    -Sometimes, processes should tell one another abouttheir status when they share a resource, how can this bedone?

    -Processes compete to send a request to I/O (e.g. disk),which process goes first?

    -How can some data be written to the disk? Allocated

    certain space on disk? Accessed from disk?

    OS Components

  • 8/6/2019 Lecture1-2 (1)

    26/53

    Noha A. Yousri

    26

    Multiprogramming: applications execute concurrently

    When N processes are ready, which process executes first?Why?

    1- Processor Scheduler

    When does a process execute?

    For how long a process executes?

    Which processor executes the process?

    solution

    OS Components

    OS C

  • 8/6/2019 Lecture1-2 (1)

    27/53

    Noha A. Yousri

    27

    Processes will compete for resources e.g. memory

    One process should not interfere with the space

    allocated to another processes or to space allocatedto the OS

    When the memory is full, what can be done to

    execute a process demanding large space?

    2-Memory Manager

    When is memory allocated to a process?

    How is memory is allocated to it?

    How to manage a full memory?

    solution

    OS Components

    OS C t

  • 8/6/2019 Lecture1-2 (1)

    28/53

    Noha A. Yousri

    28

    When a process wants to access I/O (most commonly disk),

    what happens?

    A process issues a system call to the OS.

    A system call is handled by a device

    manager ( a S.W that interacts with H.W)

    Problem!!!

    Secondary storage much slower than processor and

    main memory solution

    3-I/O Manager

    Service I/O requests from/to H.W devices

    e.g. Disk Scheduler: maximize performance,

    Minimize time process waits for I/O

    OS Components

    OS C t

  • 8/6/2019 Lecture1-2 (1)

    29/53

    Noha A. Yousri

    29

    solution

    Files are named collections of data

    A Need for organizing them on storage device

    Need an interface to access data on the

    storage device

    4- File System Manager

    OS Components

    OS Components

  • 8/6/2019 Lecture1-2 (1)

    30/53

    Noha A. Yousri

    30

    Can processes (or threads) cooperateto finish a job?

    How can they coordinate and be able to communicate,share datawhile concurrently executing?

    solution

    5- Inter Process Communication (IPC)

    -Processes communicate through messages

    -Synchronization is required to share data

    OS Components

    OS Components

  • 8/6/2019 Lecture1-2 (1)

    31/53

    Noha A. Yousri

    31

    1-Processor Scheduler

    2-Memory Manager

    3-I/O Manager

    4-File Manager

    5-Inter Process Communication

    OS Components

  • 8/6/2019 Lecture1-2 (1)

    32/53

    Noha A. Yousri

    32

    Characteristics (& Goals) of an OS

    -Maximize amount of work a processor can

    complete, given a time period

    i.e. Maximize throughput-Minimize time spent for a certain service

    i.e Minimize turn around time

    Efficiency

  • 8/6/2019 Lecture1-2 (1)

    33/53

    Noha A. Yousri

    33

    Characteristics (& Goals) of an OS

    System should not fail on isolated H.W/S.W errors

    if it fails, it should prevent damage/loss ofwork or data

    Robustness

    FaultTolerance

    Reliability

  • 8/6/2019 Lecture1-2 (1)

    34/53

    Noha A. Yousri

    34

    Characteristics (& Goals) of an OS

    When resources are added to the system , shallthey be fully utilized?

    e.g. when more processors are added

    processing capacity should increase

    w.r.t to the number of processes

    ScalabilityAbility to use

    resources as

    they are added

  • 8/6/2019 Lecture1-2 (1)

    35/53

    Noha A. Yousri

    35

    Characteristics (& Goals) of an OS

    When new technologies appear, what happens toan OS?

    Can an OS extend to adaptto new technologies?

    Extensibility extend to adaptto new tech.

  • 8/6/2019 Lecture1-2 (1)

    36/53

    Noha A. Yousri

    36

    Characteristics (& Goals) of an OS

    -Different hardware configurations??

    Portability

    Operate on

    many H.Wconfigurations

  • 8/6/2019 Lecture1-2 (1)

    37/53

    Noha A. Yousri

    37

    Characteristics (& Goals) of an OS

    Users should have certain authorization limits to

    protect a system against interference/hacking..etc

    Security

  • 8/6/2019 Lecture1-2 (1)

    38/53

    Noha A. Yousri

    38

    Interactivity

    Characteristics (& Goals) of an OS

    Quick Response

    Detect errors

  • 8/6/2019 Lecture1-2 (1)

    39/53

    Noha A. Yousri

    39

    Characteristics (& Goals) of an OS

    Easy to use

    Support large set of applications

    Use standard user interface (friendly one)

    Usability

  • 8/6/2019 Lecture1-2 (1)

    40/53

    Noha A. Yousri

    40

    Interactivity

    Security

    Robustness

    Extensibility

    Efficiency

    Scalability

    Portability

    Usability

  • 8/6/2019 Lecture1-2 (1)

    41/53

    Noha A. Yousri

    41

    Operating System Architecture:

    -Monolithic

    -Layered

    -Micro Kernel

    -Network and Distributed OS

  • 8/6/2019 Lecture1-2 (1)

    42/53

    Noha A. Yousri

    42

    Operating System Architecture:

    1-Monolithic

    -Earliest and most common architecture

    -Every component is inside the kernel anddirectly communicates with any other componentusing function calls

    -Kernel executes with unrestricted access to the

    computer system

    -e.g. linux

  • 8/6/2019 Lecture1-2 (1)

    43/53

    Noha A. Yousri

    43

    2004, Deitel & Associations, Inc, All Rights reserved

  • 8/6/2019 Lecture1-2 (1)

    44/53

    Noha A. Yousri

    44

    Monolithic Architecture:

    Advantages:

    Highly efficient : direct intercommunication

    between components

    Disadvantages:

    -Difficult o isolate source of bugs or errors

    -Susceptible to damage due to unrestricted

    access to system

    Operating System Architecture:

  • 8/6/2019 Lecture1-2 (1)

    45/53

    Noha A. Yousri

    45

    Operating System Architecture:

    OS is more complex, and larger, lead to:

    2- Layered Architecture

    -Group components according to functionalityinto layers

    -Each layer communicate with the layer above it

    or below it

    -lower layers provide services to higher ones

    using an interface that hides implementation

    E.g. WinXP (some level of layering)

  • 8/6/2019 Lecture1-2 (1)

    46/53

    Noha A. Yousri

    46

    2004, Deitel & Associations, Inc, All Rights reserved

  • 8/6/2019 Lecture1-2 (1)

    47/53

    Noha A. Yousri

    47

    Layered Architecture:

    Advantages:

    More modular than monlithic

    Easy to modify a layer without modifying

    other layers

    Reusable

    Hiding complexities, and using standard

    interface

    Structured and consistent

    Simplifies validation, debugging

    L d A hit t

  • 8/6/2019 Lecture1-2 (1)

    48/53

    Noha A. Yousri

    48

    Layered Architecture:

    Disadvantages:

    A users request passes through many layers

    before service Additional methods needs to pass data from

    one layer to the next

    performance degrades (compared to

    monolithic architecture)

    Unrestricted access to system

    Susceptible to damage from malicious code

    O i S A hi

  • 8/6/2019 Lecture1-2 (1)

    49/53

    Noha A. Yousri

    49

    Operating System Architecture:

    3-MicroKernel

    -Keep kernel small and scalable

    -Limit no. of services to

    e.g.: low level memory management

    Interprocess communication

    Basic Process synchronization

    -Other services execute outside kernel with lowerprivilege

  • 8/6/2019 Lecture1-2 (1)

    50/53

    Noha A. Yousri

    50

    2004, Deitel & Associations, Inc, All Rights reserved

    MicroKernel

  • 8/6/2019 Lecture1-2 (1)

    51/53

    Noha A. Yousri

    51

    MicroKernel

    Advantages:

    -High degree of modularity making them:

    -Portable, Scalable and Extensible

    -One or more components failure does not cause

    OS to fail

    Disadvantages:

    -High modularity level causes

    increased level of intermodule communication

    performance degradation

    Operating S stem Architect re

  • 8/6/2019 Lecture1-2 (1)

    52/53

    Noha A. Yousri

    52

    Operating System Architecture:

    4-Networked and Distributed OS

    Network OS:

    Enables its processes to access resources(e.g. files) that reside on independent computers

    Structure based on client/server modelClients request resources

    Server respondsDistributed OS:

    Single OS that manages resources on more than

    one computer

  • 8/6/2019 Lecture1-2 (1)

    53/53

    Noha A. Yousri

    53

    Client/server Networked OS

    2004, Deitel & Associations, Inc, All Rights reserved