Exemple #1
0
/* ×Ö·ûÉ豸³õʼ»¯ */
long chr_dev_init(long mem_start, long mem_end)
{
	if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
		printk("unable to get major %d for memory devs\n", MEM_MAJOR);
	mem_start = tty_init(mem_start);
#ifdef CONFIG_PRINTER
	mem_start = lp_init(mem_start);
#endif
#if defined (CONFIG_BUSMOUSE) || defined (CONFIG_82C710_MOUSE) || \
    defined (CONFIG_PSMOUSE) || defined (CONFIG_MS_BUSMOUSE) || \
    defined (CONFIG_ATIXL_BUSMOUSE)
	mem_start = mouse_init(mem_start);
#endif
#ifdef CONFIG_SOUND
	mem_start = soundcard_init(mem_start);
#endif
#if CONFIG_TAPE_QIC02
	mem_start = tape_qic02_init(mem_start);
#endif
/*
 *      Rude way to allocate kernel memory buffer for tape device
 */
#ifdef CONFIG_FTAPE
        /* allocate NR_FTAPE_BUFFERS 32Kb buffers at aligned address */
        ftape_big_buffer= (char*) ((mem_start + 0x7fff) & ~0x7fff);
        printk( "ftape: allocated %d buffers alligned at: %p\n",
               NR_FTAPE_BUFFERS, ftape_big_buffer);
        mem_start = (long) ftape_big_buffer + NR_FTAPE_BUFFERS * 0x8000;
#endif 
	return mem_start;
}
Exemple #2
0
int
init_module (void)
{
  int             err;
  int             ints[21];
  int             i;

  if (connect_wrapper (WRAPPER_VERSION) < 0)
    {
      printk ("Sound: Incompatible kernel (wrapper) version\n");
      return -EINVAL;
    }

  /*
     * "sound=" command line handling by Harald Milz.
   */
  i = 0;
  while (i < 20 && sound[i])
    ints[i + 1] = sound[i++];
  ints[0] = i;

  if (i)
    sound_setup ("sound=", ints);

  err = module_register_chrdev (sound_major, "sound", &sound_fops);
  if (err)
    {
      printk ("sound: driver already loaded/included in kernel\n");
      return err;
    }

  chrdev_registered = 1;
  soundcard_init ();

  if (sound_nblocks >= 1024)
    printk ("Sound warning: Deallocation table was too small.\n");

  return 0;
}