From: HENRY::IN%"carl%cithex.caltech.edu%sri-kl.ARPA%relay.cs.net@rca.com" 12-FEB-1987 17:33 To: vtcf@ncsc.arpa, info-vax@cithex.caltech.edu Subj: Re: RAM disks on VAX 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 #include 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); } --------------------------------------------------------------------------------