1 / 123

Operating Systems The warm fuzzy stuff that makes a PC work…

Operating Systems The warm fuzzy stuff that makes a PC work…. 3302MEE – Computer Systems. Title Picture: Microsoft Office 2000 Clipart. Outline. What it ’ s all about... History The Computer System Hardware, Firmware and Software An Operating System Operating System Concepts

Download Presentation

Operating Systems The warm fuzzy stuff that makes a PC work…

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating SystemsThe warm fuzzy stuff that makes a PC work… • 3302MEE – Computer Systems Title Picture: Microsoft Office 2000 Clipart

  2. Outline • What it’s all about... • History • The Computer System • Hardware, Firmware and Software • An Operating System • Operating System Concepts • Foreground / Background Systems • Critical Code • Sharing Resources • Multitasking

  3. Outline • Operating System Concepts • Context Switching • Kernels • Schedulers • Non-preemptive Kernels • Preemptive Kernels • Reentrant Functions • Round-Robin Scheduling • Task Priorities • Mutual Exclusion

  4. Outline • Operating System Concepts • Disabling Interrupts • Flags • Scheduler Techniques • Semaphores • Deadlock • Synchronization • Event Flags

  5. Outline • Intertask Communications • Message Mailboxes • Message Queues • Interrupts • Interrupt Latency • Interrupt Response • Interrupt Recovery • Real-time Operating Systems • Advantages of Real-time Operating Systems

  6. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 5 Tasks 1 Processor 1 Memory Space 1 Physical Target 1 Set of I/O

  7. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 :( :( :( :(

  8. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 >:( >:( >:( >:(

  9. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 OS

  10. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 OS

  11. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 OS

  12. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 OS

  13. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 OS

  14. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 OS

  15. What it’s all about: Why? Task 1 Task 2 Task 3 Task 4 Task 5 OS

  16. History • Operating Systems have evolved over the past 40 years. • Operating systems have evolved in phases roughly corresponding to the decades. • 1940’s and 1950’s: • Computers generally had no OS, the software that ran on these computers was generally entered one bit at a time on rows of mechanical switches. Pictured: IBM 701 On April 29, 1952 --- IBM President Thomas J. Watson, Jr., informed his company's stockholders at the annual meeting that IBM was building "the most advanced, most flexible high-speed computer in the world."

  17. History • 1940’s and 1950’s: • Eventually machines evolved to use punch cards, programs could be entered into the computer via a punch card reader. • General Motors Research Laboratories implemented the first OS in the early 1950’s for their IBM 701. It ran a single job at a time and smoothed transition between jobs to get maximum utilization of the system (single-stream batch processing systems). Pictured: ENIVAC

  18. History • 1960’s • The systems of the 1960’s were also batch processing systems however they began to make better use of the computer’s resources by running several jobs at once (early stages of multitasking). • Computers of this era contained many peripherals such as card readers and punchers, printers, and floppy disk storage. Rarely did one job utilize all of the computers resources. • Users would submit their job into the load table via punch card or paper tape. The job would sit there for hours or even days before the computer would be ready to run it. If an error occurred in the program then the error would have to be corrected and the job resubmitted.

  19. History • 1960’s • IBM released OS/360 for its System/360 family of computers. • More advanced operating systems where developed to service many users at a time. Users were connected to the computer via terminals. • By the end of the decade the OS had made a drastic change from being a single batch system to a multi-user system. • Turnaround times dropped from hours to seconds, users could compile their programs and correct syntax errors before submitting them.

  20. History • 1960’s (cont’d) • IBM developed its VM OS, • Higher level languages where developed. • The creators of UNIX developed the high-level language C specifically to write UNIX. • TSS, Multics and CP/CMS incorporated the concept of virtual storage which allowed programs to address much larger amounts of memory then what was actually provide in primary storage. • Introduction of system calls. • Mid 1960’s UNIX takes over Mainframes.

  21. History • 1970’s • In the 1970’s the systems of this decade were multimode timesharing systems that supported batch processing, timesharing, and real-time applications. • The TCP/IP standard was devised and communication in local area networks became practical due to the Ethernet standard.

  22. History • 1980’s • The decade of the personal computer. • Microprocessors evolved to the point that a user could have a computer on their desk with the same processing power of the mainframes of the 1970’s. • Computing became distributed. • More focus was made on user applications (Home computing). • The 1980’s introduced the concept of device drivers and library functions. • Saw the development of many proprietary versions of UNIX.

  23. History • 1990’s and 2000’s • The early 1990’s saw the development and spread of a phenomena known now as the internet. • The major consumer OS of the early 1990’s was MSDOS coupled with Windows for Workgroups. The mouse change the way in which we interacted with the PC. • The early 1990’s saw the development of a UNIX OS for Intel hardware (LINUX). • The OS is continually evolving as the demands of the consumer and hardware become greater.

  24. The Computer System • A computer system consists of three major components: • Hardware • Firmware • Software User Applications OS BIOS Hardware

  25. The Computer System • Hardware • The physical touchable components of the PC. Hardware provides the raw computing power. User Applications OS BIOS Hardware

  26. The Computer System • Firmware • The hardware level software, most commonly known as the BIOS. The BIOS: • Provides a self-check functionality, • Sorts out System memory Map, • Handles Plug-and-Pray functionality, • Installs system based drivers that allow higher level software such as an OS to function (legacy drivers). • Provides a boot-strap loader, • Provides low-level access to the hardware for the OS. • provides a standard interface to the subsystems of the PC, eg. ACPI, APM, generic video. User Applications OS BIOS Hardware

  27. The Computer System • Software • This encompasses the OS and any user-level applications. User Applications OS BIOS Hardware

  28. An Operating System • The Operating System (OS) provides: • Process Management • Memory Management • Hardware Abstraction (Device Control) • File Systems Support • Networking • A system call interface

  29. Operating System ConceptsForeground/Background Systems • Small systems of low complexity are generally referred to as foreground/background systemsor super-loops. • The application consists of an infinite loop that calls modules (functions) to perform specific functions (background). Interrupt service routines handle asynchronous events (foreground). • Foreground is referred to as interrupt-level, while background is commonly referred to as task-level. Foreground/Background System

  30. Operating System ConceptsForeground/Background Systems • Critical operations are performed at the interrupt-level as these must be dealt with in a timely manner. • Data provided by an interrupt level task to a background task, is not processed by that task until it gets a turn to execute (task-level response). • Microwave ovens, toys, telephones, etc utilize this type of OS. Foreground/Background System

  31. Operating System ConceptsTerms • Critical Sections (of Code) • Also known as critical region. • Once a critical sections begins it can not be interrupted, it must be completed. • Disabling interrupts is one sure way of ensuring that the critical code completes uninterrupted. Once the code is complete interrupts can be enabled once more. • Critical Sections also relate to areas of code in which commonly shared data is modified, and the code must complete the modification prior to any other process using it.

  32. Operating System ConceptsTerms • Resources • A resource is any item that can be used by a task. • These include memory, CPU, I/O (peripheral).

  33. Operating System ConceptsTerms • Shared Resources • A shared resource is a resource than can be used by more than one task. • The task must gain exclusive access to the resource in order to prevent data corruption (mutual exclusion).

  34. Operating System ConceptsTerms • Multitasking • Multitasking refers to the scheduling of multiple tasks and switching the CPU between several tasks. • A single CPU is seen to switch its attention between several sequential tasks. • Multitasking is like foreground/background with multiple backgrounds. • Multitasking is an efficient use of the CPU and promotes a modular construction of applications.

  35. Operating System ConceptsTasks • Tasks • Also known as threads. • A task believes it has the CPU all to itself. • Each task has a priority, its own set of CPU registers, and its own stack. Tasks

  36. Operating System ConceptsTasks • Each task is effectively an infinite loop that can be either: • Dormant, • Resides in memory but not yet available to the kernel. • Ready, • Can execute however its priority is lower than the task currently running. • Running • Has control of the CPU. • Waiting (for an event), • Requires an event to take place first. • or ISR (Interrupted). • Services an event. Tasks

  37. Operating System ConceptsTask States

  38. Operating System ConceptsContext Switches • Context Switches • When the CPU decides to run another task it stores the current CPU context in the current tasks context storage area. • After the operation is complete the new tasks context is restored from its storage area onto the CPU and the new task resumes execution. • This process is commonly referred to as context switching or task switching. • Context switching adds overhead to the application. The time required to perform a context switch depends on the number of registers within the CPU as they all must be saved and restored.

  39. Operating System ConceptsHS12 Context Switch Example • An example illustrating a context switch on the HS12.

  40. Operating System ConceptsHS12 Context Switch Example Context A Running D D Halted PC PC X X TOI Interrupt Y Y CCR CCR Interrupts Disabled SP SP Stack CPUS12

  41. Operating System ConceptsHS12 Context Switch Example D PC PC X Y CCR TOI Interrupts Disabled SP SP Interrupt Vector Table CPUS12

  42. Operating System ConceptsHS12 Context Switch Example D D TOI ISR Running Halted PC PC CCR X X D Y Y X CCR CCR Y Interrupts Disabled SP SP SP PC Stack CPUS12

  43. D D PC PC CCR X X D Y Y X CCR CCR Y Interrupts Disabled SP SP SP PC Stack CPUS12 Operating System ConceptsHS12 Context Switch Example TOI ISR Running

  44. Operating System ConceptsHS12 Context Switch Example CCR TOI ISR Running D Context A Context B X Y D D PC PC PC CCR SP Global Memory X X D CCR CCR Y Y X D D CCR CCR Y Interrupts Disabled X X Context C Context D SP SP SP PC Y Y Stack CPUS12 PC PC SP PC

  45. Operating System ConceptsHS12 Context Switch Example CCR Context Save TOI ISR Running D Context A Context B X Y D D PC PC PC CCR SP SP Global Memory X X D CCR CCR Y Y X D D CCR CCR Y Interrupts Disabled X X Context C Context D SP SP SP PC SP Y Y Stack CPUS12 PC PC SP SP

  46. Operating System ConceptsHS12 Context Switch Example CCR CCR Context Find TOI ISR Running D D Context A Context B X X Y Y D D PC PC PC PC SP SP Global Memory X X CCR CCR Y Y D D CCR CCR Interrupts Disabled X X Context C Context D SP SP SP SP Y Y Stack CPUS12 PC PC SP SP

  47. Operating System ConceptsHS12 Context Switch Example CCR CCR Context Restore TOI ISR Running D D Context A Context B X X Y Y D D PC PC PC PC SP SP Global Memory X X CCR CCR Y Y D D CCR CCR Interrupts Disabled X X Context C Context D SP SP SP SP Y Y Stack CPUS12 PC PC SP SP

  48. Operating System ConceptsHS12 Context Switch Example Context B Running D Halted PC CCR X D Y X CCR Y Interrupts Disabled PC SP SP Stack CPUS12

  49. Operating System ConceptsKernels • Kernels • The kernel is part of a multitasking system responsible for management of tasks and communication between tasks. • The fundamental service provided by the kernel is context switching. • The kernel adds overhead to the system as it also needs to be executed by the processor. • The amount of overhead depends on how often you use the services provided by the kernel.

  50. Operating System ConceptsKernels • Kernels • The kernel requires space for: • Its own code, • Its own data structures, and • A task structure for each task. • The kernel introduces a strain on the memory resources of the system.

More Related