-
Notifications
You must be signed in to change notification settings - Fork 7
Creating external program
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.
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.
- Spawn a Remote Executor board (located inside advdupe2 under
alx_pc/parts). - Install the component into an available PCI slot on the ALX PC motherboard.
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.
- How it works: ALX OS reads the file containing a full Expression2 source code and executes it via Remote Executor using remoteupload.
- Deployment Steps:
- Copy your E2 script from
garrysmod/data/expression2/(e.g.alx_pc/gpu/remote/testprog.txt) into your local foldergarrysmod/data/e2files/. - Inside ALX OS, create a file named
testprog.e2r. - Set its content to point to your local file:
file://testprog.txt. - Run the .e2r file.
- Copy your E2 script from
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.
- 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:
- Inside ALX OS, create a file named
testprog.e2p. - Set its content relative to
garrysmod/data/expression2/, e.g.alx_pc/remote/testprog.txt. - Run the .e2p file.
- Inside ALX OS, create a file named
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!
You can check the example code inside the testprog.txt file.
[ALX OS File] -> [Reads Function Name] -> [Triggers Core CPU] -> [Triggers Core GPU]
[ALX OS File] -> [Reads Source/Path] -> [PCI Card (Remote Executor)] -> [remoteupload to separate chip]