Skip to content

Creating own program

AlexALX edited this page Mar 17, 2018 · 3 revisions

THIS INFORMATION IS OUTDATED (for v1.1) AND WILL BE UPDATED BIT LATER

If you want create own program for this OS, then here instruction:

For example you want to create some graphics program what will draw on EGP, then:

  1. Create file "testprog" inside alx_pc\gpu\alxos\ folder.
  2. Place this content here:
@name Test Prog
if (INCLUDE) {

#include "alx_pc/gpu/alxos/_main_"

function alxos_testprog_init(Args:table) {
print("HELLO")

#DsHandler = "alxos_testprog_ds"
#KeyHandler = "alxos_testprog_key"

}

}
  1. Open file alx_pc\gpu\alxos_prog_.txt and add to the end (before last }):
ALXOS_PROGS["alxos_testprog",number] = 1
function alxos_testprog(Args:table) {
    INCLUDE = 1
    #include "alx_pc/gpu/alxos/testprog"
    INCLUDE = 0
    alxos_testprog_init(Args)
}
  1. Open file alx_pc\cpu\alxos_prog_.txt and add to the end (same before last }):
ALXOS_PROGS["alxos_testprog",number] = 1
function alxos_testprog(FInfo:table) {
    dsSendDirect("alxos_runprog",E2_GPU,table("alxos_testprog"))
}
  1. Save all files what you edited.
  2. Open alx_pc\CPU.txt file and upload it into CPU chip.
  3. Open alx_pc\GPU.txt file and upload it into GPU chip.
  4. Reboot system.
  5. Create text file with content "alxos_testprog", then upload it to some folder and name as testprog.e2e (extension is important!).
  6. If everything done correct - if you execute created file it will print "HELLO" into your chat/console.

Now you have to use some build-in functions for manage what you want, you need to look inside other programs to understand how it works. You can add own persist and inputs/outputs in your program and it will be added to gpu automatically. But please keep in mind - variable names/functions must have unique names to prevent share problems!

Anyway small list of main functions/variables (for GPU):

egpClear() - clear EGP and gpudata
DsHandler - data signal handler function
KeyHandler - keyboard handler

Much of other things look inside alx_pc\gpu_main_.txt file and alx_pc\gpu\alxos_main_.txt file. Also some other useful functions inside alx_pc\shared\ files.

Good luck! And sorry for lack of documentation how to use all this stuff.

Clone this wiki locally