Hi Russ,

Thanks for your response!

When a Plan 9 binary first starts running, the system
call return register (AX in this case) contains a pointer
to the Tos structure.  /sys/src/libc/386/main9.s
saves that value in the global variable named _tos.
It sounds like you are not setting AX correctly when
you start the programs, so _tos is not initialized
correctly.

So I have to allocate 56 bytes (sizeof(Tos) on 386) of space above the top of stack (before copying argc and argv) and set AX to that address, correct?

How do you plan to implement rfork(RFMEM|RFPROC),
which must share the entire address space between
the parent and child except for the stack segment?

The clone(2) system call in linux allows for creation of child processes that share address space with its parent, with the exception of the stack segment. I believe that should do?

Regards,
Anant


Reply via email to