*/
#include "inc.h"
#include <fcntl.h>
-#include <minix/dmap.h>
#include <minix/endpoint.h>
#include "../../kernel/const.h"
#include "../../kernel/type.h"
/* 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;
*/
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)))
panic("RS", "couldn't set alarm", s);
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 */
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);
}