The Pedigree Project 0.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
X86Vga Class Reference

#include <Vga.h>

+ Inheritance diagram for X86Vga:
+ Collaboration diagram for X86Vga:

Public Member Functions

virtual bool setLargestTextMode ()
 
virtual size_t getNumCols ()
 
virtual size_t getNumRows ()
 
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)
 
virtual void flush ()
 
bool setFramebuffer (Framebuffer *framebuffer) override
 
bool initialise ()
 
 operator uint16_t * () const
 

Private Member Functions

 X86Vga (const X86Vga &)
 
X86Vga & operator= (const X86Vga &)
 

Private Attributes

MemoryMappedIo m_Framebuffer
 
Spinlock m_ConsoleLock {false, true}
 
FramebufferConsole m_Console
 
Framebuffer * m_pConsoleFramebuffer = nullptr
 

Detailed Description

Vga device abstraction.

Definition at line 32 of file kernel/machine/mach_pc/Vga.h.

Constructor & Destructor Documentation

◆ X86Vga()

X86Vga::X86Vga ( )

Definition at line 28 of file mach_pc/Vga.cc.

◆ ~X86Vga()

X86Vga::~X86Vga ( )
virtual

Definition at line 30 of file mach_pc/Vga.cc.

Member Function Documentation

◆ flush()

void X86Vga::flush ( )
virtual

Reimplemented from Vga.

Definition at line 66 of file mach_pc/Vga.cc.

◆ getNumCols()

virtual size_t X86Vga::getNumCols ( )
inlinevirtual
Returns
The number of columns in the current mode.

Implements Vga.

Definition at line 46 of file kernel/machine/mach_pc/Vga.h.

◆ getNumRows()

virtual size_t X86Vga::getNumRows ( )
inlinevirtual
Returns
The number of rows in the current mode.

Implements Vga.

Definition at line 53 of file kernel/machine/mach_pc/Vga.h.

◆ initialise()

bool X86Vga::initialise ( )

Definition at line 100 of file mach_pc/Vga.cc.

◆ moveCursor()

void X86Vga::moveCursor ( size_t  nX,
size_t  nY 
)
virtual

Moves the cursor to the position specified by the parameters.

Parameters
nXThe column to move to.
nYThe row to move to.

Implements Vga.

Definition at line 57 of file mach_pc/Vga.cc.

References Framebuffer::redraw().

◆ operator uint16_t *()

X86Vga::operator uint16_t * ( ) const
inlinevirtual

Implements Vga.

Definition at line 91 of file kernel/machine/mach_pc/Vga.h.

◆ peekBuffer()

void X86Vga::peekBuffer ( uint8_t *  pBuffer,
size_t  nBufLen 
)
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).

Parameters
pBufferA pointer to the buffer.
nBufLenThe length of pBuffer.

Implements Vga.

Definition at line 48 of file mach_pc/Vga.cc.

◆ pokeBuffer()

void X86Vga::pokeBuffer ( uint8_t *  pBuffer,
size_t  nBufLen 
)
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).

Parameters
pBufferA pointer to the buffer to swap into video memory.
nBufLenThe length of pBuffer.

Implements Vga.

Definition at line 38 of file mach_pc/Vga.cc.

◆ setFramebuffer()

bool X86Vga::setFramebuffer ( Framebuffer *  framebuffer)
overridevirtual

Reimplemented from Vga.

Definition at line 74 of file mach_pc/Vga.cc.

◆ setLargestTextMode()

bool X86Vga::setLargestTextMode ( )
virtual

Sets the largest possible text mode.

Returns
True on success, false on failure.

Implements Vga.

Definition at line 32 of file mach_pc/Vga.cc.

Member Data Documentation

◆ m_Console

FramebufferConsole X86Vga::m_Console
private

Definition at line 101 of file kernel/machine/mach_pc/Vga.h.

◆ m_ConsoleLock

Spinlock X86Vga::m_ConsoleLock {false, true}
private

Definition at line 100 of file kernel/machine/mach_pc/Vga.h.

◆ m_Framebuffer

MemoryMappedIo X86Vga::m_Framebuffer
private

Definition at line 99 of file kernel/machine/mach_pc/Vga.h.

◆ m_pConsoleFramebuffer

Framebuffer* X86Vga::m_pConsoleFramebuffer = nullptr
private

Definition at line 102 of file kernel/machine/mach_pc/Vga.h.


The documentation for this class was generated from the following files: