Page 176 - DCAP403_Operating System
P. 176

Unit 9: I/O & Secondary Storage Structure




          9.5 Kernel I/O Sub-system                                                             Notes

          I/O services provides by kernel are:

          1.   Scheduling
          2.   Buffering
          3.   Caching
          4.   Spooling

          5.   Device reservation
          6.   Error handling
          7.   I/O protection

          I/O Scheduling

          1.   Some I/O request ordering via per-device queue
          2.   Some OSs try fairness – no one application receives poor service
          3.   To support asynchronous I/O, it must keep track of many I/O requests at the same time

               (a)   Use device-status table

          Buffering
          Store data in memory while transferring between devices

          1.   To cope with device speed mismatch

                        Example: File received via modem for storage on the hard disk via double
                buffering (next slide shows the differences in device speeds)
          2.   To cope with device transfer size mismatch
               (a)   Common in computer networking
          3.   To maintain “copy semantics”

               (a)   The version of data written to disk is guaranteed to be the version on the time of the
                    application system call, independent of any subsequent changes in the application’s
                    buffer.
          Caching


          Fast memory holding copy of data
          1.   Always just a copy
          2.   Key to performance

          Spooling

          A buffer hat holds output for a device
          1.   If device can serve only one request at a time
          2.   Useful for printers and tape drives




                                           LOVELY PROFESSIONAL UNIVERSITY                                   169
   171   172   173   174   175   176   177   178   179   180   181