1 / 33

Operating System - Overview

Operating System - Overview. Lecture 2. OPERATING SYSTEM STRUCTURES. Main componants of an O/S Process Management Main Memory Management File Management I/O System Management Secondary Management Networking Protection System Command-Interpreter System. The Modern Computer System.

ronny
Télécharger la présentation

Operating System - Overview

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 System - Overview Lecture 2

  2. OPERATING SYSTEM STRUCTURES • Main componants of an O/S • Process Management • Main Memory Management • File Management • I/O System Management • Secondary Management • Networking • Protection System • Command-Interpreter System

  3. The Modern Computer System • Figure 1.1 A computer system consists of hardware, system programs, and application programs.

  4. PROCESS MANAGEMENT • A process is a program in execution: (A program is passive, a process active.) • A process has resources (CPU time, files) and attributes that must be managed. • Management of processes includes: • Process Scheduling (priority, time management, . . . ) • Creation/termination • Block/Unblock (suspension/resumption ) • Synchronization • Communication • Deadlock handling • Debugging

  5. MAIN MEMORY MANAGEMENT • Allocation/de-allocation for processes, files, I/O. • Maintenance of several processes at a time • Keep track of who's using what memory • Movement of process memory to/from secondary storage. • FILE MANAGEMENT • A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data. • The operating system is responsible for the following activities in connections with file management: • File creation and deletion. • Directory creation and deletion. • Support of primitives for manipulating files and directories. • Mapping files onto secondary storage. • File backup on stable (nonvolatile) storage media.

  6. Os componants • I/O MANAGEMENT • Buffer caching system • Generic device driver code • Drivers for each device - translate read/write requests into disk position commands. • SECONDARY STORAGE MANAGEMENT • Disks, tapes, optical, ... • Free space management ( paging/swapping ) • Storage allocation ( what data goes where on disk ) • Disk scheduling

  7. Os componants • NETWORKING • Communication system between distributed processors. • Getting information about files/processes/etc. on a remote machine. • Can use either a message passing or a shared memory model. • PROTECTION • Of files, memory, CPU, etc. • Means controlling of access • Depends on the attributes of the file and user • SYSTEM PROGRAMS • Command Interpreters -- Program that accepts control statements (shell, GUI interface, etc.) • Compilers/linkers • Communications (ftp, telnet, etc.)

  8. Input and Output

  9. Introduction • 4 main parts that make up computer • Processor • Memory • File system • Input and Output • I/O device and actions are slow compared to the other 3 parts • Wide variation in nature of I/O devices. Operating System must find way of dealing with this.

  10. Simple Computer The organization of a simple computer with one CPU and two I/O devices

  11. I/O Characteristics

  12. Device Controllers • Figure 3-2. A model for connecting the CPU, memory, controllers, and I/O devices.

  13. I/O Operation • Computer uses an I/O system bus • Each I/O device has controller attached to I/O system bus • Devices have unique address so processor can identify device it wishes to communicate • Uses interrupts

  14. Interrupts • I/O device can work away independantly of processor activity • To do this it uses interrupts, I/O device sends a signal to processor to say it has completed part of task. Processor can then assign more work for device. • Example 1 playing music in cd player can work independantly, press eject button sends interrupt to processor. • Example 2 production line in factory

  15. Interrupts Continued How interrupts happens. Connections between devices and interrupt controller actually use interrupt lines on the bus rather than dedicated wires

  16. Direct Memory Access (DMA) • Most computer systems use DMA • This enables much faster data rates • The I/O device can access memory directly • Processor only involvement is in initiating the transfer after that device accesses memory directly

  17. Direct Memory Access (DMA) • Figure 3-4. Operation of a DMA transfer. Operation of a DMA transfer

  18. Objectives of I/O System • Efficiency – maintain devices operating at the highest possible rate doing useful work • Device independence – we don’t care how system works so long as it does it’s job. Example we don’t care how printer is designed or what rollers cogs etc it has. When we go to file and print we want it to produce a printer page.

  19. Structure of I/O System

  20. Device Drivers • When you buy a network card, printer, scanner you receive software to load on your computer so operating system can communicate with the device. • More and more operating system have drivers preinstalled.

  21. Device Controllers • Device controller is hardware unit which is attached to the I/O bus of the computer and provides a hardware interface between the computer and the I/O device itself. • Example ISA or PCI slot in PC, keyboard or mouse port.

  22. Block and Character devices • Block devices are complicated, character are relatively simple. Examples • Block: Hard Disk, Floppy Disk • Character: Printer, Network Card • Two main types of I/O devices • Block: transfers blocks of data at a time • Character: transfer single character at a time

  23. Device Drivers • Logical position of device drivers is shown here • Communications between drivers and device controllers goes over the bus

  24. Virtual Devices • Virtual device is a simulation of an actual device • Most common example is print spooler. This improves efficiency by printing to a file and the actual print off can take place when system is quiet.

  25. Buffering - problem • Problem from below diagram we can see time to transfer data from I/O device causes processor P to wait – very inefficient.

  26. Buffering - solution • A buffer is an intermediate main memory storage area under the control of the operating system which holds data in transit between the users work area and the device.

  27. I/O Buffering

  28. I/O Buffering

  29. Buffering - summary • Yet a further improvement is to use double buffering i.e. two separate memory stores. • I/O devices cannot keep pace with processor, in single process environment processor would be continuously waiting. In practice many processes are competing for processor so that buffering is effective in smoothing out peaks and troughs in I/O data rates and contributes to keeping the processor busy and to working I/O devices at optimum speed.

  30. Windows I/O • Windows uses a software module called the Input-Output Manager

  31. Windows O/S I/O system • In Windows application programs communicate with devices by making calls to device drivers. These are implemented as Dynamic Link Libraries (DLL’s) which are executable code modules, that can be loaded at run-time as required and which then become effectively part of the operating system.

  32. Benefits of DLL’s • Sharable code – loaded into memory only once. Most applications use standard drivers such as display and keyboard drivers. • Driver for new device can be implemented without having to modify the o/s • Range of optional drivers made available and configured for range of devices eg printers. • Only drivers actually required by system need to be loaded saving memory resources.

More Related