[comp.os.vms] RAMdisk for VAX/VMS.

DUGAL%ECL1@STAR.STANFORD.EDU (07/23/87)

Originally sent in response to a RAMdisk request:


	Here's a public domain version of a RAMdisk for VAX/VMS V4.n that
actually works pretty well.  It takes its space out of your non-paged pool,
which means you'll probably have to re-adjust some SYSGEN parameters for
anything of significant size.  The device driver PDDRIVER.EXE is UUENCODEd.
If you don't have the UUENCODE/UUDECODE program set, let me know and I'll
re-send it in a format you can decode.

	To install the driver, simply add a command set like:

$ MCR SYSGEN
CONNECT DXA0/NOADAPTOR/DRIVER=PDDRIVER

	To set the size of the RAMdisk, you run the program FORMAT_PD
which takes the newly-created device DXA0: and formats it to a particular
size.  This is a nice way to set things up, since the size is dynamic and
you can take more or less of your non-paged pool as required.  The program
requires CMKRNL of course, so run it from a privileged account.

	Good luck, and let me know if you have any difficulties.

+---------------------------------------------------------------------------+
| David G. Dugal        University of R.I., Engineering Computer Laboratory |
| System Manager        306 Bliss Hall, Kingston, RI 02881  (401) 792-2488  |
|                                                                           |
|       UUCP:           allegra!rayssd!uriecl!dugal                         |
|       Internet:       dugal%ecl1.SPAN@star.stanford.edu                   |
|       SPAN/HEPnet:    ECL1::DUGAL  -or-  6334::DUGAL                      |
|       PSI:            PSI%31103210735::ECL1::DUGAL                        |
|       Easylink: 62926791  TWX: 650-299-5584  MCI Mail: 299-5584           |
|                                                                           |
|       "Logic is a small bird chirping in a meadow.                        |
|        Logic is a wreath of flowers ... that smell BAD."                  |
+---------------------------------------------------------------------------+

$!--------------------------- Start chopping here ----------------------------
$ create 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.
$!
$ create pddriver.txt
begin 775 pddriver.exe
MJ  P $0 6       ,#(P-0$"  #__________P     B   !3\ 915@R44@
M                                    !       !             A0
M1$12259%4@                                         #6"TQ
M            0'1/P!G%C@ %,#0M,#              $  "       *   "
M @      ____________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M______________________\          '8"'@ % M  . !S $0! 0 $  $
M      A01$12259%4@                    80 T8Q,0 &$P #$ L "! X
M PA !1P0/ ,  @  $$   1!! ! 00@$  A!%  $01  !$%X %1!H 00 !3 "
M10$%/ )( 08, H0   #Q    5=, @#@   !5TP" 5=, @     !5TP" 5=,
M@$// (!5TP" B    %73 (!5TP" 5=, @ (9 DB# '\# @$"2(  ? , $
M @ " -*+ (  "    0 ! !&, (         , "2+ (         0 %6+ (
M      !@ :N+ (           K.+ ( " 0(      -64 ( " 0(      ,^4
M (    !      ,F4 (     (@    -*6 ( %U&4%J!"E9-&?&"H @%42'][O
M&P$  %' #U'*#U'""%'0@<7, ,>/  (  &'%L  %L*,@Q9H [P &HR!1D%'%
MD@#@"*,J#. +I60'/(]4 E 1,)$!41,:D1%1$Q61"%$3")$>41,D,78 J(\
M"*5D$0:JCP (I60\ 7ZPHS*N M".4-11%Y^TS@" T,7, % 3&=#%L !1$Q+$
MCP "  !1W5,6GP6J (#0CE/%CP "  "C.%$3(!:? :D @.E0%]!2Q<P QX\
M @  4<6P /?%L "E1A&BU,7, -3%L  1H^$(HRH7FJ5$4:2C.E&@HSA1UU'$
MCP "  !1$0G%CP "  "C.%' Q<P 4="C,E+A :,J"1:?P<D @#%<_Q:?J<D
M@#%3_ZH@I60%
M
M
M
M
M
M
M
M
M        -        @A01$12259%4@-8+3$R,BU-05(M,3DX-B Q.#HQ-#(R
M+4U!4BTQ.3@V(#$X.C$T%@   59!6"TQ,2!,:6YK97(@5C T+3 P$P !  "#
4       )+B0D04)3)"0N  (  P!!

end
$ exit
-------