20 #ifndef MACHINE_X86_VGA_H 21 #define MACHINE_X86_VGA_H 23 #include "pedigree/kernel/machine/Vga.h" 24 #include "pedigree/kernel/processor/IoPort.h" 25 #include "pedigree/kernel/processor/MemoryMappedIo.h" 26 #include "pedigree/kernel/processor/types.h" 28 #define VGA_BASE 0x3C0 29 #define VGA_AC_INDEX 0x0 30 #define VGA_AC_WRITE 0x0 31 #define VGA_AC_READ 0x1 32 #define VGA_MISC_WRITE 0x2 33 #define VGA_SEQ_INDEX 0x4 34 #define VGA_SEQ_DATA 0x5 35 #define VGA_DAC_READ_INDEX 0x7 36 #define VGA_DAC_WRITE_INDEX 0x8 37 #define VGA_DAC_DATA 0x9 38 #define VGA_MISC_READ 0xC 39 #define VGA_GC_INDEX 0xE 40 #define VGA_GC_DATA 0xF 41 #define VGA_REG_ATTR_MODE_CTL 0x10 43 #define VGA_CRTC_INDEX 0x14 44 #define VGA_CRTC_DATA 0x15 45 #define VGA_INSTAT_READ 0x1A 49 #define VGA_NUM_SEQ_REGS 5 50 #define VGA_NUM_CRTC_REGS 25 51 #define VGA_NUM_GC_REGS 9 52 #define VGA_NUM_AC_REGS 21 53 #define VGA_NUM_REGS \ 54 (1 + VGA_NUM_SEQ_REGS + VGA_NUM_CRTC_REGS + VGA_NUM_GC_REGS + \ 63 X86Vga(uint32_t nRegisterBase, uint32_t nFramebufferBase);
89 isMode(
size_t nCols,
size_t nRows,
bool bIsText,
size_t nBpp = 0);
133 virtual void pokeBuffer(uint8_t *pBuffer,
size_t nBufLen);
144 virtual void peekBuffer(uint8_t *pBuffer,
size_t nBufLen);
151 virtual void moveCursor(
size_t nX,
size_t nY);
155 operator uint16_t *()
const 157 if (m_Framebuffer ==
true)
158 return reinterpret_cast<uint16_t *
>(m_Framebuffer.
virtualAddress());
167 uint8_t getControls();
168 void setControls(uint8_t newControls);
virtual void restoreMode()
virtual void peekBuffer(uint8_t *pBuffer, size_t nBufLen)
virtual void moveCursor(size_t nX, size_t nY)
virtual size_t getNumCols()
virtual void pokeBuffer(uint8_t *pBuffer, size_t nBufLen)
virtual void clearControl(VgaControl which)
virtual bool isMode(size_t nCols, size_t nRows, bool bIsText, size_t nBpp=0)
virtual bool isLargestTextMode()
virtual void setControl(VgaControl which)
virtual bool setMode(int mode)
void * virtualAddress() const
virtual bool setLargestTextMode()
virtual void rememberMode()
virtual size_t getNumRows()