kexts: add generic vga/fb tty driver
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <socks/pmap.h>
|
||||
#include <socks/device.h>
|
||||
#include <socks/tty.h>
|
||||
#include <socks/kext.h>
|
||||
#include <socks/clock.h>
|
||||
#include <socks/types.h>
|
||||
@@ -20,6 +21,10 @@
|
||||
#include <arch/acpi.h>
|
||||
#endif
|
||||
|
||||
#ifdef KEXT_NET_DOORSTUCK_SOCKS_FBCON
|
||||
#include <socks/fbcon.h>
|
||||
#endif
|
||||
|
||||
#define PTR32(x) ((void *)((uintptr_t)(x)))
|
||||
|
||||
static ml_cpu_block g_bootstrap_cpu = {0};
|
||||
@@ -56,6 +61,8 @@ static void init_bootfb(multiboot_info_t *mb)
|
||||
__bootfb_varinfo.fb_bpp = mb->framebuffer_bpp;
|
||||
__bootfb_varinfo.fb_stride = mb->framebuffer_pitch;
|
||||
|
||||
__bootfb_fixedinfo.fb_baseptr = mb->framebuffer_addr;
|
||||
|
||||
switch (mb->framebuffer_type) {
|
||||
case MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED:
|
||||
__bootfb_varinfo.fb_flags = FB_MODE_PALETTE;
|
||||
@@ -77,6 +84,7 @@ static void init_bootfb(multiboot_info_t *mb)
|
||||
__bootfb_varinfo.fb_alpha.b_offset = 0;
|
||||
break;
|
||||
case MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT:
|
||||
__bootfb_fixedinfo.fb_baseptr = 0xb8000;
|
||||
__bootfb_varinfo.fb_flags = FB_MODE_VGATEXT;
|
||||
__bootfb_varinfo.fb_xcells = 80;
|
||||
__bootfb_varinfo.fb_ycells = 25;
|
||||
@@ -84,8 +92,6 @@ static void init_bootfb(multiboot_info_t *mb)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
__bootfb_fixedinfo.fb_baseptr = mb->framebuffer_addr;
|
||||
}
|
||||
|
||||
static void use_uniprocessor_topology(void)
|
||||
@@ -101,7 +107,7 @@ int ml_init(uintptr_t arg)
|
||||
init_bootfb(mb);
|
||||
|
||||
bootstrap_cpu_init();
|
||||
vgacon_init();
|
||||
early_vgacon_init();
|
||||
serialcon_init(115200);
|
||||
clock_calibrate(500);
|
||||
|
||||
@@ -148,6 +154,8 @@ int ml_init(uintptr_t arg)
|
||||
acpi_init();
|
||||
#endif
|
||||
|
||||
tty_init();
|
||||
|
||||
ml_int_enable();
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user