9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@9fans.net
Subject: Re: [9fans] 9vx
Date: Sat, 28 Jun 2008 11:23:27 -0400	[thread overview]
Message-ID: <20080628152138.4217D1E8C35@holo.morphisms.net> (raw)
In-Reply-To: <56bcf448db0216b0bc935cb543658ab4@proxima.alt.za>

Replying to many messages/threads ...

----------
> i've not had a chance to look through the sources.  is a windows port
> feasible?

It should be doable.  You need equivalents of mmap,
mprotect, munmap, signal handlers, timer signals,
and some function to install new segment descriptors.
All of these exist on Windows XP.  The last may or may
not exist anymore on Vista; I have heard conflicting reports.

It's doable, but you'd have to be comfortable with writing
and debugging very low-level code.  It is close to bringing
Plan 9 up on a new machine.  Easier to debug than real
hardware, but that's not saying much.  And getting floating
point working is typically more difficult than on real hardware,
since the hardware has an accurate manual.


----------
> If you call translating the X API to Win32 or C++ .NET feasible, then yes!
> I'm struggling to Cocoa-ize it. It seems like a much easier job than with
> drawterm.

The graphics code should be the least of your problems.
That code hasn't been changed much since drawterm,
so you should be able to just drop the drawterm version in.

> I believe the only folder you need to update is src/9vx/x11. It's seven
> files of pure evil.

Thanks for the ringing endorsement.

> I'm struggling to Cocoa-ize it. It seems like a much easier job than with
> drawterm.

Instead of starting over, just drop in the drawterm code
and adjust until it fits.  It's almost exactly the same interface.

In fact much of the code is exactly the same as drawterm,
there's just this new x86 engine dropped into the mix.
I would definitely look there first if I wanted to add something.


----------
> I haven't looked at anything at all, but I've also never seen such a
> happy reception on this list.  Please excuse the possible stupidity of
> this question: is a Plan 9 port feasible?

Not with Plan 9 as it stands right now.  The virtual memory
system is really not set up for page-at-a-time mappings
like 9vx needs, and there's no facility to create new segment
descriptors, though that would be easier to fix.  One also
wonders what use it would be.  You could just start a new
shell and fiddle with its name space instead.


----------
>> Well, unless I'm missing something either obvious
>> or clever, the answer is no.  A Linux special file
>> looks like a zero length regular file to 9vx.  I
>> probably should have expected that.
>
> the bits from p9p's _p9dir.c which were discussed the
> other day could be used to solve that problem.

Added these yesterday afternoon (still have to set up
a public repository somewhere.)

> I guess I'll sleep on the question of whether to just
> use regular files or do something like a driver to
> go with devsd.

I added devsd and wrote an sd loopback yesterday afternoon.
It worked pretty well except that when I ran fdisk,
/dev/sd00/data disappeared.  I was going to debug that
before saying anything.

vx32% ls -l /dev/sd*
--rw-r----- S 0 rsc rsc 0 Jun 27 15:39 /dev/sdctl
vx32% bind '#Z' /n/unix
vx32% ls -l /n/unix/dev/sda
--rw-rw---- Z 2 root rsc 250059350016 May 17 16:12 /n/unix/dev/sda
vx32% echo loop rw /n/unix/dev/sda >/dev/sdctl
vx32% ls -l /dev/sd*
--rw-r----- S 0 rsc rsc            0 Jun 27 15:39 /dev/sd00/ctl
--rw-r----- S 0 rsc rsc 250059350016 Jun 27 15:39 /dev/sd00/data
-lrw------- S 0 rsc rsc            0 Jun 27 15:39 /dev/sd00/raw
--rw-r----- S 0 rsc rsc            0 Jun 27 15:39 /dev/sdctl
vx32% disk/fdisk -p /dev/sd00/data >/dev/sd00/ctl
vx32% ls -l /dev/sd*
--rw-r----- S 0 rsc rsc            0 Jun 27 15:39 /dev/sd00/ctl
--rw-r----- S 0 rsc rsc 243830168064 Jun 27 15:39 /dev/sd00/linux
--rw-r----- S 0 rsc rsc   6226504704 Jun 27 15:39 /dev/sd00/linuxswap
-lrw------- S 0 rsc rsc            0 Jun 27 15:39 /dev/sd00/raw
--rw-r----- S 0 rsc rsc            0 Jun 27 15:39 /dev/sdctl
vx32%


