Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • https://www.senthilkanth.blogspot.in
  • https://www.senthilkanth.blogspot.in
  • 1.Introduction

    1. 1. Chapter 1: IntroductionChapter 1: Introductionhttps://www.senthilkanth.blogspot.in
    2. 2. 1.2 Silberschatz, Galvin and GagneOperating System ConceptsChapter 1: IntroductionChapter 1: IntroductionWhat Operating Systems DoComputer-System OrganizationComputer-System ArchitectureOperating-System StructureOperating-System OperationsProcess ManagementMemory ManagementStorage ManagementProtection and SecurityDistributed SystemsSpecial-Purpose SystemsComputing Environments
    3. 3. 1.3 Silberschatz, Galvin and GagneOperating System ConceptsObjectivesObjectivesTo provide a grand tour of the major operating systemscomponentsTo provide coverage of basic computer system organization
    4. 4. 1.4 Silberschatz, Galvin and GagneOperating System ConceptsWhat is an Operating System?What is an Operating System?A program that acts as an intermediary between a user of acomputer and the computer hardware.Operating system goals:Execute user programs and make solving user problemseasier.Make the computer system convenient to use.Use the computer hardware in an efficient manner.
    5. 5. 1.5 Silberschatz, Galvin and GagneOperating System ConceptsComputer System StructureComputer System StructureComputer system can be divided into four componentsHardware – provides basic computing resources CPU, memory, I/O devicesOperating system Controls and coordinates use of hardware among variousapplications and usersApplication programs – define the ways in which the systemresources are used to solve the computing problems of theusers Word processors, compilers, web browsers, databasesystems, video gamesUsers People, machines, other computers
    6. 6. 1.6 Silberschatz, Galvin and GagneOperating System ConceptsFour Components of a Computer SystemFour Components of a Computer System
    7. 7. 1.7 Silberschatz, Galvin and GagneOperating System ConceptsOperating System DefinitionOperating System DefinitionOS is a resource allocatorManages all resourcesDecides between conflicting requests for efficient and fairresource useOS is a control programControls execution of programs to prevent errors and improperuse of the computer
    8. 8. 1.8 Silberschatz, Galvin and GagneOperating System ConceptsOperating System Definition (Cont.)Operating System Definition (Cont.)No universally accepted definition“Everything a vendor ships when you order an operating system”is good approximationBut varies wildly“The one program running at all times on the computer” is thekernel. Everything else is either a system program (ships withthe operating system) or an application program
    9. 9. 1.9 Silberschatz, Galvin and GagneOperating System ConceptsComputer StartupComputer Startupbootstrap program is loaded at power-up or rebootTypically stored in ROM or EEPROM, generally known asfirmwareInitializates all aspects of systemLoads operating system kernel and starts execution
    10. 10. 1.10 Silberschatz, Galvin and GagneOperating System ConceptsComputer System OrganizationComputer System OrganizationComputer-system operationOne or more CPUs, device controllers connect throughcommon bus providing access to shared memoryConcurrent execution of CPUs and devices competing formemory cycles
    11. 11. 1.11 Silberschatz, Galvin and GagneOperating System ConceptsComputer-System OperationComputer-System OperationI/O devices and the CPU can execute concurrently.Each device controller is in charge of a particular device type.Each device controller has a local buffer.CPU moves data from/to main memory to/from local buffersI/O is from the device to local buffer of controller.Device controller informs CPU that it has finished its operation bycausing an interrupt.
    12. 12. 1.12 Silberschatz, Galvin and GagneOperating System ConceptsCommon Functions of InterruptsCommon Functions of InterruptsInterrupt transfers control to the interrupt service routine generally,through the interrupt vector, which contains the addresses of all theservice routines.Interrupt architecture must save the address of the interruptedinstruction.Incoming interrupts are disabled while another interrupt is beingprocessed to prevent a lost interrupt.A trap is a software-generated interrupt caused either by an erroror a user request.An operating system is interrupt driven.
    13. 13. 1.13 Silberschatz, Galvin and GagneOperating System ConceptsInterrupt HandlingInterrupt HandlingThe operating system preserves the state of the CPU by storingregisters and the program counter.Determines which type of interrupt has occurred:pollingvectored interrupt systemSeparate segments of code determine what action should be takenfor each type of interrupt
    14. 14. 1.14 Silberschatz, Galvin and GagneOperating System ConceptsInterrupt TimelineInterrupt Timeline
    15. 15. 1.15 Silberschatz, Galvin and GagneOperating System ConceptsI/O StructureI/O StructureAfter I/O starts, control returns to user program only upon I/Ocompletion.Wait instruction idles the CPU until the next interruptWait loop (contention for memory access).At most one I/O request is outstanding at a time, nosimultaneous I/O processing.After I/O starts, control returns to user program without waitingfor I/O completion.System call – request to the operating system to allow userto wait for I/O completion.Device-status table contains entry for each I/O deviceindicating its type, address, and state.Operating system indexes into I/O device table to determinedevice status and to modify table entry to include interrupt.
    16. 16. 1.16 Silberschatz, Galvin and GagneOperating System ConceptsTwo I/O MethodsTwo I/O MethodsSynchronous Asynchronous
    17. 17. 1.17 Silberschatz, Galvin and GagneOperating System ConceptsDevice-Status TableDevice-Status Table
    18. 18. 1.18 Silberschatz, Galvin and GagneOperating System ConceptsDirect Memory Access StructureDirect Memory Access StructureUsed for high-speed I/O devices able to transmit information atclose to memory speeds.Device controller transfers blocks of data from buffer storagedirectly to main memory without CPU intervention.Only on interrupt is generated per block, rather than the oneinterrupt per byte.
    19. 19. 1.19 Silberschatz, Galvin and GagneOperating System ConceptsStorage StructureStorage StructureMain memory – only large storage media that the CPU can accessdirectly.Secondary storage – extension of main memory that provides largenonvolatile storage capacity.Magnetic disks – rigid metal or glass platters covered with magneticrecording materialDisk surface is logically divided into tracks, which aresubdivided into sectors.The disk controller determines the logical interaction betweenthe device and the computer.
    20. 20. 1.20 Silberschatz, Galvin and GagneOperating System ConceptsStorage HierarchyStorage HierarchyStorage systems organized in hierarchy.SpeedCostVolatilityCaching – copying information into faster storage system; mainmemory can be viewed as a last cache for secondary storage.
    21. 21. 1.21 Silberschatz, Galvin and GagneOperating System ConceptsStorage-Device HierarchyStorage-Device Hierarchy
    22. 22. 1.22 Silberschatz, Galvin and GagneOperating System ConceptsCachingCachingImportant principle, performed at many levels in a computer (inhardware, operating system, software)Information in use copied from slower to faster storage temporarilyFaster storage (cache) checked first to determine if information isthereIf it is, information used directly from the cache (fast)If not, data copied to cache and used thereCache smaller than storage being cachedCache management important design problemCache size and replacement policy
    23. 23. 1.23 Silberschatz, Galvin and GagneOperating System ConceptsPerformance of Various Levels of StoragePerformance of Various Levels of StorageMovement between levels of storage hierarchy can be explicit orimplicit
    24. 24. 1.24 Silberschatz, Galvin and GagneOperating System ConceptsMigration of Integer A from Disk toMigration of Integer A from Disk toRegisterRegisterMultitasking environments must be careful to use most recentvalue, not matter where it is stored in the storage hierarchyMultiprocessor environment must provide cache coherency inhardware such that all CPUs have the most recent value in theircacheDistributed environment situation even more complexSeveral copies of a datum can existVarious solutions covered in Chapter 17
    25. 25. 1.25 Silberschatz, Galvin and GagneOperating System ConceptsOperating System StructureOperating System StructureMultiprogramming needed for efficiencySingle user cannot keep CPU and I/O devices busy at all timesMultiprogramming organizes jobs (code and data) so CPU always hasone to executeA subset of total jobs in system is kept in memoryOne job selected and run via job schedulingWhen it has to wait (for I/O for example), OS switches to another jobTimesharing (multitasking) is logical extension in which CPU switchesjobs so frequently that users can interact with each job while it is running,creating interactive computingResponse time should be < 1 secondEach user has at least one program executing in memory processIf several jobs ready to run at the same time  CPU schedulingIf processes don’t fit in memory, swapping moves them in and out torunVirtual memory allows execution of processes not completely inmemory
    26. 26. 1.26 Silberschatz, Galvin and GagneOperating System ConceptsMemory Layout for MultiprogrammedMemory Layout for MultiprogrammedSystemSystem
    27. 27. 1.27 Silberschatz, Galvin and GagneOperating System ConceptsOperating-System OperationsOperating-System OperationsInterrupt driven by hardwareSoftware error or request creates exception or trapDivision by zero, request for operating system serviceOther process problems include infinite loop, processes modifyingeach other or the operating systemDual-mode operation allows OS to protect itself and other systemcomponentsUser mode and kernel modeMode bit provided by hardware Provides ability to distinguish when system is running usercode or kernel code Some instructions designated as privileged, onlyexecutable in kernel mode System call changes mode to kernel, return from call resetsit to user
    28. 28. 1.28 Silberschatz, Galvin and GagneOperating System ConceptsTransition from User to Kernel ModeTransition from User to Kernel ModeTimer to prevent infinite loop / process hogging resourcesSet interrupt after specific periodOperating system decrements counterWhen counter zero generate an interruptSet up before scheduling process to regain control or terminateprogram that exceeds allotted time
    29. 29. 1.29 Silberschatz, Galvin and GagneOperating System ConceptsProcess ManagementProcess ManagementA 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 taskCPU, memory, I/O, filesInitialization dataProcess termination requires reclaim of any reusable resourcesSingle-threaded process has one program counter specifying location ofnext instruction to executeProcess executes instructions sequentially, one at a time, untilcompletionMulti-threaded process has one program counter per threadTypically system has many processes, some user, some operating systemrunning concurrently on one or more CPUsConcurrency by multiplexing the CPUs among the processes / threads
    30. 30. 1.30 Silberschatz, Galvin and GagneOperating System ConceptsProcess Management ActivitiesProcess Management ActivitiesThe operating system is responsible for the following activities inconnection with process management:Creating and deleting both user and system processesSuspending and resuming processesProviding mechanisms for process synchronizationProviding mechanisms for process communicationProviding mechanisms for deadlock handling
    31. 31. 1.31 Silberschatz, Galvin and GagneOperating System ConceptsMemory ManagementMemory ManagementAll data in memory before and after processingAll instructions in memory in order to executeMemory management determines what is in memory whenOptimizing CPU utilization and computer response to usersMemory management activitiesKeeping track of which parts of memory are currently beingused and by whomDeciding which processes (or parts thereof) and data to moveinto and out of memoryAllocating and deallocating memory space as needed
    32. 32. 1.32 Silberschatz, Galvin and GagneOperating System ConceptsStorage ManagementStorage ManagementOS provides uniform, logical view of information storageAbstracts physical properties to logical storage unit - fileEach 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 managementFiles usually organized into directoriesAccess control on most systems to determine who can accesswhatOS activities include Creating and deleting files and directories Primitives to manipulate files and dirs Mapping files onto secondary storage Backup files onto stable (non-volatile) storage media
    33. 33. 1.33 Silberschatz, Galvin and GagneOperating System ConceptsMass-Storage ManagementMass-Storage ManagementUsually disks used to store data that does not fit in main memory or datathat must be kept for a “long” period of time.Proper management is of central importanceEntire speed of computer operation hinges on disk subsystem and itsalgorithmsOS activitiesFree-space managementStorage allocationDisk schedulingSome storage need not be fastTertiary storage includes optical storage, magnetic tapeStill must be managedVaries between WORM (write-once, read-many-times) and RW (read-write)
    34. 34. 1.34 Silberschatz, Galvin and GagneOperating System ConceptsI/O SubsystemI/O SubsystemOne purpose of OS is to hide peculiarities of hardware devicesfrom the userI/O subsystem responsible forMemory management of I/O including buffering (storing datatemporarily while it is being transferred), caching (storing partsof data in faster storage for performance), spooling (theoverlapping of output of one job with input of other jobs)General device-driver interfaceDrivers for specific hardware devices
    35. 35. 1.35 Silberschatz, Galvin and GagneOperating System ConceptsProtection and SecurityProtection and SecurityProtection – any mechanism for controlling access of processesor users to resources defined by the OSSecurity – defense of the system against internal and externalattacksHuge range, including denial-of-service, worms, viruses,identity theft, theft of serviceSystems generally first distinguish among users, to determine whocan do whatUser identities (user IDs, security IDs) include name andassociated number, one per userUser ID then associated with all files, processes of that user todetermine access controlGroup identifier (group ID) allows set of users to be definedand controls managed, then also associated with each process,filePrivilege escalation allows user to change to effective IDwith more rights
    36. 36. 1.36 Silberschatz, Galvin and GagneOperating System ConceptsComputing EnvironmentsComputing EnvironmentsTraditional computerBlurring over timeOffice environment PCs connected to a network, terminals attached tomainframe or minicomputers providing batch andtimesharing Now portals allowing networked and remote systemsaccess to same resourcesHome networks Used to be single system, then modems Now firewalled, networked
    37. 37. 1.37 Silberschatz, Galvin and GagneOperating System ConceptsComputing Environments (Cont.)Computing Environments (Cont.)Client-Server ComputingDumb terminals supplanted by smart PCsMany systems now servers, responding to requests generated byclients Compute-server provides an interface to client to requestservices (i.e. database) File-server provides interface for clients to store and retrievefiles
    38. 38. 1.38 Silberschatz, Galvin and GagneOperating System ConceptsPeer-to-Peer ComputingPeer-to-Peer ComputingAnother model of distributed systemP2P does not distinguish clients and serversInstead all nodes are considered peersMay each act as client, server or bothNode must join P2P network Registers its service with central lookup service on network,or Broadcast request for service and respond to requests forservice via discovery protocolExamples include Napster and Gnutella
    39. 39. 1.39 Silberschatz, Galvin and GagneOperating System ConceptsWeb-Based ComputingWeb-Based ComputingWeb has become ubiquitousPCs most prevalent devicesMore devices becoming networked to allow web accessNew category of devices to manage web traffic among similarservers: load balancersUse of operating systems like Windows 95, client-side, haveevolved into Linux and Windows XP, which can be clients andservers
    40. 40. End of Chapter 1End of Chapter 1https://www.senthilkanth.blogspot.in