The SynchDisk object resides above the raw disk, providing a cleaner interface to its services. Specifically, it provides operations that block the calling thread until after the corresponding I/O complete interrupt takes place. In contrast, the Disk object provides the mechanism for initiating an I/O operation, but does not provide a convenient way of blocking the caller until the request completes. In addition, SynchDisk provides mutual exclusion, so that multiple threads can safely call the SynchDisk routines concurrently (recall that Disk cannot service more than one request at a time). Rather than using the Disk object directly, most applications will find it appropriate to use SynchDisk instead. SynchDisk provides the following operations:
This routine is called once at system ``boot time'' (e.g., as part of Nachos initialization process in system.cc), and it uses the Unix file ``DISK'' as its backing store. The SynchDisk object can be accessed through the global variable synchDisk.