VGAConsole.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/RefCounted.h>
  8. #include <AK/Types.h>
  9. #include <Kernel/Graphics/Console/Console.h>
  10. #include <Kernel/Graphics/VGACompatibleAdapter.h>
  11. namespace Kernel::Graphics {
  12. class VGAConsole : public Console {
  13. public:
  14. // Note: these are the modes we will support and only these
  15. enum class Mode {
  16. TextMode = 1, // Text Mode
  17. Colored256, // 320x200 256 color mode
  18. Colored16, // 640x480 16 color mode
  19. };
  20. public:
  21. static NonnullRefPtr<VGAConsole> initialize(const VGACompatibleAdapter&, Mode, size_t width, size_t height);
  22. virtual bool is_hardware_paged_capable() const override { return false; }
  23. virtual bool has_hardware_cursor() const override { return false; }
  24. virtual void flush(size_t, size_t, size_t, size_t) override { }
  25. virtual ~VGAConsole() = default;
  26. protected:
  27. VGAConsole(const VGACompatibleAdapter&, Mode, size_t width, size_t height);
  28. NonnullOwnPtr<Memory::Region> m_vga_region;
  29. NonnullRefPtr<VGACompatibleAdapter> m_adapter;
  30. const Mode m_mode;
  31. };
  32. }