FreeNOS
BootImageCreate.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2009 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __BIN_IMG_BOOTIMAGECREATE_H
19#define __BIN_IMG_BOOTIMAGECREATE_H
20
21#include <Application.h>
22#include <ExecutableFormat.h>
23#include <BootImage.h>
24
31#define BOOTENTRY_MAX_REGIONS 16
32
51
56{
57 private:
58
60 static const Size PageSize = 4096U;
61
62 public:
63
70 BootImageCreate(int argc, char **argv);
71
75 virtual ~BootImageCreate();
76
82 virtual Result exec();
83
84 protected:
85
92 virtual Result output(const char *string) const;
93
94 private:
95
105 Size readBootSymbols(const char *file,
106 const char *prefix,
107 Vector<BootEntry *> *entries);
108};
109
114#endif /* __BIN_IMG_BOOTIMAGECREATE_H */
Generic application.
Definition Application.h:39
Result
Result codes.
Definition Application.h:54
Create system boot image.
Size readBootSymbols(const char *file, const char *prefix, Vector< BootEntry * > *entries)
Read boot symbols using a configuration file.
virtual Result exec()
Execute the application.
virtual Result output(const char *string) const
Print text to output.
virtual ~BootImageCreate()
Destructor.
static const Size PageSize
Size of memory pages as supported by this program.
Vectors are dynamically resizeable Arrays.
Definition Vector.h:42
#define BOOTENTRY_MAX_REGIONS
Maximum memory regions.
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
unsigned char u8
Unsigned 8-bit number.
Definition Types.h:59
Executable entry for use inside a boot image.
BootSymbol symbol
BootSymbol definition.
u8 * data
Input data buffer read from the original file.
ExecutableFormat::Region regions[BOOTENTRY_MAX_REGIONS]
Memory regions for this symbol.
Size numRegions
Number of memory regions.
Program embedded in the BootImage.
Definition BootImage.h:85