Skip to content

Commit 6ff6904

Browse files
Merge pull request #14 from deryugina/master
Fixed "embox_quick_start" doc
2 parents 3f4d446 + d14b439 commit 6ff6904

7 files changed

+80
-76
lines changed

en/embox_quick_start_en.md

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Quick start
32
It’s better to get started with Embox running on QEMU emulator, which supports different CPU architectures.
43

@@ -7,21 +6,21 @@ Clone git repository:
76
```
87
$ git clone https://github.com/embox/embox
98
```
10-
Or download as an archive:
11-
```
12-
[https://github.com/embox/embox/releases](https://github.com/embox/embox/releases/)
13-
```
9+
Or download as an archive [https://github.com/embox/embox/releases](https://github.com/embox/embox/releases).
10+
1411
## Work on Windows or MacOS
1512
### Please follow the next recommendations:
1613
Download an actual version of PowerShell:
17-
```
18-
[How to download PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3/)
19-
```
14+
15+
[How to download PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3/)
16+
2017
Open PowerShell as an administrator and install WSL2 (please pay your attention to the demands on Windows version):
18+
19+
[How to install WSL2](https://learn.microsoft.com/en-us/windows/wsl/install-manual)
2120
```
22-
[How to install WSL2](https://learn.microsoft.com/en-us/windows/wsl/install-manual)
21+
Before the next step upgrade WSL1 to WSL2 if you did'nt do this(the instruction is in a link above).
22+
In other way Embox won't run on Windows.
2323
```
24-
Before the next step upgrade WSL1 to WSL2 if you did'nt do this(the instruction is in a link above). In other way Embox won't run on Windows.
2524

2625
### Download Ubuntu from Microsoft Store
2726
Check yout version of WSL the next way: insert the command below in PowerShell:
@@ -57,9 +56,9 @@ Run the next three commands
5756
```
5857
P.S.: If you have any problems with running Embox on Windows -- please check a correctness of the inserted commands.
5958
If it's correct -- you can use the recommendations from the article(the link is below):
60-
```
61-
[How to solve problems with WSL](https://learn.microsoft.com/en-us/windows/wsl/troubleshooting)
62-
```
59+
60+
[How to solve problems with WSL](https://learn.microsoft.com/en-us/windows/wsl/troubleshooting)
61+
6362

6463
## Enviroment Settings
6564
Minimal required packages: *make*, *gcc*, (cross-compiler for target platform. see "Cross-compiler installation").
@@ -73,11 +72,10 @@ For Debian/Ubuntu:
7372
```
7473
For Arch:
7574
```
76-
sudo pacman -S make gcc-multilib cpio qemu
75+
$ sudo pacman -S make gcc-multilib cpio qemu
7776
```
7877

7978
## Cross-compiler installation
80-
8179
***x86***:
8280
```
8381
$ sudo apt-get install gcc
@@ -101,14 +99,13 @@ Extract files from archive and set *PATH* enviroment variable:
10199

102100
***SPARC, Microblaze, MIPS, PowerPC, MSP430***:
103101
You can try to use some cross-compiler based on gcc in case if you already have a suitable one.
102+
104103
But it would be better if you will use our project for cross-compiler installation:
105-
```
106-
[https://github.com/embox/crosstool](https://github.com/embox/crosstool)
107-
```
104+
[https://github.com/embox/crosstool](https://github.com/embox/crosstool)
105+
108106
You can use already ready-to-use archives from:
109-
```
110-
[https://github.com/embox/crosstool/releases](https://github.com/embox/crosstool/releases)
111-
```
107+
[https://github.com/embox/crosstool/releases](https://github.com/embox/crosstool/releases)
108+
112109
Or you can build cross-compiler with the script in the project's root folder:
113110
```
114111
$ ./crosstool.sh ARCH
@@ -157,17 +154,18 @@ Now you are able to run Embox:
157154
```
158155
Console output example:
159156
```
160-
Embox kernel start
161-
unit: initializing embox.kernel.task.task_resource: done
162-
unit: initializing embox.mem.vmem_alloc: done
157+
Embox kernel start
158+
unit: initializing embox.kernel.task.task_resource: done
159+
unit: initializing embox.mem.vmem_alloc: done
163160
```
164161
If all unit tests passed successfully and all modules loaded, then command prompt will appear.
165162
Now you can execute commands included in the configuration (`mods.conf`). You can start with ***help*** command which prints list of available commands.
166163

167164
Press ***ctrl+’A’*** and then `***x***` to exit from Qemu.
168165

169166
## Preliminaries to Mybuild build 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.
167+
Embox is modular and configurable. Declarative program language "Mybuild" has been developed for these features.
168+
Mybuild allows to describe both single modules and whole target system.
171169

172170
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.
173171

@@ -272,3 +270,14 @@ After running that QEMU waits for a connection from a gdb-client. Run gdb in the
272270
The system starts to load.
273271

274272
At any moment in gdb terminal you can type <kbd>ctrl + C</kbd> and see the stack of the current thread (`backtrace`) or set breakpoints (`break <function name>`, `break <file name>:<line number>`).
273+
274+
## Connection of external repository
275+
Embox allows to connect external repo to modules and templates. It's enough to specify root directory of repository for this purpose:
276+
```
277+
make ext_conf EXT_PROJECT_PATH=<your projects path>
278+
```
279+
To make templates visible through "make confload" and "make confload-" calls, connected repo has to have the next folder-structure:
280+
```
281+
<root_folder>/<project_name>/templates
282+
```
283+
Modules can be in random folders. Search is carried out, using *Mybuild* and **.my* files.

en/embox_supported_platforms_en.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

en/embox_supported_platforms_arm_en.md renamed to en/platforms/embox_supported_platforms_arm_en.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ Embox supports several popular hardware platforms based on ARM chip:
77
* STM32 MCU Eval Tools
88
* Raspberry Pi
99
* BeagleBoard
10-
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Supported plaftorms
2+
3+
Embox supports several CPU architectures:
4+
* ARM
5+
* x86
6+
* SPARC
7+
* DLX (Microblaze)
8+
* MIPS
9+
* PPC (PowerPC)
10+
* E2k (Elbrus)
11+
12+
There is a support for several hardware (real or virtual) platforms based on each CPU architectures. It's requred to install own developer enviroment (cross-compiler and gdb) as described in "Cross-compiler installation"

en/embox_supported_platforms_qemu_en.md renamed to en/platforms/embox_supported_platforms_qemu_en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,3 @@ For running you should execute `auto_qemu` script:
2121
$ ./scripts/qemu/auto_qemu
2222
```
2323
The script parses config files from `conf/` folder and starts `qemu` with corresponded arguments.
24-
25-

en/embox_supported_platforms_x86_en.md renamed to en/platforms/embox_supported_platforms_x86_en.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ Embox supports:
77
* qemu-system-i386
88
* Load with GRUB
99
* BifferBoard
10-

ru/embox_quick_start_ru.md

Lines changed: 34 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,23 @@
66
```
77
$ git clone https://github.com/embox/embox
88
```
9-
Либо скачиваем архивом из [https://github.com/embox/embox/releases](https://github.com/embox/embox/releases)
9+
Либо скачиваем архивом из [https://github.com/embox/embox/releases](https://github.com/embox/embox/releases).
1010

1111
## Запуск в Windows (и MacOS)
12-
1312
### Выполните следующие шаги:
14-
15-
Скачайте актуальную версию PowerShell
13+
Скачайте актуальную версию PowerShell:
1614

1715
[Алгоритм скачивания PowerShell для Windows](https://learn.microsoft.com/ru-ru/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3)
1816

19-
20-
Зайдите в PowerShell под именем администратора и установите WSL2 (обратите внимание на требования к версии Windows)
17+
Зайдите в PowerShell под именем администратора и установите WSL2 (обратите внимание на требования к версии Windows):
2118

2219
[Алгоритм установки WSL2](https://learn.microsoft.com/ru-ru/windows/wsl/install-manual)
23-
24-
2520
```
26-
Перед тем как перейти к следующему шагу обязательно обновите WSL1 до WSL2
27-
(инструкция по ссылкам выше), в противном случае Embox не запустится под Windows
21+
Перед тем как перейти к следующему шагу обязательно обновите WSL1 до WSL2
22+
(инструкция по ссылкам выше), в противном случае Embox не запустится под Windows.
2823
```
2924

30-
Скачайте Ubuntu из Microsoft Store
31-
32-
25+
### Скачайте Ubuntu из Microsoft Store
3326
Убедитесь, что у Вас стоит WSL версии 2, для этого введите в PowerShell команду:
3427
```
3528
wsl -l -v
@@ -45,12 +38,11 @@
4538
sudo apt-get install python3
4639
sudo apt-get install python-is-python3
4740
```
48-
4941
Клонируйте себе версию проекта (используйте https или ssh):
50-
51-
git clone <https://github.com/embox/embox.git>
52-
git clone <[email protected]:embox/embox.com>
53-
42+
```
43+
git clone <https://github.com/embox/embox.git>
44+
git clone <[email protected]:embox/embox.com>
45+
```
5446

5547
Зайдите в папку проекта:
5648
```
@@ -68,11 +60,11 @@
6860
[Устранение неполадок WSL](https://learn.microsoft.com/ru-ru/windows/wsl/troubleshooting)
6961

7062

71-
7263
## Настройка окружения
73-
Необходимые пакеты: make, gcc (кросс-компилятор под выбранную архитектуру, см. “Установка кросс-компилятора”).
74-
Дополнительные пакеты (рекомендуется установить сразу): build-essential, gcc-multilib, curl, libmpc-dev, python.
75-
Пример установки для Debian:
64+
Необходимые пакеты: **make**, **gcc** (кросс-компилятор под выбранную архитектуру, см. “Установка кросс-компилятора”).
65+
Дополнительные пакеты (рекомендуется установить сразу): **build-essential**, **gcc-multilib**, **curl**, **libmpc-dev**, **python**.
66+
67+
Пример установки для Ubuntu/Debian:
7668
```
7769
$ sudo apt-get install make gcc \
7870
build-essential gcc-multilib \
@@ -84,29 +76,31 @@
8476
```
8577

8678
## Установка кросс-компилятора
87-
### x86:
79+
***x86***:
8880
```
8981
$ sudo apt-get install gcc
9082
```
91-
Обычно эти пакеты уже установлены в Вашей ОС, но на всякий случай стоит это проверить. Вам также понадобится *gcc-multilib*. Обратите внимание, что требуется установить другие пакеты, если Вы уже настроили окружение на Windows и MacOS самостоятельно.
83+
Обычно эти пакеты уже установлены в Вашей ОС, но на всякий случай стоит это проверить. Вам также понадобится *gcc-multilib*.
84+
Обратите внимание, что требуется установить другие пакеты, если Вы уже настроили окружение на Windows и MacOS самостоятельно.
9285

9386
### ARM:
9487
```
9588
$ sudo apt install arm-none-eabi-gcc
9689
```
97-
Или для Debian
90+
Или для Debian:
9891
```
9992
$ sudo apt install gcc-arm-none-eabi
10093
```
101-
Вы можете также скачать архив с набором ARM-инструментов(тулчейном) по ссылке: [https://launchpad.net/gcc-arm-embedded](https://launchpad.net/gcc-arm-embedded), а затем распаковать архив и настроить переменную окружения *PATH*:
94+
Вы можете также скачать архив с набором ARM-инструментов(тулчейном) по ссылке: [https://launchpad.net/gcc-arm-embedded](https://launchpad.net/gcc-arm-embedded).
95+
Затем нужно распаковать архив и настроить переменную окружения *PATH*:
10296
```
10397
$ export PATH=$PATH:<путь к тулчейну>/gcc-arm-none-eabi-<version>/bin
10498
```
10599

106100
### SPARC, Microblaze, MIPS, PowerPC, MSP430:
107101
Для этих архитектур можно воспользоваться нашим проектом по сборке кросс-компилятора: [https://github.com/embox/crosstool](https://github.com/embox/crosstool).
108102

109-
Также можно скачать последнюю версию готового к использованию архива отсюда: [https://github.com/embox/crosstool/releases](https://github.com/embox/crosstool/releases).
103+
Также можно скачать последнюю версию архива отсюда: [https://github.com/embox/crosstool/releases](https://github.com/embox/crosstool/releases).
110104

111105
Или собрать его, выкачав скрипты из репозитория с помощью команды:
112106
```
@@ -133,6 +127,7 @@ QEMU может быть установлен следующим способо
133127
$ make confload-<ARCH>/qemu
134128
```
135129
Где <ARCH>: x86, arm, mips, ppc, sparc, microblaze.
130+
136131
Пример под x86:
137132
```
138133
$ make confload-x86/qemu
@@ -146,6 +141,7 @@ QEMU может быть установлен следующим способо
146141
$ make (-jN)
147142
```
148143
Где *-j* -- это опция *make*, а *N* -- это количество параллельных процессов.
144+
149145
Пример:
150146
```
151147
$ make -j4
@@ -154,7 +150,6 @@ QEMU может быть установлен следующим способо
154150
```
155151
$ ./scripts/qemu/auto_qemu
156152
```
157-
158153
Пример вывода в консоль:
159154
```
160155
Embox kernel start
@@ -163,10 +158,12 @@ Embox kernel start
163158
...
164159
```
165160
Если все unit-тесты прошли успешно, и система загружена, появится консоль, в которой можно выполнять команды. Начать можно с команды ***'help'*** которая выведет список доступных команд для вашей конфигурации.
161+
166162
Для выхода из эмулятора qemu нажмите последовательно: ***ctrl+’A’***, затем ***‘x’***.
167163

168164
## Особенности системы сборки Mybuild
169-
***Embox*** - модульная и настраиваемая система. Для этих целей был разработан декларативный язык описания ***Mybuild***. Он позволяет описывать как отдельные единицы системы (модули), так и всю систему в целом.
165+
***Embox*** - модульная и настраиваемая система. Для этих целей был разработан декларативный язык описания ***Mybuild***.
166+
Он позволяет описывать как отдельные единицы системы (модули), так и всю систему в целом.
170167

171168
***Модуль*** является базовым понятием для системы сборки. Он содержит: список файлов, относящихся к данному модулю; параметры, которые можно задать модулю в момент конфигурации; список зависимостей.
172169

@@ -207,7 +204,6 @@ Embox kernel start
207204
$ mkdir src/cmds/hello_world
208205
```
209206
* Создать файл с исходным кодом программы ***src/cmds/hello_world/hello_world.c*** со следующим содержанием:
210-
211207
```
212208
#include <stdio.h>
213209
@@ -216,7 +212,6 @@ Embox kernel start
216212
}
217213
```
218214
* Создать файл ***src/cmds/hello_world/Mybuild*** с описанием Вашего модуля:
219-
220215
```
221216
package embox.cmd
222217
@@ -227,22 +222,18 @@ Embox kernel start
227222
}
228223
```
229224
* Добавить программу в файл конфигурации *conf/mods.conf*:
230-
231225
```
232226
include embox.cmd.hello_world
233227
```
234228
* Собрать Embox:
235-
236229
```
237230
$ make
238231
```
239232
* Запустить Embox:
240-
241233
```
242234
$ ./scripts/qemu/auto_qemu
243235
```
244236
* Наберите **help** в консоли Embox, чтобы проверить, появилась ли **hello_world** в списке команд, и Вы увидите:
245-
246237
```
247238
root@embox:/#hello_world
248239
Hello, world!
@@ -251,7 +242,6 @@ Embox kernel start
251242

252243
### Файл описания модуля
253244
Разберем немного подробнее файл описания модуля.
254-
255245
```
256246
package embox.cmd
257247
@@ -265,21 +255,23 @@ Embox kernel start
265255

266256
Строка ***source "hello_world.c"*** содержит названия необходимых для сборки модуля файлов.
267257

268-
В строке ***@Cmd(name = "hello_world", help="First Embox application")*** задается атрибут модуля. В первую очередь модуль будет представлять из себя приложение, а во вторую -- устанавливает имя, с помощью которого это приложение можно вызвать. И наконец, устанавливается строка, которая будет отображаться при вызове команды ***'help'***.
258+
В строке ***@Cmd(name = "hello_world", help="First Embox application")*** задается атрибут модуля.
259+
В первую очередь модуль будет представлять из себя приложение, а во вторую -- устанавливает имя, с помощью которого это приложение можно вызвать.
260+
И наконец, устанавливается строка, которая будет отображаться при вызове команды ***'help'***.
269261

270262
Строка ***@AutoCmd*** показывает, что в приложении есть стандартная функция входа в приложение ***main()***, которая будет заменена на другой символ в процессе сборки.
271263

272264
## Отладка
273265
Для отладки можно использовать тот же 'auto_qemu' скрипт, добавив флаги *-s -S -no-kvm*:
274266
```
275-
$ sudo ./scripts/qemu/auto_qemu -s -S -no-kvm
267+
$ sudo ./scripts/qemu/auto_qemu -s -S -no-kvm
276268
```
277269
После запуска qemu ждёт соединения с gdb-клиентом. Запустим gdb в другом терминале:
278270
```
279-
$ gdb ./build/base/bin/embox
280-
...
281-
(gdb) target extended-remote :1234
282-
(gdb) continue
271+
$ gdb ./build/base/bin/embox
272+
...
273+
(gdb) target extended-remote :1234
274+
(gdb) continue
283275
```
284276
Система начала загружаться.
285277

@@ -291,4 +283,3 @@ Embox допускает подключение внешнего репозит
291283
make ext_conf EXT_PROJECT_PATH=<your projects path>
292284
```
293285
Для того, чтобы темплейты были видны через вызовы `make confload` и `make confload-`, подключеный репозиторий должен иметь структуру папки *project*, а именно *<root_folder>/<project_name>/templates*. Модули могут располагаться в произвольных папках, поиск осуществляется по файлам Mybuild и *.my
294-

0 commit comments

Comments
 (0)