1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

Kernel: Print all logbuffer from ConsoleDevice to debug Virtual Console

This commit is contained in:
Liav A 2021-05-14 16:39:28 +03:00 committed by Andreas Kling
parent 2e565f1b8a
commit dbccfc3281
3 changed files with 35 additions and 5 deletions

View file

@ -116,10 +116,12 @@ UNMAP_AFTER_INIT NonnullRefPtr<VirtualConsole> VirtualConsole::create(size_t ind
return adopt_ref(*new VirtualConsole(index));
}
UNMAP_AFTER_INIT VirtualConsole::VirtualConsole(const unsigned index)
: TTY(4, index)
, m_index(index)
, m_console_impl(*this)
UNMAP_AFTER_INIT NonnullRefPtr<VirtualConsole> VirtualConsole::create_with_preset_log(size_t index, const CircularQueue<char, 16384>& log)
{
return adopt_ref(*new VirtualConsole(index, log));
}
UNMAP_AFTER_INIT void VirtualConsole::initialize()
{
m_tty_name = String::formatted("/dev/tty{}", m_index);
VERIFY(GraphicsManagement::the().console());
@ -138,6 +140,25 @@ UNMAP_AFTER_INIT VirtualConsole::VirtualConsole(const unsigned index)
VERIFY(m_cells);
}
UNMAP_AFTER_INIT VirtualConsole::VirtualConsole(const unsigned index)
: TTY(4, index)
, m_index(index)
, m_console_impl(*this)
{
initialize();
}
UNMAP_AFTER_INIT VirtualConsole::VirtualConsole(const unsigned index, const CircularQueue<char, 16384>& log)
: TTY(4, index)
, m_index(index)
, m_console_impl(*this)
{
initialize();
for (auto& ch : log) {
echo(ch);
}
}
UNMAP_AFTER_INIT VirtualConsole::~VirtualConsole()
{
VERIFY_NOT_REACHED();