Welcome, Guest. Please login or register.

Author Topic: Stupid question about if it's possible to link and create two separate executables  (Read 7030 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline thorrin

  • Newbie
  • *
  • Join Date: Jun 2003
  • Posts: 46
    • Show all replies
    • http://thorrin.hopto.org
Well, Im not too good with AmigaOS, but in VxWorks you can pass messages between tasks.  A message is a type of interrupt that will 'wake up' a seperate pending task.  Im sure something like this exists in the AmigaOS.

Or if you want to do some brute force coding (which would be very bad), you could hard code a place in memory to hold the variables, but you would probably overwrite something else in the process...  ie:  there is no guarantee that some other program wouldnt be using the exact memory.

In 'C', something like this would work... say you have a variable that you want to share between the tasks, you could store that variable at some address (say 0x8000 0000). To access the var, you could do some funky pointer stuff:

    *((int*)(0x8000000)) = 5  //store 5 at 0x8000 0000 in program 1
    x = *((int*)(0x8000000))  //get what is at 0x8000 0000 in program 2

this solution is really only good for embedded programming... something where you KNOW there wont be a collision.  But it will work.  Trying this on your amiga may crash it in ways you cant imagine :-P

-Thorrin
The best part about it was when I got paid...
 

Offline thorrin

  • Newbie
  • *
  • Join Date: Jun 2003
  • Posts: 46
    • Show all replies
    • http://thorrin.hopto.org
That sounds like what I was trying to describe in the VxWorks scenario.  I would imagine that all real time/multitasking operating systems have the same type of functionality.  I just didnt know what it was in amigaos.  In this case, he could create a structure as the message with the new variable values and pass THAT to the other task.

The only issue that I can think of doing it this way is if both tasks can modify variables.  You would have to have some kind of way to ensure that there aren't 2 variable change requests being sent at the same time.

And yeah, I know that the direct memory thing is BAD :-D, but it was a useful bit of info to pass on and in some cases its necessary (like you said... banging the HW)
   
-Thorrin

Quote

Karlos wrote:
@Argo

Well, I was referring to exec's MsgPort/Message system. Your process can create a MsgPort and tell exec to add your new message port to its list of public ports, allowing other processes to look it up. The messages themselves are low level C structures that can be passed from one process to another process via these ports. There is no constraints on what that message can contain, so its quite a useful system. Processes can wait for messages to arrive at their ports and messages are automatically queued so that they are not lost if the process cannot process the message immediately.

A classic example is Intuition, which uses the system to send input events to the a window etc.

Arrex's ports are conceptually similar but not quite the same thing.
 
The best part about it was when I got paid...
 

Offline thorrin

  • Newbie
  • *
  • Join Date: Jun 2003
  • Posts: 46
    • Show all replies
    • http://thorrin.hopto.org
Dern, y'all are going to make me get an AmigaOne and start coding up some stuff...  This all sounds like good fun.

-Thorrin
The best part about it was when I got paid...