X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/99f2ed669601a61f4f0210e0b481ff877cd9bea7..35a7d633d3f16c1e0539af6ca5d8e7482926cd93:/lunaix-os/hal/char/lxconsole.c diff --git a/lunaix-os/hal/char/lxconsole.c b/lunaix-os/hal/char/lxconsole.c index 4922297..aa4136a 100644 --- a/lunaix-os/hal/char/lxconsole.c +++ b/lunaix-os/hal/char/lxconsole.c @@ -27,7 +27,7 @@ struct console { - struct capability_meta* tp_cap; + struct potens_meta* tp_cap; struct lx_timer* flush_timer; struct fifo_buf output; struct fifo_buf input; @@ -92,8 +92,8 @@ __lxconsole_listener(struct input_device* dev) fifo_putone(&lx_console.input, ttychr); - struct termport_capability* tpcap; - tpcap = get_capability(lx_console.tp_cap, typeof(*tpcap)); + struct termport_potens* tpcap; + tpcap = get_potens(lx_console.tp_cap, typeof(*tpcap)); term_notify_data_avaliable(tpcap); pwake_all(&lx_reader); @@ -298,24 +298,16 @@ lxconsole_spawn_ttydev(struct device_def* devdef) waitq_init(&lx_reader); input_add_listener(__lxconsole_listener); - struct termport_capability* tp_cap; - - tp_cap = new_capability(TERMPORT_CAP, struct termport_capability); - term_cap_set_operations(tp_cap, termport_default_ops); - - lx_console.tp_cap = cap_meta(tp_cap); - device_grant_capability(tty_dev, lx_console.tp_cap); - register_device(tty_dev, &devdef->class, "vcon"); - term_create(tty_dev, "VCON"); + term_attach_potens(tty_dev, NULL, "VCON"); return 0; } static struct device_def lxconsole_def = { - .name = "Lunaix Virtual Console", - .class = DEVCLASS(DEVIF_NON, DEVFN_TTY, DEV_BUILTIN), - .init = lxconsole_spawn_ttydev + def_device_name("Lunaix Virtual Console"), + def_device_class(LUNAIX, TTY, VTERM), + def_on_load(lxconsole_spawn_ttydev) }; EXPORT_DEVICE(lxconsole, &lxconsole_def, load_onboot); \ No newline at end of file