imp

IMP notes

Documentation: BBN 1822

Source: Projects/simh/H316 branch DPS8M

Notes:

The HnENAB, HnRDY annd HnFULL instructions are not yet implemented, nor are the ENAB and RDY counterpart on the ABSI side.

There is a connect from the host to the IMP called 'IMP READY TEST'. When the IMP is ready to communicate, it connects the IMP READY TEST LINE to the IMP MASTER READY line. The host sees IMP MASTER READY become connected and know the IMP is running. Likewise, there is a line from the IMP to the host called HOST READY TEST, which the host connects to the HOST MASTER READY line to indicate the the HOST is running.

The HnENAB command (I believe) connect the IMP READY TEST line to the IMP MASTER READY; what is needed is a way to emulate these ready bits over the UDP link. The HnENAB should cause the IMP to send out a periodic out-of-band UDP packet marked 'IMP MASTER READY' to indicate that the HnENAB that the TEST and MASTER lines are connected; the host should do the same.

I may have the role of RDY and ENAB switched.

imp_attach_read
imp_attach_write
imp_data$multics_host_number
imp_detach_read
imp_detach_write
imp_down
imp_finish
imp_global_queue
imp_init
imp_order$imp_update_write_allocation
imp_read$imp_read_with_message_count
imp_read_order
imp_reattach_read
imp_reattach_write
imp_service$imp_service_lock_unlock
imp_status$data_transfer_sw_on
imp_write
imp_write_order

imp_attach_read, iom_attach_write, imp_detach_read, imp_detach_write

imp_attach_read constant entry (fixed bin (8), fixed bin (16), fixed bin (8), fixed bin (8), bit (36) aligned, fixed bin (71), fixed bin (17), fixed bin (35))
imp_attach_write constant entry (fixed bin (8), fixed bin (16), fixed bin (8), fixed bin (8), bit (36) aligned, fixed bin (71), fixed bin (17), fixed bin (35))
imp_detach_read constant entry (fixed bin (17), fixed bin (35))
imp_detach_write constant entry (fixed bin (17), fixed bin (35))

      210 assign_link:
      211           entry (P_sock_ptr, P_error_code);

      241           if socket_ptr -> socket.send_gender = WRITE_GENDER
      242           then do;                                          /* this is a write link                           */
      243                call imp_attach_write (binary (hostaddr.net), binary (hostaddr.imp), binary (hostaddr.host),
      244                          link_num, socket_ptr -> socket.process_id,
      245                          socket_ptr -> socket.event_channel, link_indx, P_error_code);
      246                if P_error_code ^= 0
      247                then return;
      248                call imp_write_order (link_indx, IMP_ORDER_set_byte_size, addr (byte_size), status, (0));
      249                end;
      250           else do;
      251                call imp_attach_read (binary (hostaddr.net), binary (hostaddr.imp), binary (hostaddr.host),
      252                          link_num, socket_ptr -> socket.process_id,
      253                          socket_ptr -> socket.event_channel, link_indx, P_error_code);
      254                if P_error_code ^= 0
      255                then return;
      256                call imp_read_order (link_indx, IMP_ORDER_set_byte_size, addr (byte_size), status, (0));
      257                end;
      258

      267 unassign_link:
      268           entry (P_sock_ptr, P_error_code);

      284                if socket_ptr -> socket.send_gender = WRITE_GENDER
      285                then do;
      286                     call imp_detach_write (link_indx, P_error_code);
      287                     if P_error_code ^= 0
      288                     then return;
      289                     end;
      290                else do;
      291                     call imp_detach_read (link_indx, P_error_code);
      292                     if P_error_code ^= 0
      293                     then return;
      294
      295                     hpr = addr (ncp_tables_$host_tbl);
      296                     host_tb_index = socket_ptr -> socket.host_entry_index;
      297
      298                     call release_link (addr (hpr -> host_array (host_tb_index)), link_num);
      299                     end;
      300                end;

      772 bring_host_up:
      773           procedure (p_host_ptr);

      795           host_num = binary (p_host_ptr -> host.host_number, 32);
      796           string (haddr) = bit (binary (host_num, 32), 32);
      797
      798           call reset_link_table (p_host_ptr);
      799
      800           call set_host_state (p_host_ptr, HOST_OFF);      /* set host state to off for time being           */
      801
      802           call imp_attach_read (binary (haddr.net), binary (haddr.imp), binary (haddr.host), 0, npr -> ncp_dt.ncp_procid,
      803                     npr -> ncp_dt.ncp_ev_chan, link_indx, icode);

      811           do impdim_mode = IMP_ORDER_single_message_mode, IMP_ORDER_control_link;
      812                call imp_read_order (link_indx, impdim_mode, null (), status, icode);
      813                end;
      814
      815           call imp_attach_write (binary (haddr.net), binary (haddr.imp), binary (haddr.host), 0, npr -> ncp_dt.ncp_procid,
      816                     npr -> ncp_dt.ncp_ev_chan, link_indx, icode);

      822           p_host_ptr -> host.xmit_link_index = link_indx;
      823
      824           do impdim_mode = IMP_ORDER_single_message_mode, IMP_ORDER_control_link;
      825                call imp_write_order (link_indx, impdim_mode, null (), status, icode);
      826                end;

      832 take_host_down:
      833           entry (p_host_ptr);
      834
      835           call imp_detach_read ((p_host_ptr -> host.rcv_link_index), icode);
      836           if icode ^= 0
      837           then do;
      838                call ncp_error_ (icode, "ACCESS_detach_read_link");
      839                return;
      840                end;
      841           p_host_ptr -> host.rcv_link_index = 0;
      842
      843           call imp_detach_write ((p_host_ptr -> host.xmit_link_index), icode);
      844           if icode ^= 0
      845           then do;
      846                call ncp_error_ (icode, "ACCESS_detach_write_link");
      847                return;
      848                end;
      849           p_host_ptr -> host.xmit_link_index = 0;

