[fa.info-vax] 4.2 toys...

KVC@engvax.UUCP (09/17/85)

Here's an interesting VMS 4.2 toy for y'all...

==========================================================================
SINCE THIS IS UNDOCUMENTED (AS FAR AS I CAN TELL) THERE'S NO TELLING WHAT
IT MAY DO TO YOU IF YOU TRY TO USE IT!  YOU HAVE BEEN FORE-WARNED!  DON'T
COMPLAIN TO DEC IF YOU GET YOURSELF IN TROUBLE!  (OR TO ME FOR THAT MATTER)
===========================================================================

Anyone looked at PDDRIVER?  It's a pseudo-disk driver.  That's a "RAMDISK"
to all you micro-boys.  In other words, it's a non-existant disk drive
mapped onto non-paged pool.  In order to get it running, you connect the
device in SYSGEN with a line like CONNECT DXA0/NOADAPT/DRIVER=PDDRIVER.
That gives you a disk with 0 blocks.  To allocate space to the disk you
use an IO$_FORMAT QIO with P1 being the size to set the disk in blocks.
Contrary to most QIO calls, this P1 must be passed by value.  The space
is allocated out of non-paged pool, so you best have lots of it available.
If need be, the system will bump your non-paged pool up past NPAGEDYN towards
NPAGEVIR, which will cause the number of pages allocated to VMS to increase.
If you do a IO$_FORMAT with a size of 0, the memory will be deallocated.
Remember, though, the memory will only be deallocated back to the npage pool
and will still be allocated to VMS, and not directly available to user
processes.

I included a simple Pascal program to allocate space to a PDDRIVER disk
at the end of this message.

Also, can anyone tell me what possible use one of these might be?  On your
average Macintosh, I suppose this is necessary, but on a virtual memory
machine?  with real disk drives?  It's kinda neat though...

Now if only they'd give us a supported pseudo-terminal driver!  That would
be really useful...

	/Kevin Carosso                  engvax!kvc @ CIT-VAX.ARPA
	 Hughes Aircraft Co.

ps.  Credit for finding this goes not to me but to Andy Davenport and
     John Carosso (yes, my brother...) at Harvey Mudd College.  According
     to them the driver will work on a VMS 4.1 system, though you'd still
     have to get the file off a 4.2 kit.

--------------------  FORMAT_PD.PAS  ---------------------------------------
[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.