[mod.computers.vax] RAM disks on VAX

vtcf@NCSC.ARPA.UUCP (02/10/87)

Is there a way to create a RAM disk on a VAX running VMS? The Feb 9 issue of
Digital Review, Page 8, has an article mentioning a "pseudo" backup disk
in RAM. Any help would be greatly appreciated.

Thanks

Tom Williams

DHASKIN@CLARKU.BITNET.UUCP (02/11/87)

Tom Williams <VTCF@NCSC.ARPA> asks:
 
> Is there a way to create a RAM disk on a VAX running VMS? The Feb 9 issue of
> Digital Review, Page 8, has an article mentioning a "pseudo" backup disk
> in RAM. Any help would be greatly appreciated.
 
Interestingly, a colleague at Digital Review with whom I used to work forwarded
two routines to establish a RAM disk as mentioned.  They include a command
procedure and an accompanying Macro-32 program.  Please note that I have
*not* tested it (in fact, I haven't even had time to look at it) but I would
be willing to forward to anyone interested.
 
Let me know...
 
Denis W. Haskin
------------------------------------------------------------------------
DHASKIN@CLARKU.BITNET    Office of Information Systems     (617)793-7193
                                Clark University
                                950 Main Street
                              Worcester MA  01610
 
"Anyone who _moves_ before Most Holy comes back out will spend the rest
 of eternity sipping lava through an iron straw."
                                                               - Cerebus
 

carl@CITHEX.CALTECH.EDU.UUCP (02/12/87)

In order to connect the pseudo-disk to your system:
--------------------------------------------------------------------------------
$ run sys$system:sysgen
CONNECT device-name/NOADAPTER/DRIVER=PDDRIVER
--------------------------------------------------------------------------------
wheer you use something like PDA0 for device-name.
The following source (in PASCAL) formats a pseudo-disk.
--------------------------------------------------------------------------------
[inherit ('SYS$LIBRARY:STARLET')]
program Format_pd (input, output);

type
  unsigned_word = [word] 0..65535;
  status_block = [volatile] record
		   status, count : unsigned_word;
		   dev : unsigned;
		 end;

var
  chan : unsigned_word;
  iosb : status_block;
  device : varying [80] of char;
  block_size : integer;
  stat : integer;

  procedure LIB$SIGNAL (%IMMED stat : integer); extern;

begin
  write ('Device name: ');
  readln (device);
  write ('Disk blocks: ');
  readln (block_size);
  stat := $ASSIGN (DEVNAM := device, CHAN := chan);
  if not odd (stat) then LIB$SIGNAL (stat);

  stat := $QIOW (CHAN := chan,
		 FUNC := IO$_FORMAT,
		 IOSB := iosb,
		 P1 := %IMMED (block_size));
  if not odd (stat) then LIB$SIGNAL (stat);
  if not odd (iosb.status) then LIB$SIGNAL (iosb.status);
end.
--------------------------------------------------------------------------------
As does the following C program:
--------------------------------------------------------------------------------
#include <descrip.h>
#include <iodef.h>

main(nargs, args)
int nargs;
char **args;
{	static char buffer[64];
	$DESCRIPTOR(dev, buffer);
 	long chan, maxblock, iosb[2], stat;
	
	if (nargs < 2) {
		printf("Device to format: ");
		gets(buffer);
	} else
		strcpy(buffer, *++args);
	dev.dsc$w_length = strlen(buffer);
	if (((stat = SYS$ASSIGN(&dev, &chan, 0, 0)) & 7) != 1)
		exit(stat);
	if (nargs < 3) {
		printf("Number of blocks: ");
		scanf("%x", &maxblock);
	} else
		maxblock = atol(*++args);
	if (((stat = SYS$QIOW(0, chan, IO$_FORMAT, iosb, 0, 0, maxblock,
		0, 0, 0, 0, 0)) & 7) == 1)
		stat = *iosb;
	exit(stat);
}
--------------------------------------------------------------------------------

bob@seismo.CSS.GOV@cec2.UUCP (02/12/87)

In article <8702101849.AA00835@ncsc.ARPA> vtcf@NCSC.ARPA.UUCP writes:
>Is there a way to create a RAM disk on a VAX running VMS? The Feb 9 issue of
>Digital Review, Page 8, has an article mentioning a "pseudo" backup disk
>in RAM. Any help would be greatly appreciated.
>
>Thanks
>
>Tom Williams

 I think such a program would be simple to write, although, under VMS, your
 RAM disk would constantly be paged back and forth to the physical system
 disk.  A somewhat less than optimal result. :-)

     Try starting with the VMS Guide to Device Drivers.

							Bob

vtcf@NCSC.ARPA.UUCP (02/14/87)

To answer the question of why I wanted a RAM disk, it was actually for
another collegue who has a Microvax, with a FORTRAN program that was reading
some huge file over and over again.  As it turns out, the RAM disk works fine,
but it didn't really speed up his program any, due to the manner in which he
was doing the I/O.  The system manager of the Micovax was trying to find a 
way to speed up someone else's program, so I was getting third-hand knowledge.
I think I'll go have a look at the person's code, because I know he isn't
very Knowledgeable about FORTRAN.

Tom Williams

sasaki@HARVARD.HARVARD.EDU.UUCP (02/16/87)

One warning, the PDDRIVER is fairly slow. The transfer from the "disk"
to the user's buffer is done a byte at a time, rather than a movc3.
Remember too that this slow transfer is done a at elevated IPL.

We were thinking of setting aside a few megabytes on our 8650's to put
commonly used images and small databases. Rather than improve
performance, overall performace actually went down. This might be due
to the particular work load.
----------------
  Marty Sasaki				uucp:   harvard!sasaki
  Ziff Davis Technical Information Co.	arpa:	sasaki@harvard.harvard.edu
  80 Blanchard Road			bitnet: sasaki@harvunxh
  Burlington, MA 01803			phone:	617-273-5500