FreeNOS
|
PS2 Keyboard device driver. More...
#include <Keyboard.h>
Public Member Functions | |
Keyboard (const u32 inode) | |
Constructor. More... | |
virtual FileSystem::Result | initialize () |
Initialize the device. More... | |
virtual FileSystem::Result | interrupt (const Size vector) |
Executed when a key state has changed. More... | |
virtual FileSystem::Result | read (IOBuffer &buffer, Size &size, const Size offset) |
Read a character from the keyboard. 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... | |
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 | write (IOBuffer &buffer, Size &size, const Size offset) |
Write bytes to the file. 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 | |
u8 | shiftState |
State of the shift key. More... | |
bool | pending |
Do we have a byte ready? More... | |
Arch::IO | m_io |
Port I/O object. More... | |
Static Private Attributes | |
static const char | keymap [0x3a][2] |
Keyboard map table. 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... | |
PS2 Keyboard device driver.
Definition at line 46 of file Keyboard.h.
Keyboard::Keyboard | ( | const u32 | inode | ) |
Constructor.
inode | Inode number |
Definition at line 45 of file Keyboard.cpp.
References Device::m_identifier.
|
virtual |
Initialize the device.
Reimplemented from Device.
Definition at line 52 of file Keyboard.cpp.
References FileSystem::Success.
|
virtual |
Executed when a key state has changed.
vector | Interrupt vector. |
Reimplemented from Device.
Definition at line 57 of file Keyboard.cpp.
References pending, and FileSystem::Success.
|
virtual |
Read a character from the keyboard.
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 Keyboard.cpp.
References EnableIRQ, keymap, m_io, pending, ProcessCtl(), PS2_IRQ, PS2_PORT, PS2_RELEASE, FileSystem::RetryAgain, SELF, shiftState, FileSystem::Success, and IOBuffer::write().
|
staticprivate |
Keyboard map table.
Temporary hardcoded keyboard map, from kb.c in SkelixOS.
Definition at line 92 of file Keyboard.h.
Referenced by read().
|
private |
|
private |
Do we have a byte ready?
Definition at line 102 of file Keyboard.h.
Referenced by interrupt(), and read().
|
private |
State of the shift key.
Non-zero if pressed, and ZERO otherwise.
Definition at line 99 of file Keyboard.h.
Referenced by read().