IFS - FSD Calling Conventions and Requirements: Difference between revisions
Created page with "{{IFSRef}} {{IBM-Reprint}} Calling conventions between FS router, FSD, and FS helpers are: *Arguments will be pushed in left-to-right order onto the stack. *The callee i..." |
mNo edit summary |
||
Line 2: | Line 2: | ||
{{IBM-Reprint}} | {{IBM-Reprint}} | ||
Calling conventions between FS router, FSD, and FS helpers are: | Calling conventions between FS router, FSD, and FS helpers are: | ||
*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. | |||
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. | |||
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. | |||
Each FS service routine may block. | |||
==Error Codes== | ==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 | 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 which are defined by each FSD is 0xEF00 - 0xFEFF. | The set of error codes for errors general to all FSDs is 0xEE00 - 0xEEFF. The following errors have been defined: | ||
*ERROR_VOLUME_NOT_MOUNTED = 0xEE00 - the FSD did not recognize the volume. | |||
The set of error codes which are defined by each FSD is 0xEF00 - 0xFEFF. | |||
[[Category:IFS]] | [[Category:IFS]] |
Latest revision as of 16:37, 11 February 2020
Installable File Systems for OS/2 |
---|
Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation
Calling conventions between FS router, FSD, and FS helpers are:
- 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.
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.
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:
- ERROR_VOLUME_NOT_MOUNTED = 0xEE00 - the FSD did not recognize the volume.
The set of error codes which are defined by each FSD is 0xEF00 - 0xFEFF.