FreeNOS
Public Member Functions | Private Member Functions | Private Attributes
BootImageStorage Class Reference

Uses a BootImage as a storage provider. More...

#include <BootImageStorage.h>

Inheritance diagram for BootImageStorage:
Storage

Public Member Functions

 BootImageStorage (const BootImage *image=ZERO)
 Constructor function. More...
 
const BootImage bootImage () const
 Get BootImage header. 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 boot image. 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 BootImageload () const
 Loads the BootImage into virtual memory. More...
 

Private Attributes

const BootImagem_image
 Pointer to the BootImage. More...
 

Detailed Description

Uses a BootImage as a storage provider.

Definition at line 38 of file BootImageStorage.h.

Constructor & Destructor Documentation

◆ BootImageStorage()

BootImageStorage::BootImageStorage ( const BootImage image = ZERO)

Constructor function.

Parameters
imagePointer to mapped BootImage or ZERO to map via kernel

Definition at line 22 of file BootImageStorage.cpp.

Member Function Documentation

◆ bootImage()

const BootImage BootImageStorage::bootImage ( ) const

◆ capacity()

u64 BootImageStorage::capacity ( ) const
virtual

Retrieve maximum storage capacity.

Returns
Storage capacity.

Implements Storage.

Definition at line 63 of file BootImageStorage.cpp.

References BootImage::bootImageSize, and m_image.

◆ initialize()

FileSystem::Result BootImageStorage::initialize ( )
virtual

◆ load()

const BootImage * BootImageStorage::load ( ) const
private

◆ read()

FileSystem::Result BootImageStorage::read ( const u64  offset,
void *  buffer,
const Size  size 
) const
virtual

Reads data from the boot image.

Parameters
offsetOffset to start reading from.
bufferOutput buffer.
sizeNumber of bytes to copied.
Returns
Result code

Implements Storage.

Definition at line 56 of file BootImageStorage.cpp.

References MemoryBlock::copy(), m_image, and FileSystem::Success.

Referenced by bootImage(), Kernel::loadBootImage(), Kernel::loadBootProgram(), BootSymbolStorage::loadSegment(), BootSymbolStorage::loadSymbol(), and BootSymbolStorage::read().

Field Documentation

◆ m_image

const BootImage* BootImageStorage::m_image
private

Pointer to the BootImage.

Definition at line 93 of file BootImageStorage.h.

Referenced by capacity(), initialize(), and read().


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