+}
+
+static int
+lxconsole_spawn_ttydev(struct device_def* devdef)
+{
+ struct device* tty_dev = device_allocseq(NULL, &lx_console);
+ tty_dev->ops.write = __tty_write;
+ tty_dev->ops.write_page = __tty_write_pg;
+ tty_dev->ops.read = __tty_read;
+ tty_dev->ops.read_page = __tty_read_pg;
+ tty_dev->ops.exec_cmd = __tty_exec_cmd;
+
+ waitq_init(&lx_reader);
+ input_add_listener(__lxconsole_listener);
+
+ register_device(tty_dev, &devdef->class, "vcon");
+
+ term_create(tty_dev, "FB");
+
+ return 0;
+}
+
+static struct device_def lxconsole_def = {
+ .name = "Lunaix Virtual Console",
+ .class = DEVCLASS(DEVIF_NON, DEVFN_TTY, DEV_BUILTIN),
+ .init = lxconsole_spawn_ttydev
+};
+// FIXME
+EXPORT_DEVICE(lxconsole, &lxconsole_def, load_onboot);
\ No newline at end of file