LECTURE 9: Operating Systems - PowerPoint PPT Presentation

lecture 9 operating systems n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
LECTURE 9: Operating Systems PowerPoint Presentation
Download Presentation
LECTURE 9: Operating Systems

play fullscreen
1 / 87
LECTURE 9: Operating Systems
165 Views
Download Presentation
lenore-massey
Download Presentation

LECTURE 9: Operating Systems

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. LECTURE 9:Operating Systems CIS410 Hardware and Software Architecture Winter 2012 Instructor: Dr. Song Xing Department of Information Systems California State University, Los Angeles

  2. Learning Objectives Describe the types of the operating system and the services provided. Describe how an operating system manages processes and threads Compare and contrast alternative CPU scheduling methods 2 Hardware and Software Architecture

  3. Lecture Topics 3

  4. Outline Services provided by OS User interface types Kernel Hardware and the OS Types of OS Start a computer system Processes management CPU allocation Hardware and Software Architecture

  5. Integrated Computer Environment Hardware and Software Architecture

  6. Operating System (OS) Overview • Most important component of system software • Primary purpose: Manages all hardware resources and allocates them to users and applications as needed • Manages CPU, memory, processes, secondary storage (files), I/O devices, and users • Performs many low-level tasks on behalf of users and application programs • Accesses files and directories, creates and moves windows, and accesses resources over a network

  7. Basic Services • Programs that accept commands and requests from a user and a user’s program • Manages, loads, and executes programs • Manages hardware resources of the computer • Acts as an interface between the user and the system Hardware and Software Architecture

  8. Additional Services • Provides interfaces for the user and the user’s programs • Provides file support services • Provides I/O support services • Provides means of starting the computer • Handles all interrupt processing • Provides network services Hardware and Software Architecture

  9. Additional Services (Cont.) • Provides tools and services for concurrent processing • A multitasking OS can execute many programs or dozens, hundreds, or thousands of threads in the same time frame. • “Threads” will be introduced soon. • Most computers have only one or few CPUs, threads must share CPUs. • Concurrent processing is the means used to simulate the simultaneous execution of multiple programs (threads) to provide multitasking and multiuser support. Hardware and Software Architecture

  10. Services Required by Concurrent Processing • Allocates resources such as memory, CPU time, and I/O devices to programs • Protects users and programs from each other and provides for inter-program communication • Provides feedback to the system administrators to permit performance optimization of the computer system Hardware and Software Architecture

  11. Resource Allocation Process • Resource allocation: ensure that overall system objectives are achieved efficiently and effectively • Keeps detailed records of available resources • Knows which resources are used to satisfy which requests • Schedules resources based on specific allocation policies to meet present and anticipated demands • Updates records to reflect resources commitment and release by processes and users

  12. Real and Virtual Resources • Real resource – a computer system’s physical devices and associated system software • Virtual resource – the resources that are apparent to a process or user • Meet or exceed real resources by • Rapidly shifting resources unused by one program to other programs that need them • Example: interrupt processing • Substituting one type of resource for another • Example: Memory is temporarily substituted for CPU registers while a program is suspended, pending completion of an I/O request. Hardware and Software Architecture

  13. Simplified Diagram of Operating System Services Hardware and Software Architecture

  14. Operating System Management Functions Hardware and Software Architecture

  15. Operating System Layers • Using layers makes the OS easier to maintain • Command layer (shell) • Command language or job control language (JCL) • Service layer • Service call • Kernel Hardware and Software Architecture 15

  16. Operating System Layers User’s interface to OS Contains set of functions executed by application programs and command layer Manages resources; interacts directly with computer hardware Hardware and Software Architecture

  17. Outline Services provided by OS User interface types Command Line Interface Batch system commands Menu-driven environment GUI Kernel Hardware and the OS Types of OS Start a computer system Processes management CPU allocation 17 Hardware and Software Architecture

  18. User Interface Types • The command layer, sometimes called the shell, is the user interface to the OS. • Types: • CLI - Command Line Interface • A text interface that accepts user input from the keyboard. • Batch system commands • Menu-driven environment • GUI (pronounced goo-ee) - Graphical User Interface Hardware and Software Architecture

  19. Outline Services provided by OS User interface types Command Line Interface Batch system commands Menu-driven environment GUI Kernel Hardware and the OS Types of OS Start a computer system Processes management CPU allocation 19 Hardware and Software Architecture

  20. Command Line Interface • Syntax: command <operand1> <operand2> … • Operands: specify parameters that define the meaning of the command more precisely. • Example: • Unix/Linux:ls cis410/proj Consists of commandlsand operandcis410/proj;Requests a directory listing from the subdirectory with path namecis410/proj • Windows: javac Mycode.java • Advantages • More flexible and powerful • Faster for experienced users • Can combine commands Hardware and Software Architecture

  21. MS-DOS and UNIX Commands Hardware and Software Architecture

  22. Outline Services provided by OS User interface types Command Line Interface Batch system commands Menu-driven environment GUI Kernel Hardware and the OS Types of OS Start a computer system Processes management CPU allocation 22 Hardware and Software Architecture

  23. Batch System Commands • Command Language provides a mechanism to combine sequences of commands together. These pseudo-programs are known as scriptsor batch files. • Example: startup files for OS configuration, user preferences • Features of Command Languages • Can accept input from the user and can output messages to I/O devices • Provide ability to create and manipulate variables • Include the ability to branch and loop • Ability to specify arguments to the program command and to transfer those arguments to variables within the program • Provide error detection and recovery Hardware and Software Architecture

  24. Command Language Types • Command Language (or called Job Control Language) examples • IBM MVS JCL • MS-DOS • Windows PowerShell • UNIX – shell scripts • Shell • User interface and command processor (interpreter) that interacts with the kernel. • The command processor is the program that executes operating system commands. • The shell, therefore, is the part of the command processor that accepts commands. • UNIX shell: C shell, Bourne shell, and Korn shell Hardware and Software Architecture

  25. Unix Shells • sh - the original Bourne shell, still popular with administrators for scripts • csh - the C shell, more C-like syntax, and is better for interactive sessions • tcsh - Tenex shell, perhaps the most used interactive shell, emacs keying • ksh - Korn shell, normal issue with Hewlett Packard workstations • bash - Bourne-again-shell, a free-ware rework of several shells Hardware and Software Architecture

  26. Windows DOS Batch File Example Hardware and Software Architecture

  27. UNIX Shell Script Example Hardware and Software Architecture

  28. Outline Services provided by OS User interface types Command Line Interface Batch system commands Menu-driven environment GUI Kernel Hardware and the OS Types of OS Start a computer system Processes management CPU allocation 28 Hardware and Software Architecture

  29. Menu-Driven Interface • A script provided by a system administrator and filed in users’ accounts as part of a start-up routine that occurs when users log in to the system • Users do not need to memorize commands. • All available commands are listed on the menu. • Menus can be nested. • Still used in many bank ATM and Point-of-Sale systems Hardware and Software Architecture

  30. Menu Example for an IBM AS-400 System Hardware and Software Architecture

  31. Outline Services provided by OS User interface types Command Line Interface Batch system commands Menu-driven environment GUI Kernel Hardware and the OS Types of OS Start a computer system Processes management CPU allocation 31 Hardware and Software Architecture

  32. Windows Interfaces • Also known as Graphical User Interfaces (GUIs) • Mouse-driven and icon-based • Windows • allocated to the use of a particular program or process • contain a title bar, menu bar, and widgets • Widgets – resize and move windows, scroll data and images within a window Hardware and Software Architecture

  33. GUI Interface – Windows XP Hardware and Software Architecture

  34. GUI Interface – Linux KDE Hardware and Software Architecture

  35. GUI Interface - Macintosh Hardware and Software Architecture

  36. GUI Advantages Easy to learn and use Little training Amenable to multi-tasking Disadvantages Harder to implement More Hardware/Software requirements Requires lots of memory Software is complex and difficult to write CLI Advantages More flexible and powerful Faster for experienced users Can combine commands Disadvantages More difficult to learn and use GUI vs. CLI Hardware and Software Architecture

  37. Outline Services provided by OS User interface types Kernel Hardware and the OS Types of OS Start a computer system Processes management CPU allocation 37 Hardware and Software Architecture

  38. Kernel • The central module of an operating system • Always loaded into memory at start-up time and will remain resident as long as the computer is running • Contains essential services required by other parts of the operating system and applications • Typically responsible for memory management, process and task management, and secondary storage management Hardware and Software Architecture

  39. Components of the Kernel Hardware and Software Architecture

  40. Outline Services provided by OS User interface types Kernel Hardware and the OS Types of OS Start a computer system Processes management CPU allocation 40 Hardware and Software Architecture

  41. Hardware and the OS • A hardware platform may support a variety of operating systems • E.g, Windows and Linux co-exist on PC • An operating system may work on a variety of hardware platforms • A standard operating system, such as Unix, Windows XP, that works on different hardware • Provides program and file portability • Enables user efficiency through recognizable interface • Is implemented through a systems programming language like C or C++ Hardware and Software Architecture

  42. Outline Services provided by OS User interface types Kernel Hardware and the OS Types of OS Start a computer system Processes management CPU allocation 42 Hardware and Software Architecture

  43. Types of Operating Systems • Single-tasking systems • Only one application program at a time is loaded into memory and executed • Example: MS-DOS until the early 1990s • Multiuser, multitasking systems • Commonly used • Distributed systems • Processing power distributed among computers in a cluster or network Hardware and Software Architecture

  44. Types of Operating Systems (Cont.) • Network server systems • Embedded systems • Designed to control a single piece of equipment, such as the automobile, cellular phone, or microwave oven • Real-time systems • One or more processes must be able to access the CPU immediately when required. E.g., control rockets on a space flight, periodic measurements of the temperature in a nuclear reactor Hardware and Software Architecture

  45. Multitasking Systems • OS support for running multiple programs simultaneously is called multitasking. • Multitasking (or multiprogramming) operating systems are the norm for general-purpose computers • Allows flexibility of application and system software • Multitasking operating systems must be able to handle multiple programs and users • Multiuser systems have to be multitasking. Hardware and Software Architecture

  46. Concurrent Operations • Multitasking can be achieved by concurrent processing. • The OS acts as a controller to provide concurrent processing. • OS makes rapid decisions about which programs receive CPU control and for how long that control is retained • Programs share CPUs (called concurrent or interleaved execution) Hardware and Software Architecture

  47. Multitasking Resource Allocation Goals • A multitasking operating system manages hardware resources (CPU, memory, I/O) to achieve the following: • Meet the resource needs of processes • Prevent processes from interfering with one another • Efficiently use hardware and other resources Hardware and Software Architecture

  48. Achieving Multitasking • Sharing the CPU during I/O breaks: while one program is waiting for I/O to take place, another program is using the CPU to execute instructions. • CPU idle time can be used to execute other programs. • Time-slicing: the CPU may be switched rapidly back and forth between different programs • Executing a few instructions from each, using a periodic clock-generated interrupt. • It was discussed in Lecture 6. Hardware and Software Architecture

  49. Sharing the CPU During I/O Breaks • I/O represents a large percentage of a typical program’s execution Hardware and Software Architecture

  50. Time-sharing the CPU (Time-slicing) • Dispatching is the process of selecting which program to run at any given instant. Hardware and Software Architecture