imp_data

imp_data$multics_host_number fixed binary (8)

imp_down

error_table_$imp_down fixed binary (35) external static

imp_finish

imp_finish constant entry (fixed bin (35))

      411 imp_down:
      412           entry (p_shutdown_reason, p_err_code);
      413
      414           call ncp_change_global_state (NCP_DOWN, p_shutdown_reason, (0));
      415
      416           call imp_finish ((0));
mp_global_queue constant entry (ptr, fixed bin (35))

      138 get_global_queue:
      139           do while ("1"b);
      140                call imp_global_queue (addr (global_data.gq_type), global_data.error_code);
      141
      142                if ncp_tables_$tracing_info ^= ""b
      143                then call ncp_trace_ (TRACE_NCP_DAEMON, "global queue:  type ^d, host ^d",
      144                               global_data.gq_type, global_data.gq_host_id);
      145
      146                mpr -> meter_dt.ncp_wakeup_count (1) = mpr -> meter_dt.ncp_wakeup_count (1) + 1;
      147                if global_data.error_code ^= 0
      148                then goto daemon_wakeup_return;
      149
      150                if global_data.gq_type = 0
      151                then goto daemon_wakeup_return;              /* global queue is now empty                      */
      152
      153                if global_data.gq_type > 2
      154                then goto check_imp_state;                   /* the IMP has changed state                      */
      155
      156                if npr -> ncp_dt.ncp_up ^= NCP_UP
      157                then goto get_global_queue;                  /* we think imp is down, ignore link entries      */
      158
      159                call process_link_type ();
      160                end;

imp_init

imp_init constant entry (fixed bin (71), fixed bin (35))

      305 imp_up:
      306           procedure (p_ev_chn, p_err_code);

      391           call imp_init (npr -> ncp_dt.ncp_ev_chan, p_err_code);   /* initialize and bring up the IMP DIM            */

imp_read_order, imp_write_order

imp_read_order constant entry (fixed bin (17), fixed bin (12), ptr, bit (18), fixed bin (35))
imp_write_order constant entry (fixed bin (17), fixed bin (12), ptr, bit (18), fixed bin (35))

/* BEGIN INCLUDE FILE imp_orders.incl.pl1                                       */

/*             This include file declares the special order codes accepted by   */
/*        the IMP DIM.                                                          */

/*        Originally created by D. M. Wells, September, 1977.                   */

     declare
         (IMP_ORDER_abort_transfer                initial (1),        /* flush buffered data                  */
          IMP_ORDER_multiple_message_mode         initial (2),        /* pack messages together if possible   */
          IMP_ORDER_single_message_mode           initial (3),        /* don't pack messages together         */
          IMP_ORDER_get_status                    initial (4),        /* return status of link and host       */
          IMP_ORDER_no_ncp                        initial (5),        /* the NCP isn't using this link        */
          IMP_ORDER_imp_ascii                     initial (6),        /* messages for IMP's  TTY              */
          IMP_ORDER_control_link                  initial (7),        /* this is NCP's control link           */
          IMP_ORDER_clear_host_state              initial (8),        /* clear stae of foreign host and IMP   */
          IMP_ORDER_block_link                    initial (9),        /* stop transferring data on link       */
          IMP_ORDER_unblock_link                  initial (10),       /* start transferring data on link      */
          IMP_ORDER_imp_octal                     initial (11),       /* message is for IMP's TTY (octal)     */
          IMP_ORDER_normal_leader                 initial (12),       /* messages for foreign host again      */
          IMP_ORDER_pgqlrr                        initial (13),       /* put on global queue when get RFNM    */
          IMP_ORDER_clear_pgqlrr                  initial (14),       /* clear flag to pgqlrr                 */
          IMP_ORDER_set_byte_size                 initial (15),       /* setthe link's bytesize               */
          IMP_ORDER_get_byte_size                 initial (16),       /* get the link's bytesize              */
          IMP_ORDER_get_allocation_status         initial (17))       /* get status and include allocations   */
               fixed binary (12) internal static options (constant);

