🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.apple2.gno
Article #298

Machine language forking

#298
From: Phillip Vandry
Date: Wed, 18 Nov 1992 03:53
40 lines
1582 bytes
I'm having problems -- crashy problems with creating a child process.
Consider this code fragment:

        fork    #process
        sta     pid1
loop34  wait    #0
        brk     0
        case    on
        cmp     pid1
        bne     loop34
        brl     bigbig

It's almost identical to the code in script.asm, so it should work!

It's supposed to create a process and wait until the child exits.

It crashes sometime after the child quits and sometime before the brk
statement in the above code. I know that it crashed after the child has
died because GNO Snooper says the child does not exist at the time of the
crash.

Just in case it's relevant, the child starts, bla, bla, and so on, and
exits via

          lda #0
          clc
          rtl

That's how the children in the script source code die too, so that should
be all right.

It's probably some kind of stack corruption because the crash happens in
bank 0. Anyways, I don't know.

If I'm doing something wrong, please tell me. Thanks.

__                __          _          __
|_) |_| | |  |  | |_)   |  | /_\ |\ | |\ |_) \_/  % NetMail:          %
|   | | | |_ |_ | |      \/  | | | \| |/ |\   |   %   Vandry@Cam.Org  %
Technical Details
Message-ID: <Bxw84n.I5C@CAM.ORG>
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!newsflash.concordia.ca!IRO.UMontreal.CA!matrox!altitude!vandry

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.apple2.gno
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!newsflash.concordia.ca!IRO.UMontreal.CA!matrox!altitude!vandry
From: vandry@CAM.ORG (Phillip Vandry)
Subject: Machine language forking
Message-ID: <Bxw84n.I5C@CAM.ORG>
Organization: Champlain Regional College, St-Lambert QC  CANADA
Date: Wed, 18 Nov 1992 03:53:10 GMT
Lines: 40