?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Console Interaction Task' ??
MODULE osm$console_interaction_task;

{ PURPOSE:
{   This module contains the main routine for the Console Interaction Task in System Job Monitor.  It
{   completes the system initialization as defined by the site and then processes commands from the
{   system console.  If the task terminates it will be restarted by the System Job Monitor in a slightly
{   different form.
{
{ NOTES:
{   This module is placed on the OSF$OPERATOR_LIBRARY (OSF$TASKS) library.

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
*copyc avp$clear_active_capabilities
*copyc clp$include_file
*copyc clp$include_line
*copyc clp$set_primary_task
*copyc dsp$force_lock_of_window_23d
*copyc ofp$enable_stop_key
*copyc osp$check_for_desired_mf_class
*copyc osp$generate_message
*copyc osp$save_system_constants
*copyc osp$verify_system_privilege
*copyc rap$get_console_task_status
?? OLDTITLE ??
?? NEWTITLE := 'osp$console_interaction_task', EJECT ??
{
{ PURPOSE:
{   This procedure contains the main routine for the Console Interaction Task in System Job Monitor.  It
{   completes the system initialization as defined by the site and then processes commands from the
{   system console.  If the task terminates it will be restarted by the System Job Monitor in a slightly
{   different form.
{
{ NOTES:
{   WARNING!!!
{   If the NAME of this procedure is changed the following changes MUST also be made:
{     1. in the deck OSM$INITIALIZE_VIRTUAL_SYSTEM change the NAME of the starting procedure
{     2. in the deck OSM$SYSTEM_TASK_MAINT_23D change the procedures OSP$DEACTIVATE_SYSTEM_TASK
{        and OSP$ACTIVATE_SYSTEM_TASK to look for the new NAME in the system task table

  PROCEDURE [XDCL, #GATE] osp$console_interaction_task;

    VAR
      ignore_status: ost$status,
      initiate_command: string (70),
      length: integer,
      restricted_mainframe: boolean,
      status: ost$status,
      task_restarted: boolean;

    osp$verify_system_privilege;

    status.normal := TRUE;

    clp$set_primary_task (status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    rap$get_console_task_status (task_restarted);

    { If the task has been restarted then issue a call to clear all of the active capabilities for the task.
    { During deadstart the task must possess all capabilities for proper system initialization.

    IF task_restarted THEN
      avp$clear_active_capabilities (status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    IFEND;

    STRINGREP (initiate_command, length, '$system.osf$builtin_library.initiate_system ',
          'task_restarted=', task_restarted);
    clp$include_line (initiate_command (1, length), TRUE, osc$null_name, status);
    IF NOT status.normal THEN
      osp$generate_message (status, ignore_status);
    IFEND;

    { Force the locking of the main window.

    dsp$force_lock_of_window_23d;

    osp$check_for_desired_mf_class (osc$mc_china_or_soviet_class, restricted_mainframe);
    IF restricted_mainframe THEN
      ofp$enable_stop_key;
    IFEND;

    IF NOT task_restarted THEN
      osp$save_system_constants (syc$scsv_ds_complete_values, status);
      IF NOT status.normal THEN
        osp$generate_message (status, ignore_status);
      IFEND;
    IFEND;

    STRINGREP (initiate_command, length, '$system.osf$builtin_library.initiate_sou');
    clp$include_line (initiate_command (1, length), TRUE, osc$null_name, status);
    IF NOT status.normal THEN
      osp$generate_message (status, ignore_status);
    IFEND;

    clp$include_file ('$LOCAL.COMMAND', '', osc$null_name, status);

  PROCEND osp$console_interaction_task;
?? OLDTITLE ??
MODEND osm$console_interaction_task;
