[boot] Seperate video out from console
Separate the video mode setting out from the console code into video.*, and remove the framebuffer from the kernel args, moving it to the new init args format.
This commit is contained in:
@@ -57,9 +57,6 @@ process * load_simple_process(init::program &program);
|
||||
|
||||
unsigned start_aps(lapic &apic, const kutil::vector<uint8_t> &ids, void *kpml4);
|
||||
|
||||
/// TODO: not this. this is awful.
|
||||
init::framebuffer *fb = nullptr;
|
||||
|
||||
void
|
||||
init_console()
|
||||
{
|
||||
@@ -107,22 +104,6 @@ kernel_main(init::args *args)
|
||||
uint64_t efer = rdmsr(msr::ia32_efer);
|
||||
log::debug(logs::boot, "Control regs: cr0:%lx cr4:%lx efer:%lx", cr0, cr4, efer);
|
||||
|
||||
bool has_video = false;
|
||||
if (args->video.size > 0) {
|
||||
has_video = true;
|
||||
fb = &args->video;
|
||||
|
||||
const init::framebuffer &video = args->video;
|
||||
log::debug(logs::boot, "Framebuffer: %dx%d[%d] type %d @ %llx size %llx",
|
||||
video.horizontal,
|
||||
video.vertical,
|
||||
video.scanline,
|
||||
video.type,
|
||||
video.phys_addr,
|
||||
video.size);
|
||||
logger_clear_immediate();
|
||||
}
|
||||
|
||||
extern IDT &g_bsp_idt;
|
||||
extern TSS &g_bsp_tss;
|
||||
extern GDT &g_bsp_gdt;
|
||||
@@ -216,9 +197,8 @@ kernel_main(init::args *args)
|
||||
for (unsigned i = 1; i < args->programs.count; ++i)
|
||||
load_simple_process(args->programs[i]);
|
||||
|
||||
if (!has_video)
|
||||
sched->create_kernel_task(logger_task, scheduler::max_priority/2, true);
|
||||
|
||||
sched->create_kernel_task(logger_task, scheduler::max_priority/2, true);
|
||||
sched->start();
|
||||
}
|
||||
|
||||
|
||||
@@ -228,27 +228,6 @@ initialize_main_user_stack()
|
||||
j6_init_value *initv = nullptr;
|
||||
unsigned n = 0;
|
||||
|
||||
extern init::framebuffer *fb;
|
||||
if (fb) {
|
||||
j6_init_framebuffer *fb_desc = push<j6_init_framebuffer>(tcb->rsp3);
|
||||
kutil::memset(fb_desc, 0, sizeof(j6_init_framebuffer));
|
||||
|
||||
fb_desc->addr = fb->phys_addr;
|
||||
fb_desc->size = fb->size;
|
||||
fb_desc->vertical = fb->vertical;
|
||||
fb_desc->horizontal = fb->horizontal;
|
||||
fb_desc->scanline = fb->scanline;
|
||||
|
||||
if (fb->type == kernel::init::fb_type::bgr8)
|
||||
fb_desc->flags |= 1;
|
||||
|
||||
initv = push<j6_init_value>(tcb->rsp3);
|
||||
initv->type = j6_init_desc_framebuffer;
|
||||
initv->data = fb_desc;
|
||||
++n;
|
||||
}
|
||||
|
||||
|
||||
initv = push<j6_init_value>(tcb->rsp3);
|
||||
initv->type = j6_init_handle_other;
|
||||
initv->handle.type = j6_object_type_system;
|
||||
|
||||
Reference in New Issue
Block a user