Special Properties of Disk Devices
Since there is no virtual memory function in µT-Kernel, the disk driver does not require special handling.
For systems with virtual memory like T-Kernel, the disk device is special. When utilizing virtual memory, data transfer is executed between memory and disk. So the disk driver needs to be called by the OS.
The need for the OS to perform data transfer with a disk arises when access is made to nonresident memory and the memory contents must be read from the disk (page in). The OS calls the disk driver in this case.
If nonresident memory is accessed in the disk driver, the OS must likewise call the disk driver. In such a case, if the disk driver treats the access to nonresident memory as a wait for page in, it is possible that the OS will again request disk access. Even then, the disk driver must be able to execute the later OS request.
A similar case may arise in suspension processing. When access is made to nonresident memory during suspension processing and a disk driver is called, if that disk driver is already suspended, page in will not be possible. To avoid such a situation, suspension processing should suspend other devices before disk devices. If there are multiple disk devices, however, the order of their suspension is indeterminate. For this reason, during suspension processing, a disk driver must not access nonresident memory.
Because of the above limitations, a disk driver must not use (access) nonresident memory. It is possible, however, that the IO @buf@fer (buf) space specified with tk_rea_dev or tk_wri_dev will be nonresident memory, since this is a memory location specified by the caller. In the case of IO @buf@fers, therefore, it is necessary to make the memory space resident at the time of IO access.

Comments
Click here to Post a Comment