tty: add tee
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
e78aeb66fb
commit
4909482a2e
5 changed files with 88 additions and 10 deletions
|
|
@ -31,17 +31,17 @@ static struct tty_serial_ops fbcon_serial_ops = {
|
|||
.serial_getchar = fbcon_getchar,
|
||||
};
|
||||
|
||||
void fbcon_init(void)
|
||||
struct tty *fbcon_init(void)
|
||||
{
|
||||
if (!fb_res || !fb_res->framebuffer_count)
|
||||
return;
|
||||
return NULL;
|
||||
|
||||
struct limine_framebuffer *fb = fb_res->framebuffers[0];
|
||||
size_t fb_size = fb->pitch * fb->height;
|
||||
void *fb_virt = map_mmio_dev((paddr_t)TO_PHYS(fb->address), fb_size);
|
||||
|
||||
if (!fb_virt)
|
||||
return;
|
||||
return NULL;
|
||||
|
||||
ft_ctx = flanterm_fb_init(
|
||||
NULL, NULL, fb_virt, fb->width, fb->height, fb->pitch, fb->red_mask_size, fb->red_mask_shift, fb->green_mask_size,
|
||||
|
|
@ -49,7 +49,7 @@ void fbcon_init(void)
|
|||
0, 0, 0, 0, FLANTERM_FB_ROTATE_0);
|
||||
|
||||
if (!ft_ctx)
|
||||
return;
|
||||
return NULL;
|
||||
|
||||
struct tty *fbtty = tty_create("tty1", NULL);
|
||||
|
||||
|
|
@ -57,4 +57,6 @@ void fbcon_init(void)
|
|||
tty_printf = fbtty;
|
||||
|
||||
kinfo("fbcon: framebuffer console initialized (%lux%lu)\n", fb->width, fb->height);
|
||||
|
||||
return fbtty;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue