The Pedigree Project  0.1
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
VirtualTerminalManager Class Reference
+ Collaboration diagram for VirtualTerminalManager:

Classes

struct  VirtualTerminal
 

Public Types

enum  SwitchPermission { Allowed, Disallowed }
 
enum  SystemMode { Text, Graphics }
 

Public Member Functions

 VirtualTerminalManager (DevFsDirectory *parentDir)
 
bool initialise ()
 
void activate (size_t n)
 Starts the process of activating the given tty. More...
 
void reportPermission (SwitchPermission perm)
 
size_t openInactive ()
 
void lockSwitching (bool locked)
 
size_t getCurrentTerminalNumber () const
 
TextIOgetCurrentTerminal () const
 
FilegetCurrentTerminalFile () const
 
struct vt_mode getTerminalMode (size_t n) const
 
void setTerminalMode (size_t n, struct vt_mode mode)
 
struct vt_stat getState () const
 
void setSystemMode (SystemMode mode)
 
SystemMode getSystemMode () const
 
void setInputMode (size_t n, TextIO::InputMode newMode)
 
TextIO::InputMode getInputMode (size_t n) const
 

Private Member Functions

void sendSignal (size_t n, bool acq)
 

Private Attributes

VirtualTerminal m_Terminals [MAX_VT]
 
TextIOm_pTty
 
TextIOm_pTtys [MAX_VT]
 
Filem_pTtyFiles [MAX_VT]
 
struct vt_mode m_Modes [MAX_VT]
 
size_t m_CurrentTty
 
size_t m_WantedTty
 
size_t m_NumTtys
 
DevFsDirectorym_ParentDir
 
bool m_bSwitchingLocked
 
SystemMode m_SystemMode
 

Detailed Description

Definition at line 32 of file VirtualTerminal.h.

Member Function Documentation

void VirtualTerminalManager::activate ( size_t  n)

Starts the process of activating the given tty.

If we are currently using a VT with VT_AUTO mode, this just directly switches over. However, if the current VT is in VT_PROCESS mode, this tracks the pending switchover and then signals the current VT. That owning process will respond with an ioctl that leads to a call to reportPermission() that may or may not block the transition.

Definition at line 113 of file VirtualTerminal.cc.

References ERROR, and NOTICE.

struct vt_mode VirtualTerminalManager::getTerminalMode ( size_t  n) const
Todo:
validate n

Definition at line 248 of file VirtualTerminal.cc.

References NOTICE.

void VirtualTerminalManager::lockSwitching ( bool  locked)

Lock switching altogether.

Definition at line 228 of file VirtualTerminal.cc.

size_t VirtualTerminalManager::openInactive ( )

Find an inactive VT and open it, returning its number.

Definition at line 186 of file VirtualTerminal.cc.

References File::getName(), TextIO::initialise(), NOTICE, WARNING, and TextIO::writeStr().

void VirtualTerminalManager::reportPermission ( SwitchPermission  perm)

Report permission to switch.

Definition at line 157 of file VirtualTerminal.cc.

References NOTICE.

void VirtualTerminalManager::setTerminalMode ( size_t  n,
struct vt_mode  mode 
)

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