9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Russ Cox <rsc@swtch.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Go/Inferno toolchain (Was: comment and newline in
Date: Tue, 29 Jun 2010 16:00:09 -0700	[thread overview]
Message-ID: <AANLkTinKtxq7nnwS86g8ejpECFM8zquorijKcs2NTxyj@mail.gmail.com> (raw)
In-Reply-To: <AANLkTin7bcjTrQ-Kugu7-vJ8Byq68HKrSKAsLEM9zAAj@mail.gmail.com>

what i said to people at usenix was approximately
the following.

i think that porting go to plan 9 - the time to get
something working that runs all the go programs -
is not more than a week of concerted effort.
i also think that it just hasn't been high enough
priority for anyone (myself included) to put that
amount of effort in.

the go runtime sets up the segment registers,
with the operating system's help, so that gs
points at per-kernel-thread storage.
the linker generates references through gs
for the pseudo-addressing mode 0(gs), 4(gs), etc.
on plan 9 there is already per-kernel-thread
storage: it is called the stack.  the workaround
would be for the linker to know the top of stack
address and rewrite 0(gs) and 4(gs) to fixed
memory addresses just below the top of the stack.
it would be just as efficient as the 0(gs), 4(gs)
stuff and not require any kernel changes.

the build uses make, yes, and in some places
there are even include files that include other
include files (gasp!), but writing equivalent mkfiles
should take not very much time.  we're not doing
anything magical, and the particular style in the
makefiles should be familiar.

there's obviously a lot of divergence between
the plan 9 tool chain and the go tool chain.
the object files have different format, and so on.
to get off the ground i would suggest treating
the go copies of the tools as separate programs
and libraries from the originals.  for example,
you might install the go libmach as /386/lib/go/libmach.a
and the compiler tool chain as /386/bin/go/8a,
/386/bin/go/8c, /386/bin/go/8g, /386/bin/go/8l.
the .8 files created by those tools would not
be compatible with the standard ones, and the
standard nm wouldn't understand the final 8.out,
but the final 8.out would run.  you'd have to
disable the runtime copy of the symbol table
(the "nacl" target in 8l already does).
anyway, keep everything separate and get it
working.  once you have a working system then
you could worry about reconciling the two worlds
to whatever extent is appropriate.

i think people get too hung up on trying to make
the port back perfect.  just make it work.
then make it better.

russ


  parent reply	other threads:[~2010-06-29 23:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-25 15:35 [9fans] comment and newline in define lucio
     [not found] ` <AANLkTilhVWAu8htoIL903rtMK1z9Sw88pSfEASawc5Xi@mail.gmail.com>
2010-06-26  0:50   ` Christopher Nielsen
2010-06-26  0:58     ` erik quanstrom
2010-06-26  4:18       ` Rob Pike
2010-06-26  6:15         ` Christopher Nielsen
2010-06-26  5:19     ` [9fans] Go/Inferno toolchain (Was: comment and newline in define) lucio
2010-06-26  6:46       ` Christopher Nielsen
2010-06-26  9:26         ` [9fans] Go/Inferno toolchain (Was: comment and newline in lucio
2010-06-26 10:34           ` erik quanstrom
2010-06-26 11:00             ` lucio
2010-06-28 22:03           ` Eric Van Hensbergen
2010-06-29 17:24             ` Rob Pike
2010-06-29 17:31               ` Devon H. O'Dell
2010-06-29 17:36               ` Francisco J Ballesteros
2010-06-29 17:48                 ` Francisco J Ballesteros
2010-06-29 18:02                   ` Jack Johnson
2010-06-29 18:10               ` Eric Van Hensbergen
2010-06-29 18:12                 ` Francisco J Ballesteros
2010-06-29 20:30                   ` Eric Van Hensbergen
2010-06-29 18:32                 ` erik quanstrom
2010-06-29 20:45                   ` Eric Van Hensbergen
2010-06-29 20:52                     ` erik quanstrom
2010-06-29 21:03                       ` ron minnich
2010-06-29 21:36                         ` Steve Simon
2010-06-29 21:54                         ` Charles Forsyth
2010-06-30  9:25                           ` Lucio De Re
2010-06-29 22:35                         ` cinap_lenrek
2010-06-29 23:00                         ` Russ Cox [this message]
2010-06-30  8:17                           ` Lucio De Re
2010-06-29 21:15                       ` Devon H. O'Dell
2010-06-29 21:27                         ` ron minnich
2010-06-26  7:37       ` [9fans] Go/Inferno toolchain (Was: comment and newline in define) Ethan Grammatikidis

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=AANLkTinKtxq7nnwS86g8ejpECFM8zquorijKcs2NTxyj@mail.gmail.com \
    --to=rsc@swtch.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).