Osprey DOS File Access Device

PRELIMINARY

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:

  1. Fill in the command definition block
  2. Fill in the command data block if required
  3. Give the address of command definition block to the device
  4. Set the START bit the CSR to start the command
  5. Wait for the command to complete by polling the CSR or waiting for device to interrupt
  6. Check the command block status word for possible errors

 

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

 

Command code 1 -- Create DOS File

Command code 2 -- Delete DOS File

Command code 3 -- Read DOS File

Command code 4 -- Write DOS File

Command code 5 -- Set File Position

Command code 6 -- Find first matching file

Command code 7 -- Find next matching file

Command code 8 -- Close DOS file


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