Version 1.1 -- April 14, 1994
Introduction
This document describes the low level mechanism by which programs running on the Osprey can access files in the host (DOS for now) system's directory structure.
Access to host files is accomplished through a "hardware" device which performs the various file access functions.
For now all data transfers are in binary--any record handling or line terminator fixup must be done by the PDP program. The PDP program is also responsible for dealing with problems resulting from DOS's 8.3 filename limitation. As other host environments are supported, commands will be added to allow the PDP program to determine the filename formats supported by the host.
The device is enabled by adding a line to the Osprey configuration file:
DosDevice = DosDevice [Options]
The following table lists the supported options:
Option | Function | Legal range | Default |
/Adr:<Octal> | Set device CSR address | 160000-177777 | 176470 |
/Vct:<Octal> | Set device interrupt vector | 000-774 | 240 |
/Pri:<Decimal> | Set device interrupt priority | 4-7 | 4 |
The device interrupt vector can also be programmed at run time through the CSR register.
To control the DSF device, PDP program sets up command and data buffers in memory, then initiates the command by passing the command buffer address to the device and setting the START bit in the device's CSR register. The remainder of this document defines the device registers and command buffer layout.
DOS File Device
All commands to the DSF device follow the same sequence:
Dos File Device Register Definitions
Offset | Name | Function |
0 | CSR | Control/Status Register |
2 | LADR | Command Block Address, low order |
4 | HADR | Command Block Address, bits 0-5 only, others always zero |
DSF CSR Bit Definitions
Bit | Read/Write | Function |
0 | Read/Write | Enables device interrupt upon command completion |
1 | Write | START bit--set to 1 by driver to initiate a command |
1 | Read | Indicates device is processing current command, cleared when done |
2 | Read only | Indicates device has completed current command, cleared on read |
3 | Read only | Unused, read as 0 |
4-7 | Read only | Device priority level |
8-14 | Read/Write | Device interrupt vector / 4 |
15 | Read Only | Unused, read as 0 |
DSF Command Block Format
Word | Function |
0 | Command code |
2 | Command status (set by device) |
4 | File Number |
6 | Optional command parameter |
10 | Data buffer length in bytes |
12 | Data buffer address, low order |
14 | Data buffer address, high order |
DSF Command Definitions
Command code 0 -- Open DOS File
The device will read in the filename, and attempt to open the file in the appropriate mode. Data buffer may contain any valid Host filename. Upon success, the device will return a file number to be used to reference the file in later commands such read and write data.
The file open mode parameter contains several fields:
DSF Open command parameter word fields
Bit | Function |
0-1 | Requested access mode |
2-4 | DOS Sharing mode |
The following octal field values are supported:
Read/Write Access Mode:READ_WRITE0000
READ_ONLY0001
WRITE_ONLY0002
Sharing Mode:COMPATIBILITY0000
DENY_NONE0004
DENY_READ0010
DENY_WRITE0014
EXCLUSIVE0020
For now, all data transferred is strictly binary byte-stream; no data formatting is performed by the host. It the future, the open-mode parameter my be also contain re-formatting information.
These commands allow scanning of a host directory. The host returns the first/next filename from the directory which matches the input pattern. Only one "first,next,...,next" sequence is valid at a time--i.e. it is not possible to intermix scanning of two host directories.
After each command, the PDP driver code should check the status word to make sure the command completed correctly. The following table defines the current error codes possible from the DSF device:
DSF Device Status Codes
Value | Function |
0 | No error--command was successful |
1 | End of file encountered on read |
2 | File or Directory does not exist |
9 | Invalid file number |
12 | Not enough memory |
13 | Permission denied |
17 | File already exists |
18 | Cross device link |
22 | Invalid command or argument |
24 | Too many open files |
28 | No space left on device |
36 | Resource deadlock would occur |