[mod.computers.68k] CP/M-68k -- can you fork?

@gatech.UUCP (05/23/86)

------- Forwarded Message

Received: from ucbvax.Berkeley.EDU (ucbvax-il.Berkeley.Edu)
	by ucbopal.Berkeley.Edu (4.19/5.3)
	id AA02144; Fri, 23 May 86 00:58:48 pdt
Received: by ucbvax.Berkeley.EDU (5.51/1.13)
	id AA02121; Fri, 23 May 86 00:58:36 PDT
Received: by ucbjade.Berkeley.Edu (5.31 (CFC 4.21)/5.3)
	id AA01818; Fri, 23 May 86 00:58:26 PDT
Message-Id: <8605230758.AA01818@ucbjade.Berkeley.Edu>
Received: From PSUVAXG.BITNET By PSUVAXG.BITNET ; 23 May 86 07:54:56 GMT
From: przemek@psuvaxg.bitnet.berkeley
Received: by gondor.UUCP (4.12/4.7)
        id AA10663; Fri, 23 May 86 03:54:47 edt
Date: Fri, 23 May 86 03:54:47 edt
To: mwm@ucbvax, rdroya01@ulkyvx.BITNET
Subject: CP/M-68k -- can you fork?

 I have been trying to use the ideas of Mr. Royar to execute child processes
by invoking CCP from the system area. As he reported, the CCP can be invoked
and all the internal functions can be executed. The transient programs,
however, are more difficult. The problems are twofold: first, they return
by issuing warm boot, therefore reinitializing the system; and second, they
tend to overwrite the parent image in the TPA. The solution to the first problem
was discussed by Mr. Royar; I tried to work on the second part.
 Obviously, when the programs are loaded manually,  one must calculate the size
of the free memory from the data in the base page. The example of this calcu-
lation is given in the System Manual. The result is loaded to the LPB.
When programs are loaded via CCP, however, there is no such thing like LPB,
and in order to avoid the overwriting of the old program TPA limits must be
changed to protect it. Now how is the base page to be found? The answer may
be that base page is usually at the bottom of the current TPA, so by taking
the low limit of the TPA and comparing lowTPA with *((int *)lowTPA) one may
determine whether base page is found. After resetting the TPA, we may safely
load other programs; after trapping the warm boot it is possible to return to
the caller. Now this is not that easy, because it seems that some programs
are not relocatable; I tried STAT, and got 'not enough memory' error (no way,
i have 2 megs); other programs worked fine. I found a way to get the breakpoint
in the spawned routine: I used an empty program in assembler, and linked it
with -zxxxx option (where xxxx falls into modified TPA), then typed g,xxxx
when invoking the parent program.
I would be glad to hear from others how are the things going; sure the pos-
sibility of suspending uEMACS the way you can do it in u**x is tempting.

                        przemek@psuvaxg.bitnet
                        przemek@gondor.UUCP

PS I tried to use Set Vector bdos call to set the interrupt vector, so that
my routine would be entered in priviledged state but my bios interprets the
call, does not change the vector at all, and jumps to my routine in user mode.
So i just overwrite old vector with new one -- vector table is not protected
in my hardware.









------- End of Forwarded Message