You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
P.S.: If you have any problems with running Embox on Windows -- please check a correctness of the inserted commands.
61
59
If it's correct -- you can use the recommendations from the article(the link is below):
62
-
63
-
[How to solve problems with WSL](https://learn.microsoft.com/en-us/windows/wsl/troubleshooting)
64
-
65
-
60
+
```
61
+
[How to solve problems with WSL](https://learn.microsoft.com/en-us/windows/wsl/troubleshooting)
62
+
```
66
63
67
64
## Enviroment Settings
68
65
Minimal required packages: *make*, *gcc*, (cross-compiler for target platform. see "Cross-compiler installation").
69
-
Optional packages which are recomended to install at once: *build-essential*, *gcc-multilib*, *curl*, *libmpc-dev*, *python*.
66
+
Optional packages, which are recomended to install at once: *build-essential*, *gcc-multilib*, *curl*, *libmpc-dev*, *python*.
70
67
71
68
For Debian/Ubuntu:
72
69
```
@@ -96,16 +93,23 @@ or for Debian:
96
93
```
97
94
$ sudo apt install gcc-arm-none-eabi
98
95
```
99
-
You can also download the archive with ARM cross-tools from [https://launchpad.net/gcc-arm-embedded](https://launchpad.net/gcc-arm-embedded)
96
+
You can also download the archive with ARM cross-tools from [https://launchpad.net/gcc-arm-embedded](https://launchpad.net/gcc-arm-embedded).
100
97
Extract files from archive and set *PATH* enviroment variable:
101
98
```
102
99
$ export PATH=$PATH:<path to toolchain>/gcc-arm-none-eabi-<version>/bin
103
100
```
104
101
105
102
***SPARC, Microblaze, MIPS, PowerPC, MSP430***:
106
103
You can try to use some cross-compiler based on gcc in case if you already have a suitable one.
107
-
But it would be better if you will use our project for cross-compiler installation [https://github.com/embox/crosstool](https://github.com/embox/crosstool).
108
-
You can use already ready-to-use archives from [https://github.com/embox/crosstool/releases](https://github.com/embox/crosstool/releases). Or you can build cross-compiler with the script in the project's root folder:
104
+
But it would be better if you will use our project for cross-compiler installation:
If all unit tests passed successfully and all modules loaded, then command prompt will appear.
162
165
Now you can execute commands included in the configuration (`mods.conf`). You can start with ***help*** command which prints list of available commands.
163
166
164
167
Press ***ctrl+’A’*** and then `***x***` to exit from Qemu.
165
168
166
169
## Preliminaries to Mybuild build system
167
-
Embox is modular and configurable. Declarative program language Mybuild has been developed for these features. Mybuild allows to describe both single modules and whole target system.
170
+
Embox is modular and configurable. Declarative program language "Mybuild" has been developed for these features. Mybuild allows to describe both single modules and whole target system.
171
+
168
172
A module is a base concept for build system. A module description contains: source files list, options which can be set for the module during configuration, and dependences list.
173
+
169
174
The configuration is a particular description of the whole system. It contains list of required modules, modules options and build rules (cross-compiler, additional compiler flags, memory map etc.).
175
+
170
176
Graph of the system will be based on the configuration and modules descriptions.
171
-
Build system then generates different build artifacts: linker scripts, makefiles, headers.
177
+
Build system, that generates different build artifacts: linker scripts, makefiles, headers.
172
178
It's not necesary to include all modules, they will be enabled using dependencies for each module included in the initial configuration list.
173
179
174
180
Current configuration locates in ***conf/*** folder. It can be set up with:
@@ -179,8 +185,7 @@ For example, to set up demo configuration for qemu-arm you should do the followi
179
185
```
180
186
$ make confload-arm/qemu
181
187
```
182
-
183
-
Use
188
+
Use:
184
189
```
185
190
$ make confload
186
191
```
@@ -198,22 +203,18 @@ Source code of Embox application is usual POSIX program written in C, and so can
198
203
To add your own simplest application "Hello world" you can do the following:
199
204
200
205
* Create folder *hello_world* in *src/cmds*:
201
-
202
206
```
203
207
$ mkdir src/cmds/hello_world
204
208
```
205
209
* Create *src/cmds/hello_world/hello_world.c*:
206
-
207
210
```
208
211
#include <stdio.h>
209
212
210
213
int main(int argc, char **argv) {
211
214
printf("Hello, world!\n");
212
215
}
213
216
```
214
-
215
217
* Create file *src/cmds/hello_world/Mybuild* with your module description:
216
-
217
218
```
218
219
package embox.cmd
219
220
@@ -223,27 +224,19 @@ To add your own simplest application "Hello world" you can do the following:
223
224
source "hello_world.c"
224
225
}
225
226
```
226
-
227
227
* Now add the application into your configuration *conf/mods.conf*:
228
-
229
228
```
230
229
include embox.cmd.hello_world
231
230
```
232
-
233
231
* Build Embox:
234
-
235
232
```
236
233
$ make
237
234
```
238
-
239
235
* Run Embox:
240
-
241
236
```
242
237
$ ./scripts/qemu/auto_qemu
243
238
```
244
-
245
239
* Type ***help*** in Embox console to check if there is ***hello_world*** in commands list. Execute ***hello_world*** command and you will see:
246
-
247
240
```
248
241
root@embox:/#hello_world
249
242
Hello, world!
@@ -252,7 +245,6 @@ To add your own simplest application "Hello world" you can do the following:
252
245
253
246
### Mybuild file for "Hello World"
254
247
Let's look at the Mybuild file from "Hello world" example in more details:
255
-
256
248
```
257
249
package embox.cmd
258
250
@@ -262,21 +254,20 @@ Let's look at the Mybuild file from "Hello world" example in more details:
262
254
source "hello_world.c"
263
255
}
264
256
```
265
-
266
257
The first line contains package name ***embox.cmd***. In Embox all modules are organized into packages.
267
258
Full module name consist of the corresponding package name appended with module name. Module name is defined in string ***module hello_world***.
268
259
269
260
## Debugging
270
261
You can use the same script with *-s -S -no-kvm* flags for debugging:
271
262
```
272
-
$ sudo ./scripts/qemu/auto_qemu -s -S -no-kvm
263
+
$ sudo ./scripts/qemu/auto_qemu -s -S -no-kvm
273
264
```
274
265
After running that QEMU waits for a connection from a gdb-client. Run gdb in the other terminal:
Copy file name to clipboardExpand all lines: ru/examples/embox_blinking_led_example_ru.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,3 +85,4 @@ int main(int argc, char *argv[]) {
85
85
```
86
86
87
87
Отличие от примера с простым миганием светодиодом заключается в использовании еще одного вывода, который переключен в режим прерывания с помощью функции gpio_setup_mode(). А с помощью функции gpio_irq_attach() на событие по изменению состояния на выводе подключенном к кнопке, повешен обработчик. В обработчике происходит инвертирование значения на выходе светодиода.
Copy file name to clipboardExpand all lines: ru/platforms/embox_supported_platforms_qemu_ru.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,4 +30,3 @@ make
30
30
$ ./scripts/qemu/auto_qemu
31
31
```
32
32
данный скрипт разберет содержимое конфигурационных файлов в папке conf/ и запустит qemu c нужными параметрами. Для каждой архитектуры будет выбрана своя платформа по умолчанию.
0 commit comments