[fb] Output klog to fb if video exists
If there's no video, do as we did before, otherwise route logs to the fb driver instead. (Need to clean this up to just have a log consumer general interface?) Also added a "scrollback" class to fb driver and updated the system_get_log syscall.
This commit is contained in:
26
src/drivers/fb/scrollback.h
Normal file
26
src/drivers/fb/scrollback.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
/// \file scrollback.h
|
||||
|
||||
class screen;
|
||||
class font;
|
||||
|
||||
class scrollback
|
||||
{
|
||||
public:
|
||||
scrollback(unsigned lines, unsigned cols, unsigned margin = 2);
|
||||
|
||||
void add_line(const char *line, size_t len);
|
||||
|
||||
char * get_line(unsigned i);
|
||||
|
||||
void render(screen &scr, font &fnt);
|
||||
|
||||
private:
|
||||
char *m_data;
|
||||
char **m_lines;
|
||||
unsigned m_rows, m_cols;
|
||||
unsigned m_start;
|
||||
unsigned m_count;
|
||||
unsigned m_margin;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user