[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:
Justin C. Miller
2021-07-27 19:45:34 -07:00
parent 269324c553
commit 1802c5ea2e
12 changed files with 256 additions and 194 deletions

View File

@@ -1,12 +1,11 @@
#pragma once
/// \file console.h
/// Text output handler
#pragma once
#include <stdarg.h>
#include <stddef.h>
#include "kernel_args.h"
namespace uefi {
struct boot_services;
namespace protos {
struct simple_text_output;
}}
@@ -17,9 +16,9 @@ namespace boot {
class console
{
public:
using framebuffer = kernel::init::framebuffer;
console(uefi::protos::simple_text_output *out);
console(uefi::boot_services *bs, uefi::protos::simple_text_output *out);
void announce();
size_t print_hex(uint32_t n) const;
size_t print_dec(uint32_t n) const;
@@ -27,20 +26,16 @@ public:
size_t print_long_dec(uint64_t n) const;
size_t printf(const wchar_t *fmt, ...) const;
const framebuffer & fb() const { return m_fb; };
static console & get() { return *s_console; }
static size_t print(const wchar_t *fmt, ...);
private:
friend class status_line;
void pick_mode(uefi::boot_services *bs);
size_t vprintf(const wchar_t *fmt, va_list args) const;
size_t m_rows, m_cols;
uefi::protos::simple_text_output *m_out;
framebuffer m_fb;
static console *s_console;
};