The Pedigree Project
0.1
|
#include <Console.h>
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 | |
File * | getConsole (String consoleName) |
ConsoleFile * | getConsoleFile (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) |
File * | getOther (File *file) |
virtual bool | initialise (Disk *pDisk) |
virtual File * | getRoot () const |
virtual String | getVolumeLabel () const |
Public Member Functions inherited from Filesystem | |
Filesystem () | |
virtual | ~Filesystem () |
virtual File * | find (const StringView &path) |
virtual File * | find (const String &path) |
virtual File * | find (const StringView &path, File *pStartNode) |
virtual File * | find (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) |
Disk * | getDisk () |
bool | isReadOnly () |
virtual bool | isCaseSensitive () |
Static Public Member Functions | |
static ConsoleManager & | instance () |
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 |
Disk * | m_pDisk |
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.
|
inlineprotectedvirtual |
createDirectory calls this after it has parsed the string path.
Implements Filesystem.
|
inlineprotectedvirtual |
createFile calls this after it has parsed the string path.
Implements Filesystem.
|
inlineprotectedvirtual |
createSymlink calls this after it has parsed the string path.
Implements Filesystem.
|
inlinevirtual |
|
inlinevirtual |
Returns a string identifying the volume label.
Implements Filesystem.
|
inlinevirtual |
Populates this filesystem with data from the given Disk device.
Implements Filesystem.
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().
Remove a file given a parent and file, assuming path parsing already completed.
Implements Filesystem.