Skip to content

Creating external program

AlexALX edited this page Aug 22, 2026 · 10 revisions

Creating an External Program (Remote / Isolated)

This page explains how to create and execute independent, external Expression2 programs within ALX OS using a Remote Executor expansion board.

Unlike Embedded Programs, external programs do not require modifying the core CPU/GPU chips or rebuilding the OS. They run in an isolated environment directly on the hardware module.

Mandatory Requirements

This functionality relies entirely on the Wiremod E2 remoteupload extension. Before proceeding, ensure that this extension is enabled on the server via the console command:

wire_expression2_extension_enable remoteupload

If this extension is disabled, the Remote Executor board will not function.

Hardware Setup

  1. Spawn a Remote Executor board (located inside advdupe2 under alx_pc/parts).
  2. Install the component into an available PCI slot on the ALX PC motherboard.

E2 Execution Formats: .e2r vs .e2p

ALX OS supports two ways to execute external code through the Remote Executor. The choice depends on whether the code is hosted locally on your real PC or inside the ALX PC HDD.

1. Remote Source Format (.e2r)

How it works: ALX OS reads the file containing a full Expression2 source code and executes it via Remote Executor using remoteupload.

Deployment Steps:

  1. Copy your E2 script from garrysmod/data/expression2/ (e.g. alx_pc/gpu/remote/testprog.txt) into your local folder garrysmod/data/e2files/.
  2. Inside ALX OS, create a file named testprog.e2r.
  3. Set its content to point to your local file: file://testprog.txt.
  4. Run the .e2r file.

Note: Any #include must exist locally on your real machine, or it will not work! This is better to not use includes here at all if you want a fully isolated program.

2. Path-based Execution Format (.e2p)

How it works: The file contains a direct string path pointing to an E2 file already located inside garrysmod/data/expression2/ directory. The Remote Executor runs it directly from your machine.

Deployment Steps:

  1. Inside ALX OS, create a file named testprog.e2p.
  2. Set its content relative to garrysmod/data/expression2/, e.g. alx_pc/remote/testprog.txt.
  3. Run the .e2p file.

Critical Note: For .e2p execution, you must add #include "alx_pc/remote/e2p_include" in your code. Without this, the remote executor board will break!

Reference Template

You can check the example code inside the testprog.txt file.

Program Lifecycles Compared

Embedded (.e2e)

[ALX OS File] -> [Reads Function Name] -> [Triggers Core CPU] -> [Triggers Core GPU]

External (.e2r / .e2p)

[ALX OS File] -> [Reads Source/Path] -> [PCI Card (Remote Executor)] -> [remoteupload to separate chip]

Clone this wiki locally