130 |
rig_demux_function_t rt; |
rig_demux_function_t rt; |
131 |
int err = 0; |
int err = 0; |
132 |
|
|
133 |
#if 0 |
trace_printf ("-- got req %d", msgh_in->msgh_id); |
|
if (msgh_in->msgh_id < 4000) |
|
|
trace_printf ("--- got request %d (process pid %d) -- reply port is %d", |
|
|
msgh_in->msgh_id, proc_lookup ((void *) msgh_in->msgh_local_port)->p_pid, |
|
|
msgh_in->msgh_remote_port); |
|
|
#endif |
|
134 |
|
|
135 |
if ((rt = pager_memory_object_routine (msgh_in->msgh_id)) |
if ((rt = pager_memory_object_routine (msgh_in->msgh_id)) |
136 |
|| (rt = nova_S_nova_routine (msgh_in->msgh_id)) |
|| (rt = nova_S_nova_routine (msgh_in->msgh_id)) |
145 |
reply->retcode_type.msgt_deallocate = 0; |
reply->retcode_type.msgt_deallocate = 0; |
146 |
reply->retcode_type.msgt_number = 1; |
reply->retcode_type.msgt_number = 1; |
147 |
|
|
|
#if 0 |
|
|
trace_printf ("calling demux function %p", rt); |
|
|
#endif |
|
|
|
|
148 |
err = (*rt) (msgh_in, msgh_out); |
err = (*rt) (msgh_in, msgh_out); |
149 |
} |
} |
|
#if 0 |
|
|
if (err) |
|
|
trace_printf ("--- sending reply to port %d (incoming was %d) (process %d - req %d)", |
|
|
msgh_out->msgh_remote_port, msgh_in->msgh_remote_port, |
|
|
proc_lookup ((void *) msgh_in->msgh_local_port)->p_pid, |
|
|
msgh_in->msgh_id); |
|
|
#endif |
|
150 |
return err; |
return err; |
151 |
} |
} |
152 |
|
|
194 |
assert (err == 0); |
assert (err == 0); |
195 |
|
|
196 |
assert (ihash_create (&proc_hash_table) == 0); |
assert (ihash_create (&proc_hash_table) == 0); |
197 |
|
assert (ihash_create (&proc_pidhash) == 0); |
198 |
|
assert (ihash_create (&proc_pgrphash) == 0); |
199 |
|
assert (ihash_create (&proc_sesshash) == 0); |
200 |
|
|
201 |
/* ??? */ |
/* ??? */ |
202 |
io_buf_init (); |
io_buf_init (); |
219 |
|
|
220 |
/* We create a dummy process for /sbin/init. Right after we try to |
/* We create a dummy process for /sbin/init. Right after we try to |
221 |
execute the init program. If we fail we bail out. */ |
execute the init program. If we fail we bail out. */ |
222 |
err = proc_dummy (&init_proc); |
err = proc_create_startup (& init_proc); |
223 |
if (err) |
if (err) |
224 |
error (1, err, "Could not create dummy process for /sbin/init"); |
error (1, err, "Could not create startup process for /sbin/init"); |
225 |
|
|
226 |
/* Open file descriptors for /sbin/init: stdin, stdout and stderr. |
/* Open file descriptors for /sbin/init: stdin, stdout and stderr. |
227 |
If we fail to open either of them we bail out. */ |
If we fail to open either of them we bail out. */ |