1 / 24

Operating Systems

Operating Systems. BIT 1003. outline. Introduction, concepts, review & historical perspective Processes Synchronization Scheduling Deadlock Memory management, address translation, and virtual memory Operating system management of I/O File systems. Why should I study Operating Systems?.

presta
Télécharger la présentation

Operating Systems

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 BIT 1003

  2. outline • Introduction, concepts, review & historical perspective • Processes • Synchronization • Scheduling • Deadlock • Memory management, address translation, and virtual memory • Operating system management of I/O • File systems

  3. Why should I study Operating Systems? • Need to understand interaction between the hardware and applications • New applications, new hardware.. • Need to understand basic principles in the design of computer systems • efficient resource management, security, flexibility • Increasing need for specialized operating systems • e.g. embedded operating systems for devices - cell phones, sensors and controllers • real-time operating systems - aircraft control, multimedia services

  4. The services operating systems provide include: • Management of I/O • Managementof memory • Scheduling of user processes (start, interrupt, and stop) • A secure and reliable environment for programs and users • A convenient interface for users • Networkingservices • Messaging and synchronization services between processes • Utility “system software” such as editors, loaders, help, etc.

  5. Operating system timeline • First generation: 1945 – 1955 • Vacuum tubes • Plug boards • Second generation: 1955 – 1965 • Transistors • Batch systems • Third generation: 1965 – 1980 • Integrated circuits • Multiprogramming • Fourth generation: 1980 – present • Large scale integration • Personal computers • Next generation: ??? • Systems connected by high-speed networks? • Wide area resource management?

  6. First generation: direct input • Run one job at a time • Enter it into the computer (might require rewiring!) • Run it • Record the results • Problem: lots of wasted computer time! • Computer was idle during first and last steps • Computers were very expensive! • Goal: make better use of an expensive commodity: computer time

  7. Second generation: batch systems • Bring cards to 1401 • Read cards onto input tape • Put input tape on 7094 • Perform the computation, writing results to output tape • Put output tape on 1401, which prints output

  8. Third generation: multiprogramming • Multiple jobs in memory • Protected from one another • Operating system protected from each job as well • Resources (time, hardware) split between jobs • Still not interactive • User submits job • Computer runs it • User gets results minutes (hours, days) later Job 3 Job 2 Memorypartitions Job 1 Operatingsystem

  9. Timesharing • Multiprogramming allowed several jobs to be active at one time • Initially used for batch systems • Cheaper hardware terminals -> interactive use • Computer use got much cheaper and easier • No more “priesthood” • Quick turnaround meant quick fixes for problems

  10. Types of modern operating systems • Mainframe operating systems: MVS • Server operating systems: FreeBSD, Solaris • Multiprocessor operating systems: Cellular IRIX • Personal computer operating systems: Windows, Unix • Real-time operating systems: VxWorks • Embedded operating systems • Smart card operating systems • Some operating systems can fit into more than one category

  11. MANAGEMENT OF INPUT AND OUTPUT Outsideworld Videocontroller Hard drivecontroller USBcontroller Networkcontroller CPU Computer internals(inside the “box”) Memory

  12. Anatomy of a device request (INTERRUPT) Instructionn 3 2 Instructionn+1 1: Interrupt CPU 5 Interruptcontroller Diskcontroller Operatingsystem 1 6 4 3: Return Interrupt handler 2: Process interrupt • Left: sequence as seen by hardware • Request sent to controller, then to disk • Disk responds, signals disk controller which tells interrupt controller • Interrupt controller notifies CPU • Right: interrupt handling (software point of view)

  13. DirectMemory Access • A improvement in efficiency is possible when the I/O device is relatively fast, like a disk driveor a tape drive. • The computer design may include one or more direct memory access (DMA) controllers(or channels). • A DMA controller is a computer within the computer that specializes in I/O, and its purpose isto drastically reduce the number of interrupts that the OS must service.

  14. MEMORY MANAGEMENT • The operating system is responsible for assigning to processes memory in which to execute. • Operatingsystem is responsible for managing a whole array of memories in support of processes, principallymain memory, cache memory, and disk memory.

  15. Registers Cache (SRAM) Main memory (DRAM) Magnetic disk Magnetic tape Storage pyramid Capacity Access latency < 1 KB 1 ns Better 1 MB 2–5 ns 256 MB 50 ns 40 GB 5 ms > 1 TB 50 sec Better • Goal: really large memory with very low latency • Latencies are smaller at the top of the hierarchy • Capacities are larger at the bottom of the hierarchy • Solution: move data between levels to create illusion • of large memory with low latency

  16. Disk drive structure head • Data stored on surfaces • Up to two surfaces per platter • One or more platters per disk • Data in concentric tracks • Tracks broken into sectors • 256B-1KB per sector • Cylinder: corresponding tracks on all surfaces • Data read and written by heads • Actuator moves heads • Heads move in unison sector platter track cylinder surfaces spindle actuator

  17. Memory Address Address 0x2ffff 0x2ffff User programand data User data 0x2d000 Limit2 0x2b000 0x2bfff User data 0x29000 Base2 Limit 0x27fff User programand data 0x24fff Limit1 User program 0x23000 Base 0x23000 Base1 0x1dfff 0x1dfff Operatingsystem Operatingsystem • Single base/limit pair: set for each process • Two base/limit registers: one for program, one for data 0 0

  18. Operating systems concepts • Processes (and trees of processes) • Deadlock • File systems & directory trees • Pipes

  19. Processes • Process: program in execution • Address space (memory) the program can use • State (registers, including program counter & stack pointer) • OS keeps track of all processes in a process table • Processes can create other processes • Process tree tracks these relationships • A is the root of the tree • A created three child processes: B, C, and D • C created two child processes: E and F • D created one child process: G A B C D E F G

  20. Deadlock Actual deadlock Potential deadlock

  21. Hierarchical file systems

  22. Interprocess communication • Processes want to exchange information with each other • Many ways to do this, including • Network • Pipe (special file): A writes into pipe, and B reads from it A B

  23. Exercises • 6.1, 6.2, 6.4

More Related