Skip to content

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Nov 1, 2025

Most platforms run embedded avm in the flash. Implement a similar mechanism on generic_unix platform, to enable an escriptize-like experience.

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

Most platforms run embedded avm in the flash. Implement a similar mechanism
on generic_unix platform, to enable an escriptize-like experience.

Signed-off-by: Paul Guyot <[email protected]>
@pguyot pguyot force-pushed the w44/embedded-avm-on-linux-and-macos branch from 8ff5fd1 to 7f863db Compare November 1, 2025 08:19
pguyot added a commit to atomvm/atomvm_rebar3_plugin that referenced this pull request Nov 1, 2025
Requires support for AtomVM:
atomvm/AtomVM#1948

NB: it's currently incompatible with JIT

Signed-off-by: Paul Guyot <[email protected]>
extern uint64_t __atomvm_avm_offset;
extern uint64_t __atomvm_avm_length;

__asm__(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not valid on ARM. I suggest trying to use: __attribute__((section("bar"))). See also: extern void foobar(void) attribute((section("bar")));
This should be more portable and avoid any kind of asm. Let's just check that compiler understands this.

Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also document somewhere how to use this / how a compatible application is written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants