Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: Sections in...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 7 Topic 3994 of 4053
Post > Topic >>

Re: Sections in assembler forth's on un*x

by Robert Spykerman <robert.spykerman@[EMAIL PROTECTED] > Apr 25, 2008 at 01:40 AM

On Apr 16, 6:08 pm, Robert Spykerman <robert.spyker...@[EMAIL PROTECTED]
>
wrote:
> Anyways, right now I'm trying to port the SYSTEM word.
>
> The fork syscall appears to work (I get another forth instance on top
> of the old one) but the shell does not get called to do say, something
> quick like "ls" SYSTEM. I changed the vector to the apple one, maybe
> there's a difference. I also had to patch waitpid - it's wait4 on the
> apple.
....

Just a brief update re: my attempt at porting Albert's ciforth to OSX

I've found out what appears to be the problem afflicting my current
attempt at porting the SYSTEM word.

It would seem that the fork syscall appears to return the PID to both
parent and child process which results in the child not knowing it's a
child (because it would expect a PID of zero) and hence execution
pretty much waits there.

I am not sure what's affecting fork and why it's behaving this way, it
must be a porting glitch on my part, but so far the code really looks
quite sane.

How hard is it to call a pid_t fork (void) ...

where pid_t = unsigned 32 bit, ie return a 32 bit value (which I
assume will sit in EAX and appears to otherwise I would not get a PID
back at all, so given I'm getting PID's back I must be doing that bit
right :).

The linux code works as it self describes really, I've double checked
the return values and they check out. Child gets 0. Parent gets PID of
child.

Can't see what I'm doing wrong with my OSX version both get the PID of
the child.... hmmm..

I can't believe even I can stuff that up :) But who knows hehehehe.

/scratches head.

Anyways it would seem all things being equal I may get some time to
work on this this weekend... If anyone's ever come across a problem
like this before, pray do share your wisdom. I'll see if any of the
BSD or mac guys I know have come across anything like this as well.

Robert Spykerman




 7 Posts in Topic:
Sections in assembler forth's on un*x
Albert van der Horst <  2008-04-13 04:21:15 
Re: Sections in assembler forth's on un*x
Robert Spykerman <robe  2008-04-13 02:12:05 
Re: Sections in assembler forth's on un*x
Albert van der Horst <  2008-04-13 11:49:03 
Re: Sections in assembler forth's on un*x
Robert Spykerman <robe  2008-04-13 17:57:07 
Re: Sections in assembler forth's on un*x
Albert van der Horst <  2008-04-16 06:09:26 
Re: Sections in assembler forth's on un*x
Robert Spykerman <robe  2008-04-16 01:08:00 
Re: Sections in assembler forth's on un*x
Robert Spykerman <robe  2008-04-25 01:40:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 0:51:20 CDT 2008.