|
The Pedigree Project 0.1
|
#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 | |
| enum class | SyncStatus { Success , Unsupported , NoMemory , IoError } |
| 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. | |
| bool | setPtyLock (File *file, bool locked) |
| Set the UNIX 98 PTY slave lock associated with a master. | |
| bool | isPtySlaveLocked (File *file) |
| Returns whether a PTY slave is currently locked. | |
| 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 const 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) |
| File * | findRetained (const StringView &path, Directory::ChildLease &result, File *pStartNode=nullptr) |
| virtual bool | getUuid (String &uuid) const |
| virtual FileHandleStatus | encodeFileHandle (File &file, FileHandle &handle) |
| virtual FileHandleStatus | decodeFileHandle (const FileHandle &handle, RetainedFile &file) |
| virtual FileHandleStatus | fileHandleFsid (FileSystemId &id) |
| virtual SyncStatus | sync () |
| virtual SyncStatus | shutdown () |
| virtual QuotaStatus | quotaControl (const QuotaRequest &, QuotaResponse &, File *quotaFile=nullptr) |
| 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) |
| bool | remove (const StringView &path, File *pStartNode, File *expected) |
| bool | rename (const StringView &oldPath, File *oldStart, const StringView &newPath, File *newStart, bool noReplace=false) |
| Disk * | getDisk () |
| bool | isReadOnly () |
| virtual bool | isCaseSensitive () |
| bool | remove (File *parent, File *file) |
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 | removeNode (File *, const String &, File *) |
Protected Member Functions inherited from Filesystem | |
| virtual bool | createLink (File *parent, const String &filename, File *target) |
| virtual bool | renameNode (Directory *oldParent, const String &oldName, File *source, Directory *newParent, const String &newName, File *replaced) |
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 |
| DiskUse | m_DiskUse |
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.
| ConsoleManager::ConsoleManager | ( | ) |
Definition at line 59 of file Console.cc.
|
virtual |
Definition at line 71 of file Console.cc.
|
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.
| void ConsoleManager::flush | ( | File * | file | ) |
Definition at line 232 of file Console.cc.
| void ConsoleManager::getAttributes | ( | File * | file, |
| size_t * | flags | ||
| ) |
Definition at line 176 of file Console.cc.
Definition at line 81 of file Console.cc.
| ConsoleFile * ConsoleManager::getConsoleFile | ( | RequestQueue * | pBackend | ) |
Definition at line 93 of file Console.cc.
| void ConsoleManager::getControlChars | ( | File * | file, |
| void * | p | ||
| ) |
Definition at line 190 of file Console.cc.
Definition at line 234 of file Console.cc.
|
inlinevirtual |
|
inlinevirtual |
Returns a string identifying the volume label.
Implements Filesystem.
| int ConsoleManager::getWindowSize | ( | File * | file, |
| unsigned short * | rows, | ||
| unsigned short * | cols | ||
| ) |
Definition at line 197 of file Console.cc.
| bool ConsoleManager::hasDataAvailable | ( | File * | file | ) |
Definition at line 225 of file Console.cc.
|
inlinevirtual |
Populates this filesystem with data from the given Disk device.
Implements Filesystem.
|
static |
Definition at line 77 of file Console.cc.
| bool ConsoleManager::isConsole | ( | File * | file | ) |
Definition at line 154 of file Console.cc.
| bool ConsoleManager::isMasterConsole | ( | File * | file | ) |
Definition at line 160 of file Console.cc.
| bool ConsoleManager::isPtySlaveLocked | ( | File * | file | ) |
Returns whether a PTY slave is currently locked.
Definition at line 143 of file Console.cc.
| bool ConsoleManager::lockConsole | ( | File * | file | ) |
Acquire a console master in such a way that it cannot be opened by another process.
Definition at line 97 of file Console.cc.
References ConsoleMasterFile::bLocked, Process::getParent(), ProcessorBase::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 @i.
Definition at line 32 of file Console.cc.
References newConsole().
Referenced by newConsole().
Here is the caller graph for this function:
|
private |
Definition at line 36 of file Console.cc.
|
inlineprotectedvirtual |
Remove a backing node while the VFS holds the parent's namespace lock. A successful implementation must retire the parent's cached entry before returning and must recheck directory emptiness while holding the child's namespace lock.
Implements Filesystem.
| void ConsoleManager::setAttributes | ( | File * | file, |
| size_t | flags | ||
| ) |
Definition at line 168 of file Console.cc.
| void ConsoleManager::setControlChars | ( | File * | file, |
| void * | p | ||
| ) |
Definition at line 183 of file Console.cc.
| bool ConsoleManager::setPtyLock | ( | File * | file, |
| bool | locked | ||
| ) |
Set the UNIX 98 PTY slave lock associated with a master.
Definition at line 133 of file Console.cc.
References ConsoleMasterFile::bSlaveLocked.
| int ConsoleManager::setWindowSize | ( | File * | file, |
| unsigned short | rows, | ||
| unsigned short | cols | ||
| ) |
Definition at line 212 of file Console.cc.
| void ConsoleManager::unlockConsole | ( | File * | file | ) |
Release a console master locked as above.
Definition at line 116 of file Console.cc.
References ConsoleMasterFile::bLocked, Process::getParent(), ProcessorBase::information(), and ConsoleMasterFile::pLocker.
|
private |
|
staticprivate |