2
2
3
3
Important features of Embox are: ** modularity** and ** configurability** .
4
4
5
- A modularity is splitting project into small logical parts that is modules.
5
+ A ** modularity** is splitting project into small logical parts that is modules.
6
6
7
7
And ** configurability** is ability to determinate the characteristics of the end system,
8
8
based on list of modules and their parameters.
@@ -28,13 +28,14 @@ The example of package naming:
28
28
### Interfaces and abstract modules
29
29
Interfaces for modules are direct analogues of abstract classes and interfaces in OOP.
30
30
31
- Module description language supports ** interface** that allows to to introduce the ** interface** concept (modules without implementation)
32
- and ** abstract modules** (modules with partial implementation).
31
+ ** Module description language** supports ** interface** that allows to to introduce the next points:
33
32
34
- This method allows you to choose from the list of modules (that implement the same interface, but have different algorithm) the needed one.
33
+ * the ** interface** concept (modules without implementation)
34
+ * ** abstract modules** (modules with partial implementation)
35
35
36
- To mark a module as inherited, you need to use ` abstract ` keyword .
36
+ This method allows you to choose from the list of modules (that implement the same interface, but have different algorithms) the needed one .
37
37
38
+ To mark a module as inherited, you need to use the ` abstract ` keyword.
38
39
The example of module declaration:
39
40
``` java
40
41
package embox.arch
@@ -43,7 +44,6 @@ The example of module declaration:
43
44
// ...
44
45
```
45
46
To point at inheritance, we use ` extends ` keyword.
46
-
47
47
The instance of inheritance from the abstract module:
48
48
``` java
49
49
module interrupt_stub extends embox. arch. interrupt {
@@ -59,29 +59,30 @@ Description of every module consists of several possible attributes:
59
59
60
60
#### Files of source code
61
61
A module can point at list of file, which you need to compile and to add in a final image.
62
- Except "ordinary" files in C and assembler, it's possible to include header files and additional linker scripts.
63
62
64
- Types of files differ according to file extension: ` .c/.S ` , ` .h ` , ` .lds.S ` .
63
+ Except ** "ordinary" files** in C and assembler, it's possible to include ** header files** and ** additional linker scripts** .
64
+
65
+ ** Types of files differ according to file extension: ".c/.S", ".h", ".lds.S".**
65
66
66
- ** .c/.S** is a source code, written in C or assembler. In the assembly process it's compelled and included in final image of system.
67
+ ** " .c/.S" ** is a ** source code** , written in C or assembler. In the assembly process it's compelled and included in final image of system.
67
68
During the compilation it's possible to get values of options of module that connected with files of source code.
68
69
69
- ** .h ** is a header file containing the definitions, needed for implementation of interface.
70
+ ** ".h" ** is a ** header file** containing the definitions, needed for implementation of interface.
70
71
During the building of module the special header file is generated. It has all listed .h-files of this module.
71
72
72
73
It allows you to use different implementations of some interface without changing the source code of the modules that use it.
73
74
Such way of abstraction is necessary, because different implementations can define one or the other structure in different ways
74
75
while this structure can be used by other modules without knowledge about details of implementation.
75
76
76
- ** .lds.S** are linker scripts that allow you to affect on loading the modules in final image. The typical using is an addition of new sections.
77
+ ** " .lds.S" ** are ** linker scripts** that allow you to affect on loading the modules in final image. The typical using is an addition of new sections.
77
78
78
- The example of adding the ** .h-file** to the module:
79
+ The example of adding the ** " .h-file" ** to the module:
79
80
``` java
80
81
module interrupt_stub extends embox. arch. interrupt {
81
82
source " interrupt_stub.h"
82
83
}
83
84
```
84
- The instance of adding the ** .lds.S-file** and ** .c-file** to the module:
85
+ The instance of adding the ** " .lds.S-file" ** and ** " .c-file" ** to the module:
85
86
``` java
86
87
module static_heap extends heap_place {
87
88
// ...
@@ -94,18 +95,16 @@ The instance of adding the **.lds.S-file** and **.c-file** to the module:
94
95
95
96
#### Options
96
97
** The characteristics of options:**
97
-
98
98
* allow you to define numerical, boolean and string parameters at the configuration stage
99
- * their parameters can affect how the module is assembled, initialized and how it works
100
99
* can have default value, if the value doesn't exist -- ad it to your configuration
101
100
102
101
Options allow you to define ** numerical** , ** boolean** and ** string parameters** at the configuration stage.
103
- These parameters can affect how the module is assembled, initialized and how it works.
102
+
103
+ These ** parameters can affect how the module is assembled, initialized** and ** how it works** .
104
104
105
105
To define a type of some options, it's needed to write it after the ` option ` keyword.
106
106
107
107
To get a value of some option during the compilation of source code, it's used the next ** special macros** :
108
-
109
108
* ** OPTION_STRING_GET** is for string options
110
109
* ** OPTION_NUMBER_GET** is for numerical options
111
110
* ** OPTION_BOOLEAN_GET** is for boolean options
@@ -114,24 +113,24 @@ The argument of macro is option name defined in **my-file**.
114
113
#### Dependencies
115
114
** Dependencies** are the way to show to the assembly system that the correct module working is impossible without other ones.
116
115
117
- The list of dependencies can include some interfaces. It means that only one module implemented required interface can be included in a building.
116
+ The ** list of dependencies** can include some interfaces.
117
+ It means that only one module implemented required interface can be included in a building.
118
118
119
- Use the ` depends ` attribute to define dependencies between modules.
119
+ Use the ** " depends" ** attribute to define dependencies between modules.
120
120
You can count modules and interfaces in value of this attribute.
121
121
122
122
Assembly system guarantees that the dependencies of specific module will be added when this module is included in the system.
123
- We use of the interface implementations in case when dependencies have interface.
124
123
125
- In some cases you just need to add a module what you need without changing the loading order.
126
- This method is used for such global modules as, for example: ** multiprocessing support** , ** logging** , ** debug statement (assert)** .
124
+ In some cases you just need ** to add a module** what you need ** without changing the loading order** .
125
+ This method is used for such global modules as, ** for example** : ** "multiprocessing support"** , ** "logging"** , ** "debug statement" (assert)** .
126
+
127
+ Due to the fact that these ** modules don't have a status** in the usual sence (such as ** "loaded"** or ** "unloaded"** ),
128
+ it's required to add the *** @NoRuntime *** annotation to the ** "depends"** attribute.
127
129
128
- Due to the fact that these modules don't have a status in the usual sence (such as "loaded" or "unloaded"),
129
- it's required to add the * @NoRuntime * annotation to the ** depends** attribute.
130
130
In this case, the dependencies will be used during the building , but won't determine module loading order.
131
131
132
132
### Annotations
133
133
** The characteristics of annotations:**
134
-
135
134
* are used for changing the semantics of description elements
136
135
* allow to extend description language without changing the grammar
137
136
* make description language more flexible
@@ -144,17 +143,17 @@ The instance of implementation the abstract module with help of the annotation:
144
143
145
144
## Configuration description
146
145
** Module description** is used to create a target image.
146
+
147
147
During the configuration the assembly system allows to merge modules of system (e. g. kernel modules, drivers, tests, applications)
148
148
and to install parameters for these, and also to define additional parameters to create an image for different hardware platforms.
149
149
150
150
### The structure of configuration
151
- Image configuration is running through file editing in the ** conf/** directory.
151
+ Image configuration is running through file editing in the ** " conf/" ** directory.
152
152
It contains the following:
153
-
154
- * ** lds.conf** -- contains the definition of memory card, which is used by specific hardware platforms
155
- * ** mods.conf** -- contains names and options of modules, which will be included in OS image.
153
+ * ** "lds.conf"** -- contains the definition of memory card, which is used by specific hardware platforms
154
+ * ** "mods.conf"** -- contains names and options of modules, which will be included in OS image.
156
155
Also you can set every modules in this file to new values
157
- * ** rootfs** -- contains files, which will be included into the file system
156
+ * ** " rootfs" ** -- contains files, which will be included into the file system
158
157
159
158
### Configuration process
160
159
To use some module in OS image means to add it into some OS configuration.
@@ -169,7 +168,7 @@ For example, to get a basic configuration to support x86 platform, use the next
169
168
```
170
169
make confload-x86/qemu
171
170
```
172
- This command loads basic "qemu" configuration for x86 platform in the ** conf/** directory.
171
+ This command loads basic "qemu" configuration for x86 platform in the ** " conf/" ** directory.
173
172
174
173
The list of basic configurations you can see and choose the needed one, type:
175
174
```
0 commit comments