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

#include <Keyboard.h>

+ Inheritance diagram for VirtKeyboard:
+ Collaboration diagram for VirtKeyboard:

Public Member Functions

 VirtKeyboard (VirtSerial &serial)
 
void initialise () override
 
void setDebugState (bool enabled) override
 
bool getDebugState () override
 
char getChar () override
 
char getCharNonBlock () override
 
- Public Member Functions inherited from Keyboard
virtual char getLedState ()
 
virtual void setLedState (char state)
 

Private Attributes

VirtSerial & m_Serial
 
bool m_DebugState
 

Additional Inherited Members

- Public Types inherited from Keyboard
enum  KeyFlags {
  Special = 1ULL << 63 , Ctrl = 1ULL << 62 , Shift = 1ULL << 61 , Alt = 1ULL << 60 ,
  AltGr = 1ULL << 59
}
 
enum  KeyboardLeds {
  ScrollLock = 1 << 0 , NumLock = 1 << 1 , CapsLock = 1 << 2 , Led1 = 1 << 3 ,
  Led2 = 1 << 4 , Led3 = 1 << 5 , Led4 = 1 << 6 , Led5 = 1 << 7
}
 Bit numbers follow the same format as the PS/2 keyboard LED byte. More...
 

Detailed Description

Serial console input for the kernel debugger.

Definition at line 16 of file kernel/machine/mach_virt/Keyboard.h.

Constructor & Destructor Documentation

◆ VirtKeyboard()

VirtKeyboard::VirtKeyboard ( VirtSerial &  serial)
explicit

Definition at line 12 of file mach_virt/Keyboard.cc.

Member Function Documentation

◆ getChar()

char VirtKeyboard::getChar ( )
overridevirtual

Retrieves a character from the keyboard. Blocking I/O. If DebugState is false this returns zero. If DebugState is true this returns the next character received, or zero if the character is non-ASCII.

Implements Keyboard.

Definition at line 24 of file mach_virt/Keyboard.cc.

◆ getCharNonBlock()

char VirtKeyboard::getCharNonBlock ( )
overridevirtual

Retrieves a character from the keyboard. Non blocking I/O. If DebugState is false this returns zero. If DebugState is true this returns the next character received, or zero if the character is non-ASCII.

Implements Keyboard.

Definition at line 28 of file mach_virt/Keyboard.cc.

◆ getDebugState()

bool VirtKeyboard::getDebugState ( )
overridevirtual

Implements Keyboard.

Definition at line 20 of file mach_virt/Keyboard.cc.

◆ initialise()

void VirtKeyboard::initialise ( )
overridevirtual

Initialises the device.

Implements Keyboard.

Definition at line 14 of file mach_virt/Keyboard.cc.

Referenced by VirtMachine::initialise().

+ Here is the caller graph for this function:

◆ setDebugState()

void VirtKeyboard::setDebugState ( bool  enableDebugState)
overridevirtual

Selects polling input while the kernel debugger owns the processor.

A debugger trap can interrupt code which owns arbitrary device or IRQ controller locks. Both this setter and getDebugState() must therefore access this mode without taking locks, waiting, allocating, logging, changing interrupt masks, or starting a device protocol. The debugger trap itself prevents ordinary interrupt delivery while this mode is active.

Implements Keyboard.

Definition at line 16 of file mach_virt/Keyboard.cc.

Member Data Documentation

◆ m_DebugState

bool VirtKeyboard::m_DebugState
private

Definition at line 27 of file kernel/machine/mach_virt/Keyboard.h.

◆ m_Serial

VirtSerial& VirtKeyboard::m_Serial
private

Definition at line 26 of file kernel/machine/mach_virt/Keyboard.h.


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