Page 177 - DCAP403_Operating System
P. 177

Operating System




                    Notes          Device Reservation

                                   Coordination to provide exclusive access to a device
                                   1.   System calls for allocation and deallocation

                                   2.   Watch out for deadlock

                                   Error Handling

                                   1.   OS can recover from disk read, device unavailable, transient write failures
                                   2.   Most OS’s return an error number or code when I/O request fails
                                   3.   System error logs hold problem reports

                                   I/O Protection

                                   User process may accidentally or purposefully attempt to disrupt normal operation via illegal
                                   I/O instructions

                                   1.   All I/O instructions defined to be privileged

                                   2.   I/O must be performed via system calls
                                   3.   Memory-mapped and I/O port memory locations must be protected too




                                       Task    For complete the I/O operation you need two I/O operation and these operations
                                     are.


                                   9.6 Disk Scheduling


                                   In order to satisfy an I/O request the disk controller must first move the head to the correct

                                   track and sector. Moving the head between cylinders takes a relatively long time so in order to
                                   maximise the number of I/O requests which can be satisfied the scheduling policy should try to

                                   minimise the movement of the head. On the other hand, minimising head movement by always
                                   satisfying the request of the closest location may mean that some requests have to wait a long
                                   time. Thus, there is a trade-off between throughput (the average number of requests satisfi ed in
                                   unit time) and response time (the average time between a request arriving and it being satisfi ed).
                                   Various different disk scheduling policies are used:

                                   First Come First Served (FCFS)

                                   The disk controller processes the I/O requests in the order in which they arrive, thus moving
                                   backwards and forwards across the surface of the disk to get to the next requested location
                                   each time. Since no reordering of request takes place the head may move almost randomly
                                   across the surface of the disk. This policy aims to minimise response time with little regard for
                                   throughput.
                                   Each time an I/O request has been completed the disk controller selects the waiting request
                                   whose sector location is closest to the current position of the head. The movement across the
                                   surface of the disk is still apparently random but the time spent in movement is minimised. This
                                   policy will have better throughput than FCFS but a request may be delayed for a long period if
                                   many closely located requests arrive just after it.




          170                              LOVELY PROFESSIONAL UNIVERSITY
   172   173   174   175   176   177   178   179   180   181   182