FreeNOS
|
Uses a BootSymbol inside a BootImage as a storage provider. More...
#include <BootSymbolStorage.h>
Public Member Functions | |
BootSymbolStorage (const BootImageStorage &bootImage, const char *symbolName) | |
Constructor function. More... | |
virtual FileSystem::Result | initialize () |
Initialize the Storage device. More... | |
virtual FileSystem::Result | read (const u64 offset, void *buffer, const Size size) const |
Reads data from the BootSymbol. More... | |
virtual u64 | capacity () const |
Retrieve maximum storage capacity. More... | |
Public Member Functions inherited from Storage | |
Storage () | |
Constructor function. More... | |
virtual | ~Storage () |
Destructor function. More... | |
virtual FileSystem::Result | write (const u64 offset, void *buffer, const Size size) |
Write a contiguous set of data. More... | |
Private Member Functions | |
const BootSymbol | loadSymbol (const char *name) const |
Loads the BootSymbol from the BootImage. More... | |
const BootSegment | loadSegment (const BootSymbol &symbol) const |
Load the BootSegment for the given BootSymbol. More... | |
Private Attributes | |
const BootImageStorage & | m_bootImage |
Read-only reference to the BootImage storage. More... | |
const BootSymbol | m_symbol |
BootSymbol value. More... | |
const BootSegment | m_segment |
BootSegment value. More... | |
Uses a BootSymbol inside a BootImage as a storage provider.
Definition at line 39 of file BootSymbolStorage.h.
BootSymbolStorage::BootSymbolStorage | ( | const BootImageStorage & | bootImage, |
const char * | symbolName | ||
) |
Constructor function.
bootImage | BootImageStorage to use for I/O. |
symbolName | Name of the BootSymbol entry to use. |
Definition at line 22 of file BootSymbolStorage.cpp.
|
virtual |
Retrieve maximum storage capacity.
Implements Storage.
Definition at line 47 of file BootSymbolStorage.cpp.
References m_symbol, and BootSymbol::segmentsTotalSize.
|
virtual |
Initialize the Storage device.
Implements Storage.
Definition at line 30 of file BootSymbolStorage.cpp.
References FileSystem::IOError, m_segment, m_symbol, BootSegment::offset, BootSymbol::segmentsTotalSize, and FileSystem::Success.
Referenced by main().
|
private |
Load the BootSegment for the given BootSymbol.
symbol | BootSymbol reference |
Definition at line 83 of file BootSymbolStorage.cpp.
References BootImageStorage::bootImage(), ERROR, m_bootImage, BootImageStorage::read(), BootSymbol::segmentsOffset, BootImage::segmentsTableOffset, BootSymbol::segmentsTotalSize, MemoryBlock::set(), and FileSystem::Success.
|
private |
Loads the BootSymbol from the BootImage.
Definition at line 52 of file BootSymbolStorage.cpp.
References BootImageStorage::bootImage(), String::equals(), ERROR, m_bootImage, BootSymbol::name, BootImageStorage::read(), MemoryBlock::set(), FileSystem::Success, BootImage::symbolTableCount, and BootImage::symbolTableOffset.
|
virtual |
Reads data from the BootSymbol.
offset | Offset to start reading from. |
buffer | Output buffer. |
size | Number of bytes to copied. |
Implements Storage.
Definition at line 42 of file BootSymbolStorage.cpp.
References m_bootImage, m_segment, BootSegment::offset, and BootImageStorage::read().
|
private |
Read-only reference to the BootImage storage.
Definition at line 98 of file BootSymbolStorage.h.
Referenced by loadSegment(), loadSymbol(), and read().
|
private |
BootSegment value.
Definition at line 104 of file BootSymbolStorage.h.
Referenced by initialize(), and read().
|
private |
BootSymbol value.
Definition at line 101 of file BootSymbolStorage.h.
Referenced by capacity(), and initialize().