next up previous
Next: Device Manipulation Up: No Title Previous: Device Allocation

Device Handler

PROCEDURE Device_Handler

 initialise data structures and device
 REPEAT
  wait for next user request
  initiate requested I/O operation
  User data copied to or from buffer in user process
  wait for I/O to complete
  check for errors
  provide status to fileman
 FOREVER
END

The request is made to the device handler, via a device handler interface - if implemented as messages the request/reply message contains the following :

Request Message
Device No. - disc drive, terminal etc
Operation : read, write, position heads, rewind etc (device specific) \ User Process ID : for identifying process requesting I/O
fd : needed for identifying replies
Buffer Pointer : address of data in user process
NBytes : number of bytes to transfer

Reply Message
User Process ID fd : User PID and fd identify relevant data structure in fileman Status : No. of bytes transfered or error



Omer F Rana
Fri Feb 14 18:33:29 GMT 1997