Commit e08ae34d authored by James Simmons's avatar James Simmons

Initialization cleanup. The ultimate idea is seperate out the video display...

Initialization cleanup. The ultimate idea is seperate out the video display and input device intialization into there own functions. Also to seperate out teh console and tty intializtions. In theory we could have a light weight VT console by itself.
parent 6e0cbcec
......@@ -126,6 +126,7 @@ const struct consw *conswitchp;
#define DEFAULT_BELL_DURATION (HZ/8)
extern void vcs_make_devfs (unsigned int index, int unregister);
extern void console_map_init(void);
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
......@@ -2445,42 +2446,6 @@ void __init con_init(void)
return;
}
memset(&console_driver, 0, sizeof(struct tty_driver));
console_driver.magic = TTY_DRIVER_MAGIC;
console_driver.name = "vc/%d";
console_driver.name_base = 1;
console_driver.major = TTY_MAJOR;
console_driver.minor_start = 1;
console_driver.num = MAX_NR_CONSOLES;
console_driver.type = TTY_DRIVER_TYPE_CONSOLE;
console_driver.init_termios = tty_std_termios;
console_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
/* Tell tty_register_driver() to skip consoles because they are
* registered before kmalloc() is ready. We'll patch them in later.
* See comments at console_init(); see also con_init_devfs().
*/
console_driver.flags |= TTY_DRIVER_NO_DEVFS;
console_driver.refcount = &console_refcount;
console_driver.table = console_table;
console_driver.termios = console_termios;
console_driver.termios_locked = console_termios_locked;
console_driver.open = con_open;
console_driver.close = con_close;
console_driver.write = con_write;
console_driver.write_room = con_write_room;
console_driver.put_char = con_put_char;
console_driver.flush_chars = con_flush_chars;
console_driver.chars_in_buffer = con_chars_in_buffer;
console_driver.ioctl = vt_ioctl;
console_driver.stop = con_stop;
console_driver.start = con_start;
console_driver.throttle = con_throttle;
console_driver.unthrottle = con_unthrottle;
if (tty_register_driver(&console_driver))
panic("Couldn't register console driver\n");
init_timer(&console_timer);
console_timer.function = blank_screen;
if (blankinterval) {
......@@ -2519,6 +2484,50 @@ void __init con_init(void)
#endif
}
int __init vty_init(void)
{
memset(&console_driver, 0, sizeof(struct tty_driver));
console_driver.magic = TTY_DRIVER_MAGIC;
console_driver.name = "vc/%d";
console_driver.name_base = 1;
console_driver.major = TTY_MAJOR;
console_driver.minor_start = 1;
console_driver.num = MAX_NR_CONSOLES;
console_driver.type = TTY_DRIVER_TYPE_CONSOLE;
console_driver.init_termios = tty_std_termios;
console_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
/* Tell tty_register_driver() to skip consoles because they are
* registered before kmalloc() is ready. We'll patch them in later.
* See comments at console_init(); see also con_init_devfs().
*/
console_driver.flags |= TTY_DRIVER_NO_DEVFS;
console_driver.refcount = &console_refcount;
console_driver.table = console_table;
console_driver.termios = console_termios;
console_driver.termios_locked = console_termios_locked;
console_driver.open = con_open;
console_driver.close = con_close;
console_driver.write = con_write;
console_driver.write_room = con_write_room;
console_driver.put_char = con_put_char;
console_driver.flush_chars = con_flush_chars;
console_driver.chars_in_buffer = con_chars_in_buffer;
console_driver.ioctl = vt_ioctl;
console_driver.stop = con_stop;
console_driver.start = con_start;
console_driver.throttle = con_throttle;
console_driver.unthrottle = con_unthrottle;
if (tty_register_driver(&console_driver))
panic("Couldn't register console driver\n");
kbd_init();
console_map_init();
vcs_init();
return 0;
}
#ifndef VT_SINGLE_DRIVER
static void clear_buffer_attributes(int currcons)
......
......@@ -2245,9 +2245,8 @@ static struct tty_driver dev_tty_driver, dev_syscons_driver;
static struct tty_driver dev_ptmx_driver;
#endif
#ifdef CONFIG_VT
extern void con_init_devfs (void);
extern void console_map_init(void);
static struct tty_driver dev_console_driver;
extern int vty_init(void);
#endif
/*
......@@ -2287,13 +2286,6 @@ void __init tty_init(void)
if (tty_register_driver(&dev_syscons_driver))
panic("Couldn't register /dev/console driver\n");
/* console calls tty_register_driver() before kmalloc() works.
* Thus, we can't devfs_register() then. Do so now, instead.
*/
#ifdef CONFIG_VT
con_init_devfs();
#endif
#ifdef CONFIG_UNIX98_PTYS
dev_ptmx_driver = dev_tty_driver;
dev_ptmx_driver.driver_name = "/dev/ptmx";
......@@ -2317,10 +2309,7 @@ void __init tty_init(void)
if (tty_register_driver(&dev_console_driver))
panic("Couldn't register /dev/tty0 driver\n");
vcs_init();
kbd_init();
console_map_init();
vty_init();
#endif
#ifdef CONFIG_ESPSERIAL /* init ESP before rs, so rs doesn't see the port */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment