Chapter 4

1,020 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,020
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
46
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Chapter 4

  1. 1. OPERATING SYSTEM Chapter-4
  2. 2. LETS EXPLORE OS  Interface between user and the hardware  Allocates and manages the resources-value for money  Reclaim lost resources  Manages the input, processing and output eg. Steward in a restaurant  Transforms a raw piece of hardware into a machine  Supports all application software  Loads programs into main memory
  3. 3. ABSTRACT VIEW OF SYSTEM COMPONENTS
  4. 4. WHAT AN OS DOES FOR A LIVING.. loop forever { run the process for a while. stop process and save its state. load state of another process. }
  5. 5. PROGRAM STATES
  6. 6. DIFFERENCE BETWEEN TYPES OF PROGRAMS  Do lot of computation  Eg. Programs computing value of π  No wastage of CPU time  Do lot of I/O transactions  Eg. Online railway reservation program  Lot of CPU time is wasted COMPUTE BOUNDPROGRAMS I/OBOUNDPROGRAMS
  7. 7. MULTIPROGRAMMING  Concurrent residency of many programs in the main memory of the computer  Reduced CPU idle time-GREATER CPU EFFICIENCY  Greater memory efficiency-COMPLETE MEMORY UTILIZATION  Eg. of multiprogramming OS are VAX, VMS, UNIX
  8. 8. WORKING OF OS
  9. 9. FUNCTIONAL UNITS OF AN OS
  10. 10. FUNCTIONAL UNITS OF AN OS  Schedular & resource allocator- decides when to introduce new programs in memory and the order of execution  File manager-manages secondary or magnetic storage, organizing and accessing data
  11. 11. FUNCTIONAL UNITS OF AN OS  I/O handler-manages I/O devices, handles device errors, device independence, efficient organization and access of data on I/O devices  Memory management-implements multiprogramming, protection of user work area, provides memory space to users  Dispatcher-allocates CPU to next scheduled program
  12. 12. AN OS IS A RESOURCE ALLOCATOR “Mama says: It’s good to share!”  Multiple users (?) get all computing resources “simultaneously”:  Cpu time  Memory (ram, swap, working set, virtual,..)  File system (storage space)  I/O devices (display, printers, mouse,..)  Clock  The OS should give every user the illusion that she is getting all resources to herself (not sharing!)
  13. 13. PROCESSOR MANAGEMENT  Time sharing scheduling (round robin)- • Each program has a fixed amount of time to execute • After leaving CPU, current program joins at the end of the queue • Multiple users share the computer simultaneously • Gives a feel of dedicated single user system • Improved response time • Provides interactive environment • Resources can be shared
  14. 14. MEMORY MANAGEMENT  Partitioning – • To accommodate many programs in memory, partitioning is done • Can be fixed size partitions- equal / unequal • Leads to memory wastage OS 10K 10K 10K OS 4K 6K 20K EQUAL SIZED PARTITIONS UNEQUAL SIZED PARTITIONS
  15. 15. MEMORY MANAGEMENT Dynamic Memory Relocation-solution to memory wastage
  16. 16. MEMORY MANAGEMENT  Dynamic memory relocation OS 10K-BLANK 6K-PROG B 4K-BLANK 8K-PROG D 2K-BLANK OS 6K-PROG B 8K-PROG D 16K-BLANK BEFORE Memory wastage AFTER DYNAMIC RELOCATION
  17. 17. VIRTUAL MEMORY • Allows writing programs larger than the main memory • Gives illusion of very large memory(combo of auxiliary and main memory) • Generates a virtual address-that is not a real physical memory address • Virtual address can be more than physical address • It is the logical / symbolic representation of a location in hardware
  18. 18. VIRTUAL MEMORY • OS divides main memory into equal size pages • Pages and blocks are of same size • Page is loaded in memory only on demand • A page table helps keeping track of which page in memory is storing which block • Set of pages in main memory is known as working set.
  19. 19. ADVANTAGES OF VIRTUAL MEMORY • Memory efficiency • Only active pages(on demand) are resident in the memory • Any page of any program can fir into any page of the main memory • Protection • There is separate page table for each user • Sharing • Same page can be shared by two programs using the page table settings
  20. 20. DEVICE MANAGEMENT  OS maintains speed balance between CPU and I/O device  Characteristics of I/O devices-  Speed  Unit of transfer  Data representation  Permissible operations  Error conditions  Sharing
  21. 21. BUFFERING  A temporary storage area (buffers) to read data from input device or send data to the output device  Keeps CPU busy • Because I /O operation is slow
  22. 22. BUFFERING • Input Buffering • When two buffers are used it is known as Double Buffering
  23. 23. BUFFERING • Output Buffering
  24. 24. SPOOLING • Simultaneous Peripheral Operation on Line • Helps buffering process • Used for non-shareable devices • Eg. Rush hour on printer • Process held up--long waiting time • In spooling data of every user is temporarily written on hard disk
  25. 25. SPOOLING • No held up processes • Spooler pick data one by one from hard disk • Sends in sequence to the printer • Hard disk becomes virtual printer
  26. 26. FILE MANAGEMENT  File organization techniques • Sequential-in predefined order • Direct- direct transfer b/w applications without using OS • Indexed sequential-data is indexed for fast retrieval •Relative - Records of the file are stored one after another both physically and logically. Record with sequence number 16 is located just after the 15th record
  27. 27. FILE MANAGEMENT  File management functions • Create file • Delete file • Open an existing file-read only • Open an existing file-read / write • Rewind operation-tape files • Security at three levels-DAR • Do anything • Append only • Write only
  28. 28. TYPES OF OS
  29. 29. TIME SHARING SYSTEM • Multiprogramming, multiuser & interactive OS • Resources of a centralized system are shared • Uses round robin scheduling • Less response time • Each user gets a feel of a dedicated system • Only a portion of job resides in main memory, rest on hard disk
  30. 30. DISTRIBUTED SYSTEMS  Distribute the computation among several physical processors.  Lo o se ly co uple d syste m – each processor has its own local memory; processors communicate with one another through various communications lines, such as high-speed buses or telephone lines.  Advantages of distributed systems.  Resources Sharing  Computation speed up – load sharing  Reliability  Communications
  31. 31. DISTRIBUTED SYSTEMS (CONT)  Requires networking infrastructure.  Local area networks (LAN) or Wide area networks (WAN)  May be either client-server or peer-to-peer systems.
  32. 32. REAL-TIME SYSTEMS  Often used as a control device in a dedicated application such as controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems.  Well-defined fixed-time constraints.  Real-Time systems may be either hard or so ft real-time.
  33. 33. REAL-TIME SYSTEMS (CONT.)  Hard real-time:  Secondary storage limited or absent, data stored in short term memory, or read-only memory (ROM)  Conflicts with time-sharing systems, not supported by general-purpose operating systems.  Soft real-time  Limited utility in industrial control of robotics  Useful in applications (multimedia, virtual reality) requiring advanced operating-system
  34. 34. MULTITASKING  To handle two or more programs at the same time from a single user’s perception  CPU can perform only one task at a time, however it runs so fast that it seems 2 or more jobs seem to execute at the same time
  35. 35. BATCH PROCESSING SYSTEM
  36. 36. JOB DESCRIPTION IN JCL
  37. 37. MULTIPROCESSING SYSTEM- TYPES
  38. 38. MULTIPROCESSING SYSTEM- TYPES  Tightly coupled • Processors share memory and I/O systems • Shared memory access • Smoothens information interchange • Good synchronization among processes
  39. 39. FLYNN’S CLASSIFICATION OF COMPUTERS
  40. 40. FLYNN’S CLASSIFICATION OF COMPUTERS  SIMD-Single instruction multiple data • Array of n number of processing elements • Identical elements controlled by master controller • Single instruction operates on multiple data • Eg. Connection machine uses SIMD architecture
  41. 41. SIMD VERSUS MIMD Practical Differences SIMD and MIMD are different in practice. SIMD is often used for problems requiring lots of computations with processors performing the same operation in parallel. MIMD is often used for problems requiring algorithms broken up into parts that are separate and independent, with each part being assigned to a different processor for simultaneous solution. Technical Differences SIMD and MIMD are also technically different. SIMD processors tend to be simpler, smaller, cheaper and faster than MIMD processors, but MIMD is capable of more complex operations. MIMD operations that the SIMD architecture can accomplish tend to take more time with SIMD than with using the MIMD architecture. SIMD processors must perform complex operations sequentially, while MIMD processors can do this concurrently.
  42. 42. MULTIPROCESSING CONFIGURATIONS  Separate supervisor configuration • Each processor has individual copy of OS input, output and file system. • Limited parallel processing is possible  Master slave configuration • A master processor controls all processors and assigns work to them. • Parallel processing possible
  43. 43. MULTIPROCESSING CONFIGURATIONS  Symmetric configuration • Also known as Floating Master configuration • All processors are equal and independent • Only one processor executes the OS at a time • Parallel processing allowed
  44. 44. GUI INTERFACE  Uses computer graphics to make program easier to use  Contains icons for navigation  Selection done by mouse instead of commands through keyboard
  45. 45. DIFFERENT TYPES OF OS
  46. 46. OBJECT LINKING & EMBEDDING

×