1. Basic Operating System Concepts

Embed Size (px)

Citation preview

  • 8/11/2019 1. Basic Operating System Concepts

    1/42

    Basic Operating

    System Concepts

    Ami Tri Cahyadi

  • 8/11/2019 1. Basic Operating System Concepts

    2/42

    Toleransi Keterlambatan : (maks) 15menit

    Presensi (kehadiran) : (min) 80%

    Komponen Penilaian :

    Presensi : 10%Kuis : 10%

    Tugas : 30%

    UTS : 25%

    UAS : 25%

  • 8/11/2019 1. Basic Operating System Concepts

    3/42

    Learning materials

    1.Introduction to Operating Systems

    2.Basic Operating System Concepts

    3.Process Management

    4.Interprocess Communication & Synchronization5.Memory Management

    6.File System Management

    7. Device Management

  • 8/11/2019 1. Basic Operating System Concepts

    4/42

    Reference :

    Stallings, William, Operating Systems, SecondEdition, Prentice-Hall International Editions,Englewood Cliffs, New Jersey, 1995.

    Tanenbaum, Andrew S., Modern OperatingSystems, Prentice-Hall International Editions,Englewood Cliffs, New Jersey, 1992.

  • 8/11/2019 1. Basic Operating System Concepts

    5/42

    Personal Computer OSMobile DevicesServer

    Embedded Devices

  • 8/11/2019 1. Basic Operating System Concepts

    6/42

    What is an Operating

    System?

    An Operating systemis basically a intermediaryagent between the user and the computerhardware.

    Manages the computers resources (hardware,abstract resources, software)

    Its a resource allocator.It is also used to control programs to prevent errors

    and improper computer use.It is interrupt driven.

  • 8/11/2019 1. Basic Operating System Concepts

    7/42

  • 8/11/2019 1. Basic Operating System Concepts

    8/42

    Operating System Benefits

    Simplifies hardware control forapplications

    Enforcer of sharing, fairness andsecurity with the goal of better overall

    performanceTrade-off between fairness and

    performanceTrade-off between optimal algorithms and

    lean algorithms OS is overhead.Provides abstract resourcesSocketsInter-process communication

  • 8/11/2019 1. Basic Operating System Concepts

    9/42

    History of Operating

    Systems

    Earliest computers had no Operating SystemApplications loaded manually

    Users were experts on the hardwareFirst System Softwarewas libraries of codeto manage devices.

    This grew to batch processing systems, wheresome focused on application programming and

    some on systems programming.

  • 8/11/2019 1. Basic Operating System Concepts

    10/42

  • 8/11/2019 1. Basic Operating System Concepts

    11/42

  • 8/11/2019 1. Basic Operating System Concepts

    12/42

    Timesharing

    A timesharing systemallows multipleusers to interact with a computer atthe same time

    Multiprogrammingallowed multipleprocesses to be active at once, whichgave rise to the ability for programmersto interact with the computer system

    directly, while still sharing its resourcesIn a timesharing system, each user has

    his or her own virtual machine, in which

  • 8/11/2019 1. Basic Operating System Concepts

    13/42

    The IBM 650 Magnetic

    Drum Data ProcessingSystem Machine

    Cray I supercomputer,

    introduced in 1976

  • 8/11/2019 1. Basic Operating System Concepts

    14/42

    Current Operating Systems

    Research Topics

    Symmetric multiprocessing

    Allows for several CPUs to process multiple jobs at the sametime. CPUs are independent of one another, but each hasaccess to the operating system.Asymmetric multiprocessing

    Some operating systems functions are assigned tosubordinate processors, which take their instructions fromthe main CPU.Distributed processing

    Processors are placed at remote locations and are connectedto each other via telecom devices. Different from symmetric

    multiprocessing systems as they do not share memory.Computations can be dispersed among several processors.

  • 8/11/2019 1. Basic Operating System Concepts

    15/42

    COMPUTER

    ARCHITECTURE

    Ami Tri Cahyadi

  • 8/11/2019 1. Basic Operating System Concepts

    16/42

    The computer is in a sense a communication system.Data is constantly being moved between the CPU,

    memory and the various devices.The CPU uses I/O addresses to direct data to

    particular devices.The devices in turn use interrupts to notify theCPU and operating system of their needs.

  • 8/11/2019 1. Basic Operating System Concepts

    17/42

  • 8/11/2019 1. Basic Operating System Concepts

    18/42

    The Von-Neumann

    Architecture

  • 8/11/2019 1. Basic Operating System Concepts

    19/42

    CPU Control Unit

  • 8/11/2019 1. Basic Operating System Concepts

    20/42

    Arithmetic Logic Unit

  • 8/11/2019 1. Basic Operating System Concepts

    21/42

    The Von-Neumann Loop

    Fetch hase

    Fetch the next instruction and store it in the

    instruction registerExecute hase

    The ALU or I/O unit executes the instructionALUdoes calculationsI/O unitloads or stores data between

    main memory and registers

  • 8/11/2019 1. Basic Operating System Concepts

    22/42

  • 8/11/2019 1. Basic Operating System Concepts

    23/42

  • 8/11/2019 1. Basic Operating System Concepts

    24/42

  • 8/11/2019 1. Basic Operating System Concepts

    25/42

    How Operating

    Systems Work

    Ami Tri Cahyadi

  • 8/11/2019 1. Basic Operating System Concepts

    26/42

    Role of Interrupts

    Interrupts are signals sent to the CPU by external devices, normally I/Odevices. They tell the CPU to stop its current activities and execute theappropriate part of the operating system.

    1.Hardware Interuptsare generated by hardware devices to signal that they

    need some attention from the OS.2.Software Interuptsare generated by programs when they want to requesta system callto be performed by the operating system.3.Traps are generated by the CPU itself to indicate that some error orcondition occured for which assistance from the operating system is needed.

  • 8/11/2019 1. Basic Operating System Concepts

    27/42

    CPU Execution Mode

    There are two modes of execution,known as user mode and kernel orsupervisor mode.

    User mode is restricted in that certaininstructions cannot be executed, certainregisters cannot be accessed, and I/Odevices can not be accessed.

    Kernel mode has none of theserestrictions. A system callwill set theCPU to kernel mode, as will traps and

    .

  • 8/11/2019 1. Basic Operating System Concepts

    28/42

    Supervisor modeCan execute all machineinstructionsCan reference all memory

    locations

    User modeCan only execute a subset ofinstructions

    Can only reference a subsetof memory locations

  • 8/11/2019 1. Basic Operating System Concepts

    29/42

    CPU Response to

    Interrupts

    The CPU performs the followingactions in response to an interrupt:

    Using the pointer to the current processcontrol block, the state and all registervalues for the process are saved for usewhen the process is later restarted.

    The CPU mode bit is switchedto supervisorymode.

    Using the pointer to the interrupthandler table and the interrupt vector, thelocation of the kernel code to execute isdetermined. The interru t vector is the IRQ

  • 8/11/2019 1. Basic Operating System Concepts

    30/42

  • 8/11/2019 1. Basic Operating System Concepts

    31/42

  • 8/11/2019 1. Basic Operating System Concepts

    32/42

  • 8/11/2019 1. Basic Operating System Concepts

    33/42

  • 8/11/2019 1. Basic Operating System Concepts

    34/42

    Interrupt Processing

  • 8/11/2019 1. Basic Operating System Concepts

    35/42

    PARTS OF OPERATING

    SYSTEM

    Ami Tri Cahyadi

  • 8/11/2019 1. Basic Operating System Concepts

    36/42

    rocess Management

    Aprocessis an executing program. It hasits code, data, a certain set of resourcesallowed to it, and one or more flows ofexecution through the code.The OS manages the allocation of resourcesto these processes, and also provides

    system calls to manage these processes.

  • 8/11/2019 1. Basic Operating System Concepts

    37/42

    Memory Management

    Memory must be shared between the OS and anapplication program.The OS must manage the allocation of memory toprocesses and control the memory managementhardware that determines which memory locations aprocess may access.

  • 8/11/2019 1. Basic Operating System Concepts

    38/42

    File System Management

    Computers process information that must betransmitted, processed, or stored.

    File systems are an abstract organized collection offile system objects.The OS provides primitives to manipulate theseobjects

  • 8/11/2019 1. Basic Operating System Concepts

    39/42

    Device Management

    Information is sent through a computersinput and output devices.

    Processes access these devices using

    the system callinterface.The OS tries to manage said devices in a

    manner that makes them efficiently sharedamong all processes requiring them.

    A system callis a programming interfaceto the services provided by the OS,typically written in C/C++

  • 8/11/2019 1. Basic Operating System Concepts

    40/42

    Evolution of an

    Operating System

  • 8/11/2019 1. Basic Operating System Concepts

    41/42

    Hardware upgrades plus new types ofhardware

    New services & ToolsFixes: Any OS has faults. These are

    discovered over the course of time andfixes are made.

  • 8/11/2019 1. Basic Operating System Concepts

    42/42