1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 #include <dos.h>
34 #include <cat.h>
35 #include <ws_dcls.h>
36 #include <ws_stack.h>
37 #include <ws_error.h>
38 #include <ws_msg.h>
39 #include <wsmincap.h>
40
41 extern local_cat l_CAT[];
42 extern char mysystem;
43 extern int packet_mode;
44
45 i_creins (p_ws_ptr,p_cips)
46
47 ws_stack *p_ws_ptr;
48 struct cretinst_param_struct *p_cips;
49 {
50 int cap_index;
51 int cap_num;
52 int code;
53 int namelen;
54 struct alter_cat_msg alter_cat;
55
56
57
58 if (!packet_mode)
59 return (WSNOTACT);
60
61
62
63
64 if ((cap_index = find_free_cat() ) < 0)
65 return(cap_index);
66
67 p_cips -> system_id = WSIBMPC;
68 p_cips -> major_capability = cap_index + MIN_CAPABILITY_NUMBER;
69
70
71
72 l_CAT[cap_index].flags = 0;
73 l_CAT[cap_index].pad = 0;
74
75 if (!(p_cips -> entry_pt))
76 l_CAT[cap_index].flags |= NULL_BIT;
77
78
79
80 l_CAT[cap_index].sleep_time = 0;
81
82
83
84 l_CAT[cap_index].mcb_ptr = p_cips -> mcb_ptr;
85 l_CAT[cap_index].ws_entry = p_cips -> entry_pt;
86 l_CAT[cap_index].sregs.cs = p_cips -> cs_reg;;
87
88
89
90 l_CAT[cap_index].sregs.es = p_ws_ptr -> esreg;
91 l_CAT[cap_index].sregs.ds = p_ws_ptr -> dsreg;
92 l_CAT[cap_index].sregs.ss = p_ws_ptr -> ssreg;
93 l_CAT[cap_index].bpreg = p_ws_ptr -> bpreg;
94 l_CAT[cap_index].spreg = p_ws_ptr -> spreg;
95 l_CAT[cap_index].waitreg = 0;
96
97
98
99 alter_cat.system = WSMULTICS;
100 alter_cat.major = WSMAJCAP;
101 alter_cat.minor = WS_ADD_TO_RAT;
102 alter_cat.source_system = mysystem;
103 alter_cat.source_major = WSMAJCAP;
104 alter_cat.rat_major = cap_index + MIN_CAPABILITY_NUMBER;
105
106 for(namelen=0; namelen < 32; namelen++) {
107 if (p_cips -> capability_name[namelen] < ' ')
108 break;
109 }
110 send_i_mess(&alter_cat, sizeof(struct alter_cat_msg) - 2,
111 &p_cips -> capability_name[0],namelen);
112
113 return(WSNOERR);
114 }