The Pedigree Project  0.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ConsoleManager Class Reference

#include <Console.h>

+ Inheritance diagram for ConsoleManager:
+ Collaboration diagram for ConsoleManager:

Public Types

enum  IAttribute { IMapCRToNL = 1, IIgnoreCR = 2, IMapNLToCR = 4, IStripToSevenBits = 8 }
 
enum  OAttribute {
  OPostProcess = 16, OMapCRToNL = 32, ONoCrAtCol0 = 64, OMapNLToCRNL = 128,
  ONLCausesCR = 256
}
 
enum  LAttribute {
  LEcho = 512, LEchoErase = 1024, LEchoKill = 2048, LEchoNewline = 4096,
  LCookedMode = 8192, LGenerateEvent = 16384
}
 
- Public Types inherited from Filesystem
typedef Filesystem *(* ProbeCallback) (Disk *)
 

Public Member Functions

FilegetConsole (String consoleName)
 
ConsoleFilegetConsoleFile (RequestQueue *pBackend)
 
bool lockConsole (File *file)
 
void unlockConsole (File *file)
 Release a console master locked as above.
 
void newConsole (char c, size_t i)
 
bool isConsole (File *file)
 
bool isMasterConsole (File *file)
 
void setAttributes (File *file, size_t flags)
 
void getAttributes (File *file, size_t *flags)
 
void getControlChars (File *file, void *p)
 
void setControlChars (File *file, void *p)
 
int getWindowSize (File *file, unsigned short *rows, unsigned short *cols)
 
int setWindowSize (File *file, unsigned short rows, unsigned short cols)
 
bool hasDataAvailable (File *file)
 
void flush (File *file)
 
FilegetOther (File *file)
 
virtual bool initialise (Disk *pDisk)
 
virtual FilegetRoot () const
 
virtual String getVolumeLabel () const
 
- Public Member Functions inherited from Filesystem
 Filesystem ()
 
virtual ~Filesystem ()
 
virtual Filefind (const StringView &path)
 
virtual Filefind (const String &path)
 
virtual Filefind (const StringView &path, File *pStartNode)
 
virtual Filefind (const String &path, File *pStartNode)
 
bool createFile (const StringView &path, uint32_t mask, File *pStartNode=0)
 
bool createDirectory (const StringView &path, uint32_t mask, File *pStartNode=0)
 
bool createSymlink (const StringView &path, const String &value, File *pStartNode=0)
 
bool createLink (const StringView &path, File *target, File *pStartNode=0)
 
bool remove (const StringView &path, File *pStartNode=0)
 
DiskgetDisk ()
 
bool isReadOnly ()
 
virtual bool isCaseSensitive ()
 

Static Public Member Functions

static ConsoleManagerinstance ()
 

Protected Member Functions

virtual bool createFile (File *parent, const String &filename, uint32_t mask)
 
virtual bool createDirectory (File *parent, const String &filename, uint32_t mask)
 
virtual bool createSymlink (File *parent, const String &filename, const String &value)
 
virtual bool remove (File *parent, File *file)
 
- Protected Member Functions inherited from Filesystem
virtual bool createLink (File *parent, const String &filename, File *target)
 

Private Member Functions

void newConsole (char c, size_t i, bool lock)
 

Private Attributes

Vector< ConsoleFile * > m_Consoles
 
Spinlock m_Lock
 

Static Private Attributes

static ConsoleManager m_Instance
 

Additional Inherited Members

- Protected Attributes inherited from Filesystem
bool m_bReadOnly
 
Diskm_pDisk
 

Detailed Description

This class provides a way for consoles (TTYs) to be created to interact with applications.

registerConsole is called by a class that subclasses RequestQueue. getConsole returns a File that forwards any read/write requests straight to that RequestQueue backend.

read: request with p1: CONSOLE_READ, p2: param, p3: requested size, p4: buffer. write: request with p1: CONSOLE_WRITE, p2: param, p3: size of buffer, p4: buffer.

Definition at line 316 of file Console.h.

Member Function Documentation

virtual bool ConsoleManager::createDirectory ( File parent,
const String filename,
uint32_t  mask 
)
inlineprotectedvirtual

createDirectory calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 404 of file Console.h.

virtual bool ConsoleManager::createFile ( File parent,
const String filename,
uint32_t  mask 
)
inlineprotectedvirtual

createFile calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 399 of file Console.h.

virtual bool ConsoleManager::createSymlink ( File parent,
const String filename,
const String value 
)
inlineprotectedvirtual

createSymlink calls this after it has parsed the string path.

Implements Filesystem.

Definition at line 409 of file Console.h.

virtual File* ConsoleManager::getRoot ( ) const
inlinevirtual

Returns the root filesystem node.

Implements Filesystem.

Definition at line 389 of file Console.h.

virtual String ConsoleManager::getVolumeLabel ( ) const
inlinevirtual

Returns a string identifying the volume label.

Implements Filesystem.

Definition at line 393 of file Console.h.

virtual bool ConsoleManager::initialise ( Disk pDisk)
inlinevirtual

Populates this filesystem with data from the given Disk device.

Returns
true on success, false on failure.

Implements Filesystem.

Definition at line 385 of file Console.h.

bool ConsoleManager::lockConsole ( File file)

Acquire a console master in such a way that it cannot be opened by another process.

Definition at line 111 of file Console.cc.

References ConsoleMasterFile::bLocked, Processor::information(), and ConsoleMasterFile::pLocker.

void ConsoleManager::newConsole ( char  c,
size_t  i 
)

Create a new console - /dev/ptyXY -> /dev/ttyXY, where X is and Y is .

Definition at line 31 of file Console.cc.

References Vector< T >::count(), and Vector< T >::pushBack().

virtual bool ConsoleManager::remove ( File parent,
File file 
)
inlineprotectedvirtual

Remove a file given a parent and file, assuming path parsing already completed.

Implements Filesystem.

Definition at line 413 of file Console.h.


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