1 / 41

CSCI/CMPE 4334 Operating Systems Review: Exam 1

Prepare for your exam on operating systems with this comprehensive review covering Chapters 1-6 of your textbook, lecture slides, and in-class exercises. Explore key concepts like resource management, virtual machines, and process execution. Get ready for 5 questions worth 100 points and a bonus question for 20 points. Enhance your understanding of software classification, purpose of an OS, and operating system functions. Join us on Tuesday, February 24th at 2:35 pm in ENGR 1.272 for this closed-book exam review session.

swansonc
Download Presentation

CSCI/CMPE 4334 Operating Systems Review: Exam 1

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. CSCI/CMPE 4334 Operating Systems Review: Exam 1

  2. Review • Chapters 1 ~ 6 in your textbook • Lecture slides • In-class exercises (on the course website) • Review slides

  3. Review • 5 questions (100 points) + 1 bonus question (20 points) • Question types • Q/A

  4. Time & Place & Event • 2:35pm ~ 3:50am, Feb. 24, Tuesday • ENGR 1.272 • Closed-book exam

  5. Chapter 1: Introduction and Overview of Operating Systems • Computer system • Hardware • Software • Application software • System software • Operating system • Operating system • resource abstraction: software & hardware abstraction • resource sharing: time & space multiplexing • Operating Systems Strategies

  6. Application Programmer Software API Command Line Interpreter Loader Window System Libraries Libraries Libraries Compiler System Software OS Database Management System Hardware Chapter 1: Software Classification

  7. Chapter 1: Purpose of an OS(What is Resource Management?) • “An OS creates resource abstractions” • “An OS manages resource sharing”

  8. Chapter 1: Operating System Functions • Resource manager • manage hardware and software resources • Resource abstraction and sharing • A nicer environment • implement a virtual machine for processes to run in • A program in execution is called a process • a nicer environment than the bare hardware

  9. Chapter 1: Abstract Resources User Interface Application Abstract Resources (API) Middleware OS Resources (OS Interface) OS Hardware Resources

  10. Chapter 1: Resource Management Functions • Transform physical resources to logical resources • Resource abstraction • Make the hardware resources easier to use • Multiplex one physical resource to several logical resources • Create multiple, logical copies of resources • Schedule physical and logical resources • Decide who gets to use the resources

  11. Chapter 1: Resource Sharing • Two types of sharing • Time multiplexed sharing • time-sharing • schedule a serially-reusable resource among several users • Space multiplexed sharing • space-sharing • divide a multiple-use resource up among several users

  12. Chapter 1: Operating Systems Strategies • Several different strategies have been used • Earliest computers were dedicated to a single program and there was no multiprogramming and no OS • Batch systems • Timesharing systems • There are a few other recent strategies • Personal computers and workstations • Embedded systems • Small, communicating computers • Network technology

  13. Chapter 2: Using the Operating System • Operating systems provide a virtual computing environment for application programmers • Functions provided by O.S. • Abstract resources by O.S. • Files • Processes and threads • Objects • Programmers can develop applications more efficiently

  14. Chapter 2: Using the Operating System (cont'd) • Process • an infrastructure in which execution takes place • address space + resources • Thread • a program in execution within a process context • each thread has its own stack • Components • program counter • register set • stack space

  15. Chapter 2: Using the Operating System (cont'd) • UNIX fork() creates a process • Creates a new address space • Copies text, data, & stack into new address space • Provides child with access to open files • UNIX wait()allows a parent to wait for a child to terminate • UNIX execve()allows a child to run a new program • UNIX sleep() allows a process to suspend itself for some time • Windows CreateProcess() and CreateThread() • Examples of using functions above (see lecture slides)

  16. Chapter 2: Processes vs. Threads • Benefits of multithreading • Improve application responsiveness • Netscape uses multithreaded programming • Use multiprocessors efficiently • Improve program structure • Use fewer system resources • Faster to switch between threads than processes

  17. Idea Execution Engine Files Files Files Algorithm Stack Status Source Program Binary Program Data Other Resources Process Chapter 2: Algorithms, Programs, and Processes

  18. Chapter 2: Process Abstraction Data Process Stack Program Operating System Processor Hardware Executable Memory

  19. Files Files Files Stack Stack Stack Status Status Status Chapter 2: A Process with Multiple Threads Thread (Execution Engine) Data Other Resources Binary Program Process

  20. Chapter 2: The File Abstraction Data File Process Stack Program Operating System File Descriptor Processor Storage Device Hardware Executable Memory

  21. Chapter 3: OS Organization • Basic OS Responsibilities • Basic OS Functions • Three basic implementation mechanisms • Processor modes • What are Supervisor & user modes? How to switch between them? • What are privileged instructions? • I/O instructions, and instructions to change the mode or set the halt flag • Kernels • What is trap instruction for? How to use it? • Method of invoking system service • How to perform a system call or message passing?

  22. File Manager Process, Thread & Resource Manager Memory Manager Device Manager Processor(s) Main Memory Devices Chapter 3: Basic OS Organization

  23. Chapter 3: Device Management • OS uses policies chosen by designer or system administrator to manage • Allocation • Isolation • Sharing • Device manager in two parts • Device independent – provides unified interface • Device dependent – device driver: handles those aspects unique to a device

  24. Chapter 3: Process Management Process Description Process Mgr Protection Deadlock Synchronization Resource Manager Resource Manager Resource Manager Scheduler CPU Other H/W

  25. Isolation & Sharing Virtual Memory Block Allocation Process Manager Primary Memory Storage Devices Chapter 3: Memory Management

  26. Chapter 3: File System Management

  27. Chapter 3: Processor Modes • Mode bit: Supervisor or User mode • Some processors may have more than one mode • Supervisor mode (privileged, protected) • Can execute all machine instructions • Can reference all memory locations • User mode • Can only execute a subset of instructions • Can only reference a subset of memory locations

  28. fork(); … Trap Table Kernel fork() { … trap N_SYS_FORK() … } sys_fork() sys_fork() { /* system function */ … return; } Chapter 3: Trap Instruction

  29. Chapter 3: How to Make a System Call • For the system • through a trap instruction which causes an interrupt • Hardware saves PC and current status information • Hardware changes mode to system mode • Hardware loads PC from system call interrupt vector location. • Execute the system call interrupt handler • return from the handler, restores PC and other saved status information • User process continues.

  30. send(…, A, …); receive(…, B, …); send/receive receive(…A, …); … send(…, B, …); Chapter 3: Message Passing

  31. Chapter 4: Device Management • Abstract all devices (and files) to a few interfaces • Device management strategies • Direct I/O with polling • Direct I/O with interrupts • DMA I/O with interrupts • How to use the above strategies to perform I/O? • Buffering & Spooling • Access time of disk device* • FCFS, SSTF, Scan/Look, Circular Scan/Look • See examples in Exercise (2)

  32. Application Process System Interface File Manager Device-Independent Device-Dependent Hardware Interface Command Status Data Device Controller Chapter 4: Device Management Organization

  33. Chapter 4: Direct-Memory Access

  34. Chapter 5: Implementing Processes,Threads, and Resources • Modern process • Address space • Context switching • State diagram

  35. Chapter 5: Classic Processes • New abstraction divides aspects of classic process into two parts • Modern process: the part that defines a customized computational framework in which a program executes • Thread: the part that keeps track of code executions within this framework • Classic process = modern process with 1 thread

  36. Executable Memory Address Space Address Binding Process Files Other objects Chapter 5: The Address Space

  37. Chapter 5: Modern Process Composed of: • Address space • Program to define behavior of process • Data used by process • Resources needed for thread execution • Process created with a minimal set of resources • Additional resources allocated as needed

  38. Old Thread Descriptor CPU New Thread Descriptor Chapter 5: Context Switching

  39. Request Done Running Request Schedule Start Allocate Ready Blocked Chapter 5: Simple State Diagram

  40. Process Process Process Chapter 5: A Generic Resource Manager Resource Manager Blocked Processes Policy request() Process release() Resource Pool

  41. Good Luck! Q/A

More Related