FreeNOS
BootImage.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 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 __LIBARCH_BOOTIMAGE_H
19#define __LIBARCH_BOOTIMAGE_H
20
30#define BOOTIMAGE_MAGIC0 ('F') + ('r' << 8) + ('e' << 16) + ('e' << 24)
31
33#define BOOTIMAGE_MAGIC1 ('N') + ('O' << 8) + ('S' << 16) + (0x1 << 24)
34
36#define BOOTIMAGE_REVISION 2
37
39#define BOOTIMAGE_NAMELEN 32
40
68
80
105
109typedef struct BootSegment
110{
113
116
119}
121
127#endif /* __LIBARCH_BOOTIMAGE_H */
#define BOOTIMAGE_NAMELEN
Maximum length of BootSymbol names.
Definition BootImage.h:39
BootSymbolType
Boot symbol types.
Definition BootImage.h:73
@ BootFilesystem
Embedded filesystem.
Definition BootImage.h:76
@ BootProgram
Executable program.
Definition BootImage.h:74
@ BootPrivProgram
Privileged executable program.
Definition BootImage.h:75
@ BootData
Binary data.
Definition BootImage.h:77
unsigned int u32
Unsigned 32-bit number.
Definition Types.h:53
unsigned short u16
Unsigned 16-bit number.
Definition Types.h:56
unsigned char u8
Unsigned 8-bit number.
Definition Types.h:59
BootImage contains executable programs to be loaded at system bootup.
Definition BootImage.h:45
u32 magic[2]
Magic numbers to detect a valid boot image.
Definition BootImage.h:47
u16 symbolTableCount
Number of entries in the symbols table.
Definition BootImage.h:59
u32 segmentsTableOffset
Offset of the segments table.
Definition BootImage.h:62
u16 segmentsTableCount
Number of entries in the segments table.
Definition BootImage.h:65
u32 symbolTableOffset
Offset of the symbol table.
Definition BootImage.h:56
u8 layoutRevision
Version of the boot image layout.
Definition BootImage.h:50
u32 bootImageSize
Total size of the boot image in bytes.
Definition BootImage.h:53
Memory segment.
Definition BootImage.h:110
u32 size
Total size of the segment.
Definition BootImage.h:115
u32 virtualAddress
Virtual memory address to load the segment.
Definition BootImage.h:112
u32 offset
Offset in the boot image of the segment contents.
Definition BootImage.h:118
Program embedded in the BootImage.
Definition BootImage.h:85
u32 segmentsTotalSize
Total size of the BootSymbol segments.
Definition BootImage.h:102
u16 segmentsCount
Number of contiguous entries in the segment table.
Definition BootImage.h:99
u32 entry
Program entry point (only valid for BootProgram symbols).
Definition BootImage.h:93
u32 segmentsOffset
Offset in the segments table.
Definition BootImage.h:96
BootSymbolType type
Type of boot symbol.
Definition BootImage.h:90
char name[BOOTIMAGE_NAMELEN]
Name of the boot symbol.
Definition BootImage.h:87