Send/Receive Driver for RSX-11M Variable Length Send/Receive Driver for RSX-11M v.3.2 Joseph Sventek Computer Science & Mathematics Department Lawrence Berkeley Laboratory Berkeley, CA 94720 -1- Send/Receive Driver for RSX-11M The send/receive driver permits a variable-length message capability for RSX-11M v.3.2. The receiver task does not have to be installed for the message to be buffered. The messages are buffered in an internal pool within the driver, thus freeing up the Dynamic Storage Region of RSX for other myriad uses. A lifetime is associated with each message, after which the internal buffer space is freed up for further use. The buffers are also freed when the message is read by the receiver task. The flushing of messages is performed as follows: when the driver is loaded, it is called at its powerfail entry point. There, it attempts to allocate a clock queue control block from DSR. If this is successful, it fills in the appropriate information and queues a timer request for itself TINTPT seconds in the future. If the clock block could not be allocated, the device is marked off-line and a "DEVICE NOT READY" message is issued at the console via TKTN. If this happens to you, your system is ready to crash anyway, but the check is performed nonetheless. When the timer routine is entered, the queue of messages is searched for messages which have outlived their usefulness. Any found are removed from the queue and their buffers returned to the driver's internal pool. Just before returning to the executive, the timer routine queues another timer request for itself TINTPT seconds in the future. Due to this perpetual timer, just unloading the driver could be catastrophic, since the timer request is for a fixed location in physical memory. In order to permit unloading of the driver, a separate task is provided (UNX, extended unload). UNX issues an IO.STP QIO to the driver. If this QIO succeeds, UNX then spawns the following commands to MCR...: DEVICE SR: UNLOAD SR: DEVICE SR: UNX is distributed with the Virtual Aether driver on UIC [307,35]. The QIO will fail if UNX is invoked from a non-priveleged terminal. If you use SR: for passing arguments within the Software Tools system, it is suggested that you VMR it into DRVPAR and leave it there. To build the driver, copy the contents of [307,34] to your current UIC and invoke >@SRGEN Answer the questions and have fun. After loading the driver, it can be tested by compiling and -2- Send/Receive Driver for RSX-11M task-building SRTEST.FTN. This program prompts the user for a message to send to itself, and then reads the message from the driver. Unless you get an error message from SRTEST, everything is working OK. In case your wondering at the distinction between SRDRV.MAC and srdrv.m, the latter is an archive of the individual source modules needed to generate the former. To generate SRDRV.MAC, type the following command to the shell: ar p srdrv.m | tr "a-z_" "A-Z$" >srdrv.mac All driver routines subscribe to the following register conventions: r0 free for use r1 free for use r2 address of message header block r3 address of i/o request packed r4 address of TCB r5 address of UCB If any of r2-r5 are to be used, they must be saved and restored. The maximum message size is kept in U.CW4 of the UCB. It is assembled to be the value specified to SRGEN, but can be changed dynamically via the SET /BUF=SR:n MCR command. -3- Send/Receive Driver for RSX-11M Vital Statistics Device name - SR0: Legal Function codes IO.WVB,IO.WLB p1 buffer address p2 # of bytes to write p3 high order half of receiver taskname (rad50) p4 low order half of same p5 message lifetime (in seconds) p6 if non-zero, flush all currently buffered messages for this sender-receiver pair before queueing this message. IO.RVB,IO.RLB p1 buffer address p2 size of buffer in bytes IO.STP status returns writes IS.SUC - word 2 of iosb has number of bytes written == p2 IE.BAD - no task name specified in p3-p4 IE.ALC - could not allocate internal buffers for message IE.NOD - could not allocate message header block reads IS.SUC - word 2 of iosb has number of bytes read IE.DAO - message bigger than buffer, only p2 bytes copied IE.DNA - data not available stop IS.SUC IE.PRI - not invoked by a priveleged terminal -4-