The Pedigree Project
0.1
|
#include <Vga.h>
Public Member Functions | |
X86Vga (uint32_t nRegisterBase, uint32_t nFramebufferBase) | |
virtual void | setControl (VgaControl which) |
virtual void | clearControl (VgaControl which) |
virtual bool | setMode (int mode) |
virtual bool | setLargestTextMode () |
virtual bool | isMode (size_t nCols, size_t nRows, bool bIsText, size_t nBpp=0) |
virtual bool | isLargestTextMode () |
virtual size_t | getNumCols () |
virtual size_t | getNumRows () |
virtual void | rememberMode () |
virtual void | restoreMode () |
virtual void | pokeBuffer (uint8_t *pBuffer, size_t nBufLen) |
virtual void | peekBuffer (uint8_t *pBuffer, size_t nBufLen) |
virtual void | moveCursor (size_t nX, size_t nY) |
bool | initialise () |
operator uint16_t * () const | |
Private Member Functions | |
X86Vga (const X86Vga &) | |
X86Vga & | operator= (const X86Vga &) |
uint8_t | getControls () |
void | setControls (uint8_t newControls) |
Private Attributes | |
IoPort | m_RegisterPort |
MemoryMappedIo | m_Framebuffer |
uint8_t * | m_pFramebuffer |
size_t | m_nWidth |
size_t | m_nHeight |
int | m_ModeStack |
int | m_nMode |
uint8_t | m_nControls |
Additional Inherited Members | |
Public Types inherited from Vga | |
enum | VgaControl { LineGraphics = 2, Blink = 3 } |
Vga device abstraction.
Definition at line 60 of file kernel/machine/mach_pc/Vga.h.
|
virtual |
Clears the given attribute mode control.
Implements Vga.
Definition at line 66 of file kernel/machine/mach_pc/Vga.cc.
|
inlinevirtual |
Implements Vga.
Definition at line 100 of file kernel/machine/mach_pc/Vga.h.
References m_nWidth.
|
inlinevirtual |
Implements Vga.
Definition at line 108 of file kernel/machine/mach_pc/Vga.h.
References m_nHeight, m_pFramebuffer, moveCursor(), peekBuffer(), pokeBuffer(), rememberMode(), restoreMode(), and MemoryRegion::virtualAddress().
|
virtual |
Tests if the current video mode is the largest text mode.
Implements Vga.
Definition at line 89 of file kernel/machine/mach_pc/Vga.cc.
|
virtual |
Tests the current video mode.
Implements Vga.
Definition at line 84 of file kernel/machine/mach_pc/Vga.cc.
|
virtual |
Moves the cursor to the position specified by the parameters.
nX | The column to move to. |
nY | The row to move to. |
Implements Vga.
Definition at line 148 of file kernel/machine/mach_pc/Vga.cc.
References PhysicalMemoryManager::allocateRegion(), PhysicalMemoryManager::continuous, PhysicalMemoryManager::instance(), VirtualAddressSpace::KernelMode, HostedVga::m_nControls, HostedVga::m_nWidth, PhysicalMemoryManager::nonRamMemory, VirtualAddressSpace::Write, and VirtualAddressSpace::WriteThrough.
Referenced by getNumRows().
|
virtual |
Copies the current framebuffer into the given buffer.
The buffer is assumed to be in the correct format for directly copying from video memory. This will obviously depend on the current mode (text/graphical) as well as resolution and bits per pixel (graphics mode only).
pBuffer | A pointer to the buffer. |
nBufLen | The length of pBuffer. |
Implements Vga.
Definition at line 140 of file kernel/machine/mach_pc/Vga.cc.
Referenced by getNumRows().
|
virtual |
Copies the given buffer into video memory, replacing the current framebuffer.
The buffer is assumed to be in the correct format for directly copying into video memory. This will obviously depend on the current mode (text/graphical) as well as resolution and bits per pixel (graphics mode only).
pBuffer | A pointer to the buffer to swap into video memory. |
nBufLen | The length of pBuffer. |
Implements Vga.
Definition at line 130 of file kernel/machine/mach_pc/Vga.cc.
Referenced by getNumRows().
|
virtual |
Stores the current video mode.
Implements Vga.
Definition at line 94 of file kernel/machine/mach_pc/Vga.cc.
References Bios::executeInterrupt(), Bios::instance(), HostedVga::m_ModeStack, HostedVga::m_nControls, Bios::setAx(), Bios::setBx(), Bios::setDi(), and Bios::setEs().
Referenced by getNumRows().
|
virtual |
Restores the saved video mode from a rememberMode() call.
Implements Vga.
Definition at line 111 of file kernel/machine/mach_pc/Vga.cc.
References Bios::executeInterrupt(), Bios::instance(), HostedVga::m_ModeStack, HostedVga::m_nControls, HostedVga::m_nMode, Bios::setAx(), Bios::setBx(), Bios::setDi(), and Bios::setEs().
Referenced by getNumRows().
|
virtual |
Sets the given attribute mode control.
Implements Vga.
Definition at line 59 of file kernel/machine/mach_pc/Vga.cc.
|
virtual |
Sets the largest possible text mode.
Implements Vga.
Definition at line 79 of file kernel/machine/mach_pc/Vga.cc.
|
virtual |
Changes the mode the VGA device is in.
nCols | The number of columns required. |
nRows | The number of rows required. |
bIsText | True if the caller requires a text mode, false if graphical. |
nBpp | Only applicable for graphics modes - the number of bits per pixel. |
Implements Vga.
Definition at line 73 of file kernel/machine/mach_pc/Vga.cc.
References HostedVga::m_nMode.
|
private |
We keep a count of the number of times we've entered the debugger without leaving it - when we enter the debugger, we increment this. When we leave, we decrement. If we leave and it reaches zero, we change out of mode 0x3 into the current video mode.
Definition at line 198 of file kernel/machine/mach_pc/Vga.h.
|
private |
Most recent VGA controls (as these get reset on mode change).
Definition at line 208 of file kernel/machine/mach_pc/Vga.h.
|
private |
The height of the current mode.
Definition at line 190 of file kernel/machine/mach_pc/Vga.h.
Referenced by getNumRows().
|
private |
Current video mode.
Definition at line 203 of file kernel/machine/mach_pc/Vga.h.
|
private |
The width of the current mode.
Definition at line 185 of file kernel/machine/mach_pc/Vga.h.
Referenced by getNumCols().
|
private |
The framebuffer.
Definition at line 180 of file kernel/machine/mach_pc/Vga.h.
Referenced by getNumRows(), PPCVga::initialise(), and PPCVga::peekBuffer().
|
private |
The IoPort to access control registers.
Definition at line 173 of file kernel/machine/mach_pc/Vga.h.