interprocess communication

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Adek336

interprocess communication

Post by Adek336 »

hello all

I was wondering what is a common way to implement it? It might be useful for example while communicating with a text mode GUI (yea, that's my great idea :)))

Adrian
Brill

RE:interprocess communication

Post by Brill »

1. Use an os service were the first process calls an os software interrupt with a message to save in an 'inbox' messaging system. The target task when executing then checks this inbox for any messages addressed to it.

2. The first task places its messages on a stack, then requests the os to switch tasks to the second task, which when executed pops the messages off the same stack.

I can't think of any other ways. Try reading some osdev theory books.
Brill

RE:interprocess communication

Post by Brill »

I thought of some other ways. They might be similar to the other 2 though.

3. Use a loopback device supplied from network support to connect to the target task and send messages.

4. Save information inside a file on disk that could be opened by the target task.
garf

RE:interprocess communication

Post by garf »

You could use a shared section of memory in combination with a message queue.

Process 1 asks the OS for a block of shared memory.
Process 1 places the data in shared memory.
Process 1 then sends a message to process 2 saying it has data waiting.
Process 2 gets the message and uses the data.
Process 2 sends a reply to process 1
Process 1 tells the OS to free the memory.

The advantage to this is that if you are using paging you can map the memory to the same logical location in both processes. That gives you the ability to simply pass a pointer in the message and both processes can resolve the address to the correct physical memory location.
Adek336

RE:interprocess communication

Post by Adek336 »

Thanx,

I'll consider these solutions, as soon as I get multitasking working.

Cheers,
Adrian.
Post Reply