1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

Add a Console device and start refactoring screen output.

This commit is contained in:
Andreas Kling 2018-10-21 21:59:43 +02:00
parent d5ec18027e
commit a70bfb87d5
5 changed files with 95 additions and 13 deletions

25
Kernel/Console.h Normal file
View file

@ -0,0 +1,25 @@
#pragma once
#include <VirtualFileSystem/CharacterDevice.h>
class Console final : public CharacterDevice {
public:
static Console& the();
Console();
virtual ~Console() override;
virtual ssize_t read(byte* buffer, size_t size) override;
virtual ssize_t write(const byte* data, size_t size) override;
private:
byte m_rows { 25 };
byte m_columns { 80 };
byte m_cursorRow { 0 };
byte m_cursorColumn { 0 };
byte m_currentAttribute { 0x07 };
const byte* s_vgaMemory { (const byte*)0xb8000 };
};