----------
> Wow. This is cool! I can now test my ports locally.  It should be possible
> for two 9vx instance to communicate with each other right?

Sure.  They all share the host's IP stack.

Also, I should add that #Z knows how to open
Unix domain sockets, you can mount p9p servers:

vx32% bind '#Z' /n/unix
vx32% aux/stub -d /mnt/factotum
vx32% mount /n/unix/tmp/ns.rsc.:0/factotum /mnt/factotum
vx32% ls -l /mnt/factotum
-lrw------- M 15 rsc rsc 0 Jun 28 11:11 /mnt/factotum/confirm
--r-------- M 15 rsc rsc 0 Jun 28 11:11 /mnt/factotum/conv
--rw------- M 15 rsc rsc 0 Jun 28 11:11 /mnt/factotum/ctl
-lrw------- M 15 rsc rsc 0 Jun 28 11:11 /mnt/factotum/log
-lrw------- M 15 rsc rsc 0 Jun 28 11:11 /mnt/factotum/needkey
--r--r--r-- M 15 rsc rsc 0 Jun 28 11:11 /mnt/factotum/proto
--rw-rw-rw- M 15 rsc rsc 0 Jun 28 11:11 /mnt/factotum/rpc
vx32%

(The aux/stub is needed because p9p factotum doesn't
present the top-level factotum directory that Plan 9's does,
unless you start it with the -x flag.  Could make that an
attach specifier instead.)


----------
>> libvx32/freebsd.c:20:2: warning: #warning "libvx32 and FreeBSD 5 and 6's libpthread are not compatible."
>>
>> I guess the priority of my "upgrade laptop's FreeBSD" thread has
>> just increased.
>
> Life is so boring when your OS doesn't break compatibility with
> existing APIs every other release... but my heart is torn between
> FreeBSD and OS X; ah I got the solution: whoever breaks backwards
> compatibility (again) first wins! I'm in a hurry to pick my next OS,

FreeBSD is *very* good about backward compatibility,
about as good as Plan 9 is.  I can still run decade old
FreeBSD binaries.  The problem here isn't backward
compatibility.  It's that FreeBSD, like Linux and the others,
took a while to figure out that threads really need to
be implemented by the kernel, and they didn't get around
to that until FreeBSD 7.


----------
My plan is to push out a new release once someone
finds and fixes the OS X cpu bug.  Anyone?



