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
Merge pull request #1752 from pguyot/w28/start-with-init-boot
Start with init:boot/1
These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
Copy file name to clipboardExpand all lines: doc/src/programmers-guide.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,10 +176,7 @@ For more information about deploying the AtomVM image and AtomVM applications to
176
176
An AtomVM application is a collection of BEAM files, aggregated into an AtomVM "Packbeam" (`.avm`) file, and typically deployed (flashed) to some device. These BEAM files be be compiled from Erlang, Elixir, or any other language that targets the Erlang VM.
177
177
178
178
```{attention}
179
-
The return value from the `start/0` function is ignored on the the `generic_unix` platform, most MCU platforms have
180
-
the option of rebooting the device if the `start/0` function returns a value other than `ok`. Consult the
181
-
[Build Instructions](./build-instructions.md#platform-specific-build-instructions) for your device to see how this
182
-
is configured.
179
+
The return value from the `start/0` function is printed, ok means success (0 is also accepted for historical reasons), and any other value means failure. The processing of this results depend on platforms, on generic unix for example it determines the exit code. Most MCU platforms have the option of rebooting the device if the `start/0` function returns a value other than `ok`. Consult the [Build Instructions](./build-instructions.md#platform-specific-build-instructions) for your device to see how this is configured.
183
180
```
184
181
185
182
Here, for example is one of the smallest AtomVM applications you can write:
@@ -205,6 +202,8 @@ wait_forever() ->
205
202
receiveX -> Xend.
206
203
```
207
204
205
+
The start function actually isn't the first function evaluated by the virtual machine. If the `init` module exists, `init:boot/1` is called and this function calls `start/0`. The `init` module is part of atomvmlib.
206
+
208
207
### Packbeam files
209
208
210
209
AtomVM applications are packaged into Packbeam (`.avm`) files, which contain collections of files, typically BEAM (`.beam`) files that have been generated by the Erlang or Elixir compiler.
0 commit comments