FreeNOS
|
Video Graphics Array (VGA) support. More...
#include <VGA.h>
Public Member Functions | |
VGA (const u32 inode, const Size width=80, const Size height=25) | |
Class constructor function. More... | |
virtual FileSystem::Result | initialize () |
Initialize the VGA device. More... | |
virtual FileSystem::Result | read (IOBuffer &buffer, Size &size, const Size offset) |
Read video memory. More... | |
virtual FileSystem::Result | write (IOBuffer &buffer, Size &size, const Size offset) |
Write video memory. More... | |
Public Member Functions inherited from Device | |
Device (const u32 inode, const FileSystem::FileType type) | |
Constructor. More... | |
virtual | ~Device () |
Destructor. More... | |
virtual const String & | getIdentifier () const |
Get unique device identifier. More... | |
virtual FileSystem::Result | interrupt (const Size vector) |
Called when an interrupt has been triggered for this device. More... | |
Public Member Functions inherited from File | |
File (const u32 inode, const FileSystem::FileType type=FileSystem::RegularFile, const UserID uid=ZERO, const GroupID gid=ZERO) | |
Constructor function. More... | |
virtual | ~File () |
Destructor function. More... | |
u32 | getInode () const |
Get inode number. More... | |
FileSystem::FileType | getType () const |
Retrieve our filetype. More... | |
virtual FileSystem::Result | status (FileSystem::FileStat &st) |
Retrieve file statistics. More... | |
virtual bool | canRead () const |
Check if the File has data ready for reading. More... | |
virtual bool | canWrite () const |
Check if the File can be written to. More... | |
Private Attributes | |
u16 * | vga |
VGA video memory address. More... | |
Size | width |
Number of characters horizontally. More... | |
Size | height |
Number of characters vertically. More... | |
Arch::IO | m_io |
Port I/O object. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Device | |
String | m_identifier |
Unique identifier for this Device. More... | |
Protected Attributes inherited from File | |
const u32 | m_inode |
Inode number. More... | |
const FileSystem::FileType | m_type |
Type of this file. More... | |
UserID | m_uid |
Owner of the file. More... | |
GroupID | m_gid |
Group of the file. More... | |
FileSystem::FileModes | m_access |
Access permissions. More... | |
Size | m_size |
Size of the file, in bytes. More... | |
Video Graphics Array (VGA) support.
This class implements a VGA driver. Applications may read and write from the /dev/vga0 device file to retrieve and modify the current screen. Currently the Terminal driver uses the /dev/vga device file to implement the system console in FreeNOS.
Class constructor function.
inode | Inode number |
width | Number of characters horizontally. |
height | Number of characters vertically. |
Definition at line 23 of file VGA.cpp.
References Device::m_identifier.
|
virtual |
Initialize the VGA device.
First this function maps the VGA video memory into our address space. It clears the screen and finally disables the VGA hardware cursor.
Reimplemented from Device.
Definition at line 33 of file VGA.cpp.
References Memory::Range::access, BLACK, height, LIGHTGREY, m_io, MapContiguous, PAGESIZE, Memory::Range::phys, Memory::Readable, SELF, Memory::Range::size, FileSystem::Success, Memory::User, vga, VGA_CHAR, VGA_IOADDR, VGA_IODATA, VGA_PADDR, Memory::Range::virt, VMCtl(), width, Memory::Writable, and ZERO.
|
virtual |
Read video memory.
buffer | Input/Output buffer to output bytes to. |
size | Maximum number of bytes to read on input. On output, the actual number of bytes read. |
offset | Offset inside the file to start reading. |
Reimplemented from File.
Definition at line 63 of file VGA.cpp.
References height, FileSystem::InvalidArgument, FileSystem::Success, vga, width, and IOBuffer::write().
|
virtual |
Write video memory.
buffer | Input/Output buffer to input bytes from. |
size | Maximum number of bytes to write on input. On output, the actual number of bytes written. |
offset | Offset inside the file to start writing. |
Reimplemented from File.
Definition at line 76 of file VGA.cpp.
References MemoryBlock::copy(), IOBuffer::getBuffer(), height, FileSystem::InvalidArgument, FileSystem::Success, vga, and width.
|
private |
|
private |
|
private |
|
private |