/* END INCLUDE FILE imp_orders.incl.pl1                                         */

      210 assign_link:
      211           entry (P_sock_ptr, P_error_code);

      241           if socket_ptr -> socket.send_gender = WRITE_GENDER
      242           then do;                                          /* this is a write link                           */
      243                call imp_attach_write (binary (hostaddr.net), binary (hostaddr.imp), binary (hostaddr.host),
      244                          link_num, socket_ptr -> socket.process_id,
      245                          socket_ptr -> socket.event_channel, link_indx, P_error_code);
      246                if P_error_code ^= 0
      247                then return;
      248                call imp_write_order (link_indx, IMP_ORDER_set_byte_size, addr (byte_size), status, (0));
      249                end;
      250           else do;
      251                call imp_attach_read (binary (hostaddr.net), binary (hostaddr.imp), binary (hostaddr.host),
      252                          link_num, socket_ptr -> socket.process_id,
      253                          socket_ptr -> socket.event_channel, link_indx, P_error_code);
      254                if P_error_code ^= 0
      255                then return;
      256                call imp_read_order (link_indx, IMP_ORDER_set_byte_size, addr (byte_size), status, (0));
      257                end;

imp_read$imp_read_with_message_count

imp_read$imp_read_with_message_count constant entry (fixed bin (17), ptr,
       74                     fixed bin (24), fixed bin (24), fixed bin (17), fixed bin (35))

      155           num_xfrd = -1;                                    /* cause loop to happen at least once             */
      156           do start_ptr = global_data.areap
      157                     repeat (addr (global_data.areap -> based_bit_array (global_data.nelemt * bytesize)))
      158                     while (num_xfrd ^= 0);
      159                call imp_read$imp_read_with_message_count ((sock_ptr -> socket.impdim_index), start_ptr,
      160                          global_data.nbytes - global_data.nelemt, num_xfrd, num_msgs, global_data.error_code);
      161                global_data.nelemt = global_data.nelemt + num_xfrd;
      162
      163                sock_ptr -> socket.msg_allocation = sock_ptr -> socket.msg_allocation - num_msgs;
      164                sock_ptr -> socket.bit_allocation = sock_ptr -> socket.bit_allocation - num_xfrd * bytesize;
      165                end;

imp_write

imp_write constant entry (fixed bin (17), ptr, fixed bin (24), fixed bin (24), fixed bin (35))

      259 ncp_write:
      260           entry (P_sock_indx, P_buff_ptr, P_num_bytes, P_num_bytes_trans, P_sock_state, P_error_code);

      296           call imp_write ((sock_ptr -> socket.impdim_index), global_data.areap, global_data.nbytes, global_data.nelemt, global_data.error_code);

imp_reattach_read, imp_reattach_write

imp_reattach_read constant entry (fixed bin (17), fixed bin (71), bit (36) aligned, fixed bin (35))
imp_reattach_write constant entry (fixed bin (17), fixed bin (71), bit (36) aligned, fixed bin (35))

      452 common_activate:

      511                     j = socket_ptr -> socket.impdim_index;
      512                     if j ^= 0 then do;                      /* There is a link attached; change the ownership */
      513                          if socket_ptr -> socket.send_gender = WRITE_GENDER
      514                          then call imp_reattach_write (j, gpr -> gdt.event_chn, procid, icode);
      515                          else call imp_reattach_read (j, gpr -> gdt.event_chn, procid, icode);

imp_status$data_transfer_sw_on

imp_status$data_transfer_sw_on constant entry ()

      432 reset_imp_down:
      433           entry (p_err_code);

     469           call imp_status$data_transfer_sw_on ();

imp_order$imp_update_write_allocation

imp_order$imp_update_write_allocation constant entry (fixed bin (17), fixed bin (16), fixed bin (32))

       91 allocate_write:
       92           entry (P_host_ptr, P_link_num, P_msg_allocation, P_bit_allocation, P_error_code);
       93
       94           P_error_code = 0;
       95
       96           call ncp_util_$find_socket_from_link_number ((P_host_ptr -> host.host_number), P_link_num, "1"b, sock_ptr, P_error_code);
       97           if P_error_code ^= 0
       98           then return;
       99
      100           call imp_order$imp_update_write_allocation ((sock_ptr -> socket.impdim_index), P_msg_allocation, P_bit_allocation);
      101
      102           call ncp_util_$unlock_socket (sock_ptr, (0));

imp_service$imp_service_lock_unlock

imp_service$imp_service_lock_unlock constant entry ()

      119 ncp_daemon_wakeup:
      120           entry (P_gq_status_ptr, P_error_code);
      121
      122           global_data.entry_type = 2;                       /* tells this was the ncp_daemon_wakeup entry */
      123           global_data.privilege_code = 1;
      124
      125           call make_global_data_valid ();
      126
      127           call condition_ ("any_other", ncp_error_$any_other_handler);
      128
      129           call setup ();
      130
      131           call imp_service$imp_service_lock_unlock;
      132           global_data.areap = null ();
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License