9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Pietro Gagliardi <pietro10@mac.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] 9vx fork problem
Date: Mon, 30 Jun 2008 08:42:50 -0400	[thread overview]
Message-ID: <A4782414-E02B-4BB8-B4ED-C96547C35F37@mac.com> (raw)
In-Reply-To: <aa9ea2191da68ebbbd85a3320423fc61@quintile.net>

- Modify the kernel (it is based on Unix - even Microsoft says so)
- Learn how Cygwin does it
- Don't use real processes, like in Inferno

On Jun 30, 2008, at 8:34 AM, Steve Simon wrote:

>> Apparently, after a fork, a child retains it's parent's
>> pid in _tos->pid.
>
> I think this is at the root of why 9vx cannot run on MS-Windows.
>
> I have been very slowly crawling towards an updated port of 9pm
> (p9p for windows as it was) learing the Windows API and the plan9
> kernel as I go.
>
> The one total show stopper is a lack of a real fork() in windows.
>
> This meant I chose to implement rfork(RFPROC) as somthing like
> vfork() -
> CreateThread() followed by CreateProcess() whilst the parent is
> blocked.
> This works in simple cases but breaks on rc(1). This is fixable by
> modifying the rc source (rc runs under windows in its inferno form
> anyway)
> but that is not the point.
>
> I implemented rfork(RFPROC|RFMEM) as CreateThread() with stack copy
> and relocation. This works well but means every windows-thread/plan9-
> psudo-proc
> has a different stack and thus _tos and _tos->pid won't work.
>
> This is OK, I just recompile every app using a modified malloc.c in
> libc
> but once again, if you break the purity of unmodified plan9 binaries
> then
> then you win almost noting over recompiling them on the target
> platform anyway -
> kencc syntax extensions not withstanding.
>
> I would love to get 9vx running on windows and if anyone has any
> ideas how to
> solve these problems then let me know.
>
> -Steve
>




  reply	other threads:[~2008-06-30 12:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-30  0:32 Anthony Martin
2008-06-30  2:02 ` Russ Cox
2008-06-30  3:25   ` Anthony Martin
2008-06-30 12:34 ` Steve Simon
2008-06-30 12:42   ` Pietro Gagliardi [this message]
2008-06-30 15:14     ` Robert William Fuller
2008-06-30 12:51   ` Russ Cox
2008-06-30 13:03     ` Steve Simon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A4782414-E02B-4BB8-B4ED-C96547C35F37@mac.com \
    --to=pietro10@mac.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).