Ejemplo n.º 1
0
/*===========================================================================*
 *				mapdrivers				     *
 *===========================================================================*/
PUBLIC void mapdrivers()
{
  /* Map drivers to controllers and update the task table to that selection. */
  static char name[] = "c0";
  int c;
  struct drivertab *dp;
  char *drivername;
  struct tasktab *tp;

  for (c= 0; c < NR_CTRLRS; c++) {
	name[1] = '0' + c;
	if ((drivername = getenv(name)) == NULL) continue;
	for (dp = drivertab;
	     dp < drivertab + sizeof(drivertab)/sizeof(drivertab[0]); dp++) {
		if (strcmp(drivername, dp->drivername) == 0) {
			tp = &tasktab[CTRLR(c) + NR_TASKS];
			tp->initial_pc = dp->driver;
			strcpy(tp->name, drivername);
		}
	}
  }
}
Ejemplo n.º 2
0
/* The order of the entries here determines the mapping between major device
 * numbers and tasks.  The first entry (major device 0) is not used.  The
 * next entry is major device 1, etc.  Character and block devices can be
 * intermixed at random.  This ordering determines the device numbers in
 * /dev/ and is thereby more or less cast in stone once allocated.
 * Note that the major device numbers used in /dev are NOT the same as the 
 * task numbers used inside the kernel (as defined in <include/minix/com.h>).
 * Also note that FS knows the device number of /dev/ram to load the RAM disk.
 */
PUBLIC struct dmap dmap[] = {
/*   ?                 Open/Close  I/O       Task #       Device  File
     -                 ----------  --------  -----------  ------  ----       */
  DT(1,                no_dev,     0,        0)            /* 0 = not used   */
  DT(1,                gen_opcl,   gen_io,   MEM)          /* 1 = /dev/mem   */
  DT(1,                gen_opcl,   gen_io,   FLOPPY)       /* 2 = /dev/fd0   */
  DT(NR_CTRLRS >= 1,   gen_opcl,   gen_io,   CTRLR(0))     /* 3 = /dev/c0    */
  DT(1,                tty_opcl,   gen_io,   TTY)          /* 4 = /dev/tty00 */
  DT(1,                ctty_opcl,  ctty_io,  TTY)          /* 5 = /dev/tty   */
  DT(ENABLE_PRINTER,   gen_opcl,   gen_io,   PRINTER)      /* 6 = /dev/lp    */

#if (MACHINE == IBM_PC)
  DT(1,                no_dev,     0,        ANY)          /* 7 = /dev/ip    */
  DT(NR_CTRLRS >= 2,   gen_opcl,   gen_io,   CTRLR(1))     /* 8 = /dev/c1    */
  DT(0,                0,          0,        0)            /* 9 = not used   */
  DT(NR_CTRLRS >= 3,   gen_opcl,   gen_io,   CTRLR(2))     /*10 = /dev/c2    */
  DT(0,                0,          0,        0)            /*11 = not used   */
  DT(NR_CTRLRS >= 4,   gen_opcl,   gen_io,   CTRLR(3))     /*12 = /dev/c3    */
  DT(ENABLE_SB16,      gen_opcl,   gen_io,   SB16)         /*13 = /dev/audio */
  DT(ENABLE_SB16,      gen_opcl,   gen_io,   SB16MIXER)    /*14 = /dev/mixer */
#endif /* IBM_PC */
};