1 / 43

Introduction to Operating Systems: Review of System Architecture and Concurrent Programming

This lecture provides an introduction to operating systems, discussing their design, purpose, and significance. It covers topics such as system architecture, concurrent programming, and the role of operating systems in facilitating and optimizing computer systems.

Download Presentation

Introduction to Operating Systems: Review of System Architecture and Concurrent Programming

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 Systems Lecture 1: IntroductionReview of System Architecture and Concurrent Programming Maxim Shevertalov Jay KothariWilliam M. Mongan Operating Systems

  2. Introduction • What is an Operating System? • How are they designed? • Why study them? Operating Systems

  3. What is an Operating System? • Facilitation + Performance • Think of Air Traffic Control: they are in charge of lots of airplanes, and sometimes they tell airplanes to wait their turn. • Despite what we may sometimes think, their intent is not to prevent us from doing what we want by imposing complicated rules. • Rather, they are there to facilitate aircraft in flight. • On its own, the air traffic controller does not accomplish much; but, together with the aircraft he supports, he aims to maximize performance for all the participating airplanes (not any one!), while protecting them from one another. • It’s all about coordination. Operating Systems

  4. What is an Operating System? • Can we use a computer system without an operating system? Operating Systems

  5. What is an Operating System? • Can we use a computer system without an operating system? • We would have to directly interface with the computer hardware. • Pros: speed?, control? • Cons: What if we need to run on a different machine?Or change the network card? Install a new OS? What if new features like multiprocessors or a cluster is introduced to the program? • The operating system mediates between application (the airplanes) and the shared resources (the runways and airspace) in a way that provides abstraction and generality for the applications. Operating Systems

  6. What is an Operating System? • Trusted software interposed between the hardware and application/utilities to improve efficiency and usability • Most computing systems have some form of operating systems • Hard to use computer systems without OS Applications and Utilities Operating System Computer Hardware Operating Systems

  7. Why Study Them? • Take a deeper at system architecture • Modular, layered software design • All of our software runs on top of it! It is the common denominator of everything we write. • How often do you make a syscall? Or invoke some system library? • Learn to build complex systems • Engineering Issues • Business Issues (OS as a government) • Security (viruses, worms, etc.) Operating Systems

  8. CPU CPU Disk Controller USB Controller GPU CPU Memory Computer System Organization • Computer-system operation • One or more CPUs, device controllers connect through common bus providing access to shared memory • Concurrent execution of CPUs and devices competing for memory cycles Operating Systems

  9. Operating System Design: Modularity • Process Control: Threads • Synchronization and Scheduling • Protection, Memory Management, Caching • Demand Paging • File Systems • Networking and Distributed Systems • Protection and Security Operating Systems

  10. One Size Fits All? Requirements Dictate Design Operating Systems

  11. Evolution of the OS • In the beginning... Computers • Cost millions of $$$ • Were hard to operate (performed using console switches) • Were hard to program (in particular I/O devices) Operating Systems

  12. Utilizing Expensive Hardware • Expensive computers could not idle; utilization should be very high • Batch processing was devised • Programming done offline and subroutine were created for common tasks • I/O and processing overlap obtained via buffering and interrupts Operating Systems

  13. Factors in OS Evolution • Cost of computers (i.e., computer time) • Cost of people (i.e., user time) early batch systems time sharing systems computer utilization personal systems user wait time Operating Systems

  14. Major OS Functions Operating Systems

  15. Major OS Functions • Control access and provide interfaces • To the OS and devices attached to the system • Provide interfaces for human-machine and machine-machine transactions • Manage resources • Mediate resource usage among different tasks • Implement policies Operating Systems

  16. Major OS Functions • Control access and provide interfaces • To the OS and devices attached to the system • Provide interfaces for human-machine and machine-machine transactions • Manage resources • Mediate resource usage among different tasks • Implement policies • Provide abstractions • Hide the peculiarities of the hardware. • Example: device independent I/O • Consume resources • OS runs on the system that is being managed… so it is going to consume resources! Operating Systems

  17. What is the Access Problem? • User wants to access OS, why? • User wants to access devices connected to the system • It all starts with recognizing the user’s intent to access! Operating Systems

  18. Access Problem: Handling I/O • Programmed I/O • The CPU transfers the data from (or to) the device buffers. • After issuing an I/O operation the CPU continuously checks (polls) for its completion Operating Systems

  19. Access Problem: Handling I/O • Interrupt-driven I/O (slow speed, character device) • The CPU issues an I/O operation and goes on; Device notifies (interrupts) the CPU as data arrives; CPU processes the data Operating Systems

  20. How Does the OS Service Interrupts? Operating Systems

  21. Access Problem: Data Processing • Once data is captured from device (e.g., keyboard) what is next? • Imagine you want to write a word processor • Capture some keystrokes – for arrow and other control keys • Capture words (cooked or raw form?) Operating Systems

  22. Accessing Devices vs. OS Services • OS interposes itself between the hardware and applications/utilities/users • Controlling access to OS ---> Controls device access User OS Device Operating Systems

  23. How Do You Control Access to the OS? • Provides a two level architecture: • Trusted mode • Untrusted mode • The OS (at least the core part – called Kernel) runs in the trusted mode • User applications/utilities run in the untrusted mode Operating Systems

  24. System Call via Trap • OS provides system calls for accessing OS services from applications • System calls are special procedure calls • Control transfer • Switch protection domain • System calls also: • Validate the call • Allow authorized actions to take place Operating Systems

  25. How are Syscalls Processed? Operating Systems

  26. UNIX Syscall Examples • Process control • fork(), exec(), wait(), abort() • File manipulation • chmod(), link(), stat(), creat() • Device manipulation • open(), close(), ioctl(), select() • Information maintenance • time(), acct(), gettimeofday() • Communications • socket(), accept(), send(), recv() Operating Systems

  27. How Does an OS Manage Resources? Operating Systems

  28. Process: Avatar of the Application • A process represented process table entry Operating Systems

  29. Simple Process Model • Below is a two-state process model • Running (on the CPU) • Not running (waiting to get the CPU or at I/O) Operating Systems

  30. Resource Management: Processor Time • Processor time is the primary resource managed by the OS • How it is managed depends on the type of OS: • Batch vs Time-sharing • Uniprogramming vs Multiprogramming Operating Systems

  31. Example: Uniprogramming (only one program running on the system) What is the CPU Utilization? Operating Systems

  32. Example: Multiprogramming(multiple programs simultaneously running) Operating Systems

  33. Comparing System Utilization Operating Systems

  34. Process Scheduling Operating Systems

  35. Process Scheduling: Concerns Operating Systems

  36. Process Scheduling Concerns • Fairness • Give equal and fair access to resources • Differential responsiveness • Discriminate among different classes of jobs • Efficiency • Maximize throughput, minimize response time, and accommodate as many users as possible Operating Systems

  37. Memory Management • Memory management is key to multiprogramming • Memory is a space sharing resource • Memory management is necessary to protect co-residing programs from each other • Depending on the occupancy pattern, a program would not know the location until load time • Memory management should provide: • Protection • Relocation Operating Systems

  38. How Does an OS Manage Memory? • Idea: • Divide the memory into partitions and allocate them to different processes • Partitions can be fixed size or variable size • A process • Cannot access memory not allocated to it • Can request more memory from OS • Can release already held memory to OS • May only use a small portion of the allocated memory Operating Systems

  39. How Does an OS Manage Memory? • We can load more processes than that fitting the memory • Where do the rest go? Answer: Virtual Memory Operating Systems

  40. Virtual Memory in Action • Some memory chunks (pages) are in memory • Rest in disk • OS is responsible for retrieving the pages from and flushing the pages to disk Operating Systems

  41. To Use Storage, We Need a Filesystem Operating Systems

  42. Storage Management: Component View Operating Systems

  43. Topics Covered • Fundamentals (Operating Systems Structures) • Process Control and Threads • Synchronization and scheduling • Protection, Address translation, Caching • Demand Paging • File Systems • Networking and Distributed Systems • Protection and Security Operating Systems

More Related