FreeNOS
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Attributes
BootImageCreate Class Reference

Create system boot image. More...

#include <BootImageCreate.h>

Inheritance diagram for BootImageCreate:
Application

Public Member Functions

 BootImageCreate (int argc, char **argv)
 Constructor. More...
 
virtual ~BootImageCreate ()
 Destructor. More...
 
virtual Result exec ()
 Execute the application. More...
 
- Public Member Functions inherited from Application
 Application (int argc, char **argv)
 Class constructor. More...
 
virtual ~Application ()
 Class destructor. More...
 
virtual int run ()
 Run the application. More...
 

Protected Member Functions

virtual Result output (const char *string) const
 Print text to output. More...
 
- Protected Member Functions inherited from Application
virtual Result initialize ()
 Initialize the application. More...
 
virtual Result output (String &string) const
 Print string to output. More...
 
ArgumentParserparser ()
 Get program arguments parser. More...
 
const ArgumentParserparser () const
 Get constant program arguments parser. More...
 
const ArgumentContainerarguments () const
 Get program arguments. More...
 
void setVersion (const String &version)
 Set program version. More...
 

Private Member Functions

Size readBootSymbols (const char *file, const char *prefix, Vector< BootEntry * > *entries)
 Read boot symbols using a configuration file. More...
 

Static Private Attributes

static const Size PageSize = 4096U
 Size of memory pages as supported by this program. More...
 

Additional Inherited Members

- Public Types inherited from Application
enum  Result {
  Success, NotFound, IOError, InvalidArgument,
  ShowUsage, TimedOut, OutOfMemory
}
 Result codes. More...
 
- Protected Attributes inherited from Application
int m_argc
 Input argument count. More...
 
char ** m_argv
 Input argument values. More...
 

Detailed Description

Create system boot image.

Definition at line 55 of file BootImageCreate.h.

Constructor & Destructor Documentation

◆ BootImageCreate()

BootImageCreate::BootImageCreate ( int  argc,
char **  argv 
)

◆ ~BootImageCreate()

BootImageCreate::~BootImageCreate ( )
virtual

Destructor.

Definition at line 38 of file BootImageCreate.cpp.

Member Function Documentation

◆ exec()

BootImageCreate::Result BootImageCreate::exec ( )
virtual

◆ output()

BootImageCreate::Result BootImageCreate::output ( const char *  string) const
protectedvirtual

Print text to output.

Parameters
stringText to print to program output.
Returns
Result code.

Implements Application.

Definition at line 42 of file BootImageCreate.cpp.

References printf(), and Application::Success.

◆ readBootSymbols()

Size BootImageCreate::readBootSymbols ( const char *  file,
const char *  prefix,
Vector< BootEntry * > *  entries 
)
private

Read boot symbols using a configuration file.

Parameters
fileName of the boot configuration file.
prefixPrefix each entry from the config file with the given path or NULL
entriesPointer to Vector with BootEntry's
Returns
Number of bytes read

Definition at line 48 of file BootImageCreate.cpp.

References BootData, BOOTENTRY_MAX_REGIONS, BOOTIMAGE_NAMELEN, BootPrivProgram, BootProgram, entry, ExecutableFormat::entry(), errno, exit(), EXIT_FAILURE, fclose(), ExecutableFormat::find(), fopen(), fread(), Vector< T >::insert(), ArgumentParser::name(), NULL, Application::parser(), PATH_MAX, printf(), Memory::Readable, ExecutableFormat::regions(), snprintf(), stat::st_size, stat(), strerror(), strlen(), strncmp(), strncpy(), ExecutableFormat::Success, Memory::User, and Memory::Writable.

Referenced by exec().

Field Documentation

◆ PageSize

const Size BootImageCreate::PageSize = 4096U
staticprivate

Size of memory pages as supported by this program.

Definition at line 60 of file BootImageCreate.h.

Referenced by exec().


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