18#include <FreeNOS/User.h>
23 const char *symbolName)
24 : m_bootImage(bootImage)
25 , m_symbol(loadSymbol(symbolName))
26 , m_segment(loadSegment(m_symbol))
54 const String symbolName(name);
68 ERROR(
"failed to read BootSymbol: result = " << (
int) result);
101 ERROR(
"failed to read BootSegment: result = " << (
int) result);
Uses a BootImage as a storage provider.
const BootImage bootImage() const
Get BootImage header.
virtual FileSystem::Result read(const u64 offset, void *buffer, const Size size) const
Reads data from the boot image.
virtual FileSystem::Result initialize()
Initialize the Storage device.
BootSymbolStorage(const BootImageStorage &bootImage, const char *symbolName)
Constructor function.
virtual u64 capacity() const
Retrieve maximum storage capacity.
const BootSymbol m_symbol
BootSymbol value.
const BootSymbol loadSymbol(const char *name) const
Loads the BootSymbol from the BootImage.
const BootSegment m_segment
BootSegment value.
virtual FileSystem::Result read(const u64 offset, void *buffer, const Size size) const
Reads data from the BootSymbol.
const BootSegment loadSegment(const BootSymbol &symbol) const
Load the BootSegment for the given BootSymbol.
const BootImageStorage & m_bootImage
Read-only reference to the BootImage storage.
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
virtual bool equals(const String &str) const
Alias for compareTo().
#define ERROR(msg)
Output an error message.
unsigned int uint
Unsigned integer number.
unsigned int Size
Any sane size indicator cannot go negative.
unsigned long long u64
Unsigned 64-bit number.
Result
Result code for filesystem Actions.
BootImage contains executable programs to be loaded at system bootup.
u16 symbolTableCount
Number of entries in the symbols table.
u32 segmentsTableOffset
Offset of the segments table.
u32 symbolTableOffset
Offset of the symbol table.
u32 offset
Offset in the boot image of the segment contents.
Program embedded in the BootImage.
u32 segmentsTotalSize
Total size of the BootSymbol segments.
u32 segmentsOffset
Offset in the segments table.
char name[BOOTIMAGE_NAMELEN]
Name of the boot symbol.