kexts: fbcon: implement VGA text mode tty driver

This commit is contained in:
2023-06-11 09:24:22 +01:00
parent abe4af093e
commit d10c89544c
4 changed files with 54 additions and 34 deletions

View File

@@ -6,25 +6,6 @@
#include "fbcon.h"
static struct tty_driver *fbcon_driver = NULL;
static struct device *tty0 = NULL;
static void tty_console_write(struct console *con, const char *s, unsigned int len)
{
if (!tty0) {
return;
}
}
static int tty_console_read(struct console *con, char *s, unsigned int len)
{
return 0;
}
static struct console tty_console = {
.c_name = "tty0",
.c_write = tty_console_write,
.c_read = tty_console_read,
};
static void tty_clear(struct device *dev, int x, int y, int width, int height)
{
@@ -72,9 +53,9 @@ static kern_status_t online(struct kext *self)
}
fbcon_driver->tty_ops = &tty_ops;
fbcon_driver->tty_type = TTY_DRIVER_FULL;
tty_driver_register(fbcon_driver);
console_register(&tty_console);
return KERN_OK;
}
@@ -98,8 +79,11 @@ kern_status_t start_console_on_framebuffer(struct device *fb)
return status;
}
if (!tty0) {
tty0 = tty;
status = tty_device_register(tty, fbcon_driver, misc_device());
if (status != KERN_OK) {
/* TODO destroy tty device */
return status;
}
return status;