Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 53
Sample $CMON Program
!------------------------------------------------------------
! Procedure to process a Processcreation^msg message. This
! request is always accepted, except during the shutdown
! phase. This procedure assigns the process to a processor
! according to whether the process runs at a high or low
! priority. Processes with a higher priority run in one set
! of processors, whereas processes with priority 150 or less run
! in the remaining processors. The allocation of processors to
! priority or nonpriority processes is run-time configurable;
! see the CHANGE^CPU^STATUS procedure.
!------------------------------------------------------------
PROC PROCESS^PROCESSCREATION^MSG;
BEGIN
STRUCT MSG(*); !template for Processcreation^msg
BEGIN ! message
INT MSGCODE;
INT USERID;
INT CIPRI;
INT CIINFILE[0:11];
INT CIOUTFILE[0:11];
INT PROGNAME[0:11];
INT PRIORITY;
INT PROCESSOR;
INT PROGINFILE[0:11];
INT PROGOUTFILE[0:11];
INT PROGLIBFILE[0:11];
INT PROGSWAPFILE[0:11];
INT PARAM_LEN;
STRING PARAM[0:MAX^PARAM - 1];
END;
INT .EXT PROCESSCREATION^MSG(MSG) :=
$XADR(BUFFER); !structure pointer
! to I/O buffer
STRUCT .PROCESSCREATION^REJECT; !structure for reject
BEGIN ! reply
INT REPLYCODE;
STRING REPLYTEXT[0:63];
END;
STRUCT .PROCESSCREATION^ACCEPT; !structure for accept
BEGIN ! reply
INT REPLYCODE;
INT PROGNAME[0:11];
INT PRIORITY;
INT PROCESSOR;
END;
INT COUNT;