Russ



  reply	other threads:[~2008-06-28 15:23 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27 11:07 9vx Russ Cox
2008-06-27 13:18 ` [9fans] 9vx David Leimbach
2008-06-27 13:40   ` David Leimbach
2008-06-27 13:46     ` Pietro Gagliardi
2008-06-27 13:50       ` Russ Cox
2008-06-27 13:58         ` a
2008-06-27 13:56       ` David Leimbach
2008-06-27 13:49     ` a
2008-06-27 13:59       ` Russ Cox
2008-06-27 13:49     ` Latchesar Ionkov
2008-06-27 13:57       ` David Leimbach
2008-06-27 13:52     ` Russ Cox
2008-06-27 13:58       ` David Leimbach
2008-06-27 13:58       ` Venkatesh Srinivas
2008-06-27 14:08         ` john
2008-06-27 14:12           ` erik quanstrom
2008-06-30 15:32             ` sqweek
2008-06-30 16:09               ` Russ Cox
2008-06-30 17:00                 ` andrey mirtchovski
2008-06-30 17:07                   ` andrey mirtchovski
2008-06-30 18:02                   ` Russ Cox
2008-06-30 18:34                     ` andrey mirtchovski
2008-06-30 18:44                       ` Russ Cox
2008-06-27 14:19           ` Russ Cox
2008-06-27 14:10         ` Gorka Guardiola
2008-06-27 14:11           ` erik quanstrom
2008-06-27 14:21       ` David Leimbach
2008-06-27 14:29         ` Russ Cox
2008-06-27 14:30         ` Pat Hacker
2008-06-27 14:32           ` Francisco J Ballesteros
2008-06-27 14:34             ` David Leimbach
2008-06-27 14:39             ` andrey mirtchovski
2008-06-27 14:45               ` David Leimbach
2008-06-27 14:47                 ` David Leimbach
2008-06-27 14:55               ` andrey mirtchovski
2008-06-27 15:31             ` andrey mirtchovski
2008-06-27 14:57 ` ron minnich
2008-06-27 15:14   ` ron minnich
2008-06-27 15:17   ` Russ Cox
2008-06-27 15:52     ` ron minnich
2008-06-27 17:39       ` ron minnich
2008-06-27 18:57         ` Pietro Gagliardi
2008-06-27 18:59         ` David Leimbach
2008-06-27 21:39           ` ron minnich
2008-06-27 22:51             ` David Leimbach
2008-06-27 23:29             ` Brian L. Stuart
2008-06-28  0:36               ` ron minnich
2008-06-28  4:59               ` Brian L. Stuart
2008-06-28 11:25                 ` erik quanstrom
2009-04-28  5:10     ` ron minnich
2009-04-30 14:12       ` Russ Cox
2008-06-27 15:41   ` Uriel
2008-06-27 15:54     ` ron minnich
2008-06-27 23:13 ` Skip Tavakkolian
2008-06-27 23:24   ` Skip Tavakkolian
2008-06-27 23:34   ` Pietro Gagliardi
2008-06-27 23:52     ` David Leimbach
2008-06-28  5:03   ` lucio
2008-06-28 15:23     ` Russ Cox [this message]
2008-06-28 17:29       ` lucio
2008-06-28 17:30       ` Pietro Gagliardi
2008-07-01  2:29       ` Anthony Martin
2008-07-01  9:09         ` erik quanstrom
2008-07-01 12:10         ` Russ Cox
2008-07-01 13:25           ` erik quanstrom
2008-07-01 14:40             ` Russ Cox
2008-07-01 17:23               ` erik quanstrom
2008-07-01 17:32                 ` Russ Cox
2008-07-01 18:50                   ` erik quanstrom
2008-07-01 19:11                     ` rc bug Russ Cox
2008-07-01 21:13                       ` [9fans] " erik quanstrom
2008-07-01 21:28                         ` [9fans] 9vx ps bug Russ Cox
2008-07-01 21:59                       ` [9fans] rc bug Fazlul Shahriar
2008-07-01 23:11                         ` Russ Cox
2008-07-01 23:12                           ` erik quanstrom
2008-07-01 23:31                             ` Russ Cox
2008-07-01 23:38                               ` erik quanstrom
2008-06-28 17:28     ` [9fans] 9vx Pietro Gagliardi
2008-06-28 17:35       ` Pietro Gagliardi
2008-06-27 23:41 ` Dave Eckhardt
2008-06-27 23:52   ` David Leimbach
2008-06-28  0:23   ` Uriel
2008-06-28 15:32     ` David Leimbach
2008-06-28  4:36 ` Fernan Bolando
2008-12-21 19:19 erik quanstrom
2008-12-22 18:52 ` Russ Cox
2023-06-25  5:53 Ben Huntsman
2023-06-25 18:59 ` David du Colombier
2023-06-26  9:28 ` Stuart Morrow
2023-06-26 13:39   ` hiro
2023-06-26 17:49     ` ibrahim via 9fans

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=20080628152138.4217D1E8C35@holo.morphisms.net \
    --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).