9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] vnc-like cpu service
@ 2005-10-13 15:11 Russ Cox
  2005-10-13 15:40 ` andrey mirtchovski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Russ Cox @ 2005-10-13 15:11 UTC (permalink / raw)
  To: 9fans

If anyone is looking for an interesting project, here's a simple
way to get a vnc-like cpu service for Plan 9.  This would let you
drawterm in to a session, then later drawterm in from somewhere
else and get the same rio workspace.  (The first session would
disconnect at that point if it hadn't already.)  It's like VNC, but
you get to keep /mnt/term.

The hard part is to write a file server aux/redraw, which mounts
itself on /dev and serves the usual console-related files:
/dev/cons, /dev/consctl, /dev/mouse, and /dev/draw.
These get redirected to the corresponding files in /mnt/term/dev,
but redraw snoops on the draw state, keeping a copy tucked away.
If you write "refresh" to /dev/consctl, redraw reopens all the
/mnt/term files and reestablishes the /dev/draw state in
/mnt/term/dev/draw.

Then the vnc-like cpu service just runs a loop like this:

    system("aux/redraw");
    announce();
    for(;;){
        fd = accept();
        fd = cpuprotocol(fd);
        unmount("/mnt/term");
        mount(fd, "/mnt/term");
        fd = open("/dev/consctl");
        write(fd, "refresh", 7);
        close(fd);
    }

The draw protocol is completely detailed in draw(3) and one
could certainly adapt devdraw.c as first cut at aux/redraw.

Any takers?
Russ


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] vnc-like cpu service
  2005-10-13 15:11 [9fans] vnc-like cpu service Russ Cox
@ 2005-10-13 15:40 ` andrey mirtchovski
  2005-10-13 18:52 ` rog
  2005-10-14 23:05 ` McLone
  2 siblings, 0 replies; 5+ messages in thread
From: andrey mirtchovski @ 2005-10-13 15:40 UTC (permalink / raw)
  To: 9fans


i had started along the same lines four months ago (using the vncs
devices as a guide) in an attempt to have persistent drawterm
connections, but couldn't figure out the "refresh" step.  i admit my
plan9-fu is not as good as it should be -- i should've known how to do
that.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] vnc-like cpu service
  2005-10-13 15:11 [9fans] vnc-like cpu service Russ Cox
  2005-10-13 15:40 ` andrey mirtchovski
@ 2005-10-13 18:52 ` rog
  2005-10-14 23:05 ` McLone
  2 siblings, 0 replies; 5+ messages in thread
From: rog @ 2005-10-13 18:52 UTC (permalink / raw)
  To: 9fans

this is very like something that Chris Locke did
inside inferno (drawmux). this program allowed
multiple remote clients to view a draw session,
by snooping on the draw state exactly as you suggest.

the main difference was that in that scenario, the
draw snoop ran on the terminal, using its local display,
as opposed to running on a CPU server, using a terminal's
remote display.

however the form of the required code is very similar.
it's in /appl/wm/drawmux/drawmux.b in the inferno distribution;
it might be useful as a template for a plan 9 version.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] vnc-like cpu service
  2005-10-13 15:11 [9fans] vnc-like cpu service Russ Cox
  2005-10-13 15:40 ` andrey mirtchovski
  2005-10-13 18:52 ` rog
@ 2005-10-14 23:05 ` McLone
  2005-10-15  2:07   ` Russ Cox
  2 siblings, 1 reply; 5+ messages in thread
From: McLone @ 2005-10-14 23:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 10/13/05, Russ Cox <rsc@swtch.com> wrote:
> drawterm in to a session, then later drawterm in from somewhere
> else and get the same rio workspace.  (The first session would
> disconnect at that point if it hadn't already.)
i'd prefer a multiplexer, like *n*x screen(1) does.
One can even run presentations and live tutors within.
--
wbr,                        |\      _,,,---,,_           dog bless ya!
`                       Zzz /,`.-'`'    -.  ;-;;,_
McLone at GMail dot com    |,4-  ) )-,_. ,\ (  `'-'
, net- and *BSD admin     '---''(_/--'  `-'\_)   ...translit rawx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] vnc-like cpu service
  2005-10-14 23:05 ` McLone
@ 2005-10-15  2:07   ` Russ Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Russ Cox @ 2005-10-15  2:07 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> > drawterm in to a session, then later drawterm in from somewhere
> > else and get the same rio workspace.  (The first session would
> > disconnect at that point if it hadn't already.)
> i'd prefer a multiplexer, like *n*x screen(1) does.
> One can even run presentations and live tutors within.

Fine, do a multiplexer.  I guess then you'd have
/mnt/term/0 /mnt/term/1 etc.  The single-client
approach means you don't change the usual
meaning of /mnt/term.  I'm happy to have a
mux and run it in single-guy mode.

Russ


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-10-15  2:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-13 15:11 [9fans] vnc-like cpu service Russ Cox
2005-10-13 15:40 ` andrey mirtchovski
2005-10-13 18:52 ` rog
2005-10-14 23:05 ` McLone
2005-10-15  2:07   ` Russ Cox

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).