|
FreeNOS
|
Abstract device class interface. More...
#include <Device.h>
Public Member Functions | |
| Device (const u32 inode, const FileSystem::FileType type) | |
| Constructor. More... | |
| virtual | ~Device () |
| Destructor. More... | |
| virtual const String & | getIdentifier () const |
| Get unique device identifier. More... | |
| virtual FileSystem::Result | initialize () |
| Initialize the device. More... | |
| virtual FileSystem::Result | interrupt (const Size vector) |
| Called when an interrupt has been triggered for this device. More... | |
Public Member Functions inherited from File | |
| File (const u32 inode, const FileSystem::FileType type=FileSystem::RegularFile, const UserID uid=ZERO, const GroupID gid=ZERO) | |
| Constructor function. More... | |
| virtual | ~File () |
| Destructor function. More... | |
| u32 | getInode () const |
| Get inode number. More... | |
| FileSystem::FileType | getType () const |
| Retrieve our filetype. More... | |
| virtual FileSystem::Result | read (IOBuffer &buffer, Size &size, const Size offset) |
| Read bytes from the file. More... | |
| virtual FileSystem::Result | write (IOBuffer &buffer, Size &size, const Size offset) |
| Write bytes to the file. More... | |
| virtual FileSystem::Result | status (FileSystem::FileStat &st) |
| Retrieve file statistics. More... | |
| virtual bool | canRead () const |
| Check if the File has data ready for reading. More... | |
| virtual bool | canWrite () const |
| Check if the File can be written to. More... | |
Protected Attributes | |
| String | m_identifier |
| Unique identifier for this Device. More... | |
Protected Attributes inherited from File | |
| const u32 | m_inode |
| Inode number. More... | |
| const FileSystem::FileType | m_type |
| Type of this file. More... | |
| UserID | m_uid |
| Owner of the file. More... | |
| GroupID | m_gid |
| Group of the file. More... | |
| FileSystem::FileModes | m_access |
| Access permissions. More... | |
| Size | m_size |
| Size of the file, in bytes. More... | |
| Device::Device | ( | const u32 | inode, |
| const FileSystem::FileType | type | ||
| ) |
Constructor.
| inode | Inode number for this Device |
| type | Type of file |
Definition at line 20 of file Device.cpp.
|
virtual |
Destructor.
Definition at line 26 of file Device.cpp.
|
virtual |
Get unique device identifier.
Definition at line 30 of file Device.cpp.
References m_identifier.
Referenced by DeviceServer::initialize().
|
virtual |
Initialize the device.
Reimplemented in ATAController, Sun8iEmac, Terminal, VGA, Time, NS16550, PL011, i8250, NetworkDevice, Keyboard, and Loopback.
Definition at line 35 of file Device.cpp.
References FileSystem::Success.
Referenced by NetworkDevice::initialize(), and DeviceServer::initialize().
|
virtual |
Called when an interrupt has been triggered for this device.
| vector | Vector number of the interrupt. |
Reimplemented in Sun8iEmac, ATAController, NS16550, PL011, i8250, and Keyboard.
Definition at line 40 of file Device.cpp.
References FileSystem::Success.
|
protected |
Unique identifier for this Device.
Definition at line 79 of file Device.h.
Referenced by ATAController::ATAController(), getIdentifier(), i8250::i8250(), Keyboard::Keyboard(), NS16550::NS16550(), PL011::PL011(), Terminal::Terminal(), Time::Time(), and VGA::VGA().
1.8.17