Removed dmap table. Publish endpoint in DS before calling mapdriver5.

This commit is contained in:
Philip Homburg 2007-08-07 12:24:06 +00:00
parent 6ef2e9b866
commit 1f04287b3f
2 changed files with 6 additions and 32 deletions

View File

@ -9,7 +9,6 @@
*/
#include "inc.h"
#include <fcntl.h>
#include <minix/dmap.h>
#include <minix/endpoint.h>
#include "../../kernel/const.h"
#include "../../kernel/type.h"
@ -22,7 +21,6 @@ FORWARD _PROTOTYPE(void reply, (int whom, message *m_out) );
/* Data buffers to retrieve info during initialization. */
PRIVATE struct boot_image image[NR_BOOT_PROCS];
PUBLIC struct dmap dmap[NR_DEVICES];
long rs_verbose = 0;
@ -142,30 +140,6 @@ PRIVATE void init_server(void)
*/
if ((s = sys_getimage(image)) != OK)
panic("RS","warning: couldn't get copy of image table", s);
if ((s = getsysinfo(FS_PROC_NR, SI_DMAP_TAB, dmap)) < 0)
panic("RS","warning: couldn't get copy of dmap table", errno);
#if 0
/* Now initialize the table with the processes in the system image.
* Prepend /sbin/ to the binaries so that we can actually find them.
*/
for (s=0; s< NR_BOOT_PROCS; s++) {
ip = &image[s];
if (ip->proc_nr >= 0) {
rproc[s].r_flags = RS_IN_USE;
rproc[s].r_proc_nr_e = ip->endpoint;
rproc[s].r_pid = getnpid(ip->proc_nr);
for(t=0; t< NR_DEVICES; t++)
if (dmap[t].dmap_driver == ip->proc_nr)
rproc[s].r_dev_nr = t;
strcpy(rproc[s].r_cmd, "/sbin/");
strcpy(rproc[s].r_cmd+6, ip->proc_name);
rproc[s].r_argc = 1;
rproc[s].r_argv[0] = rproc[s].r_cmd;
rproc[s].r_argv[1] = NULL;
}
}
#endif
/* Set alarm to periodically check driver status. */
if (OK != (s=sys_setalarm(RS_DELTA_T, 0)))

View File

@ -799,9 +799,13 @@ endpoint_t *endpoint;
return(s); /* return error */
}
s= ds_publish_u32(rp->r_label, child_proc_nr_e);
if (s != OK)
printf("start_service: ds_publish_u32 failed: %d\n", s);
if (rp->r_dev_nr > 0) { /* set driver map */
if ((s=mapdriver(child_proc_nr_e, rp->r_dev_nr, rp->r_dev_style,
!!use_copy /* force */)) < 0) {
if ((s=mapdriver5(rp->r_label, strlen(rp->r_label),
rp->r_dev_nr, rp->r_dev_style, !!use_copy /* force */)) < 0) {
report("RS", "couldn't map driver", errno);
rp->r_flags |= RS_EXITING; /* expect exit */
if(child_pid > 0) kill(child_pid, SIGKILL); /* kill driver */
@ -832,10 +836,6 @@ endpoint_t *endpoint;
if(endpoint) *endpoint = child_proc_nr_e; /* send back child endpoint */
s= ds_publish_u32(rp->r_label, child_proc_nr_e);
if (s != OK)
printf("start_service: ds_publish_u32 failed: %d\n", s);
return(OK);
}