IFS - FSD Calling Conventions and Requirements

Calling conventions between FS router, FSD, and FS helpers are: Interrupts must ALWAYS be enabled and the direction flag should be presumed to be undefined. Calls to the FS helpers will change the direction flag at will.
 * Arguments will be pushed in left-to-right order onto the stack.
 * The callee is responsible for cleaning up the stack.
 * Registers DS, SI, DI, BP, SS, SP are preserved.
 * Return conditions appear in AX with the convention that AX == 0 indicates successful completion. AX != 0 indicates an error with the value of AX being the error code.

In OS/2, file system drivers are always called in kernel protect mode. This has the advantage of allowing the FSD to execute code without having to account for preemption; no preemption occurs when in kernel mode. While this greatly simplifies FSD structure, it forces the FSD to yield the CPU when executing long segments of code. In particular, an FSD must not hold the CPU for more than 2 milliseconds at a time. The FSD helper FSH_YIELD is provided so that FSDs may relinquish the CPU.

File system drivers cannot have any interrupt-time activations. Because they occupy high, movable, and swappable memory, there is no guarantee of addressability of the memory at interrupt time.

Each FS service routine may block.

Error Codes
FSDs should use existing error codes when possible. New error codes must be in the range reserved for FSDs. The FS_FSCTL interface must support returning information about new error codes.

The set of error codes for errors general to all FSDs is 0xEE00 - 0xEEFF. The following errors have been defined: The set of error codes which are defined by each FSD is 0xEF00 - 0xFEFF.
 * ERROR_VOLUME_NOT_MOUNTED = 0xEE00 - the FSD did not recognize the volume.