From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 3 Nov 2011 00:05:05 -0700 Message-ID: From: Akshat Kumar To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] 9p devdraw Topicbox-Message-UUID: 3d92ee52-ead7-11e9-9d60-3106f5b1d025 Thanks for this - I often wonder where to find the code behind the papers in IWP9 proceedings. ak On Wed, Nov 2, 2011 at 12:29 PM, yy wrote: > Two attached files: > > - 9p-srv.c is a devdraw(1) version which uses 9pclient(3) to talk with > Plan 9-like devices and use them for its windows. > > - p9p.patch is a patch that has to be applied to the p9p tree to use > this devdraw version. > > The drawing device expects to find draw(3), cons(3) and mouse(3) files > in the $WSYS directory, as can be found in /dev in a Plan 9 terminal > (including 9vx or drawterm) or /mnt/wsys when using rio. Then, those > devices are used to run p9p programs. > > I wrote 9p-srv as an experiment to use wsys(4) [1] with p9p > applications, but have found it quite useful to open p9p programs - > like 9term or sam - in rio windows (for example, from 9vx). > > Although it could be argued that this is not the most efficient thing > to do writing it was quite funny, and much easier than expected. > > Installation (once the patch has been applied and p9p built): > > =A0 =A0 =A0 =A0cp 9p-srv.c $PLAN9/src/cmd/devdraw > =A0 =A0 =A0 =A0cd $PLAN9/src/cmd/devdraw > =A0 =A0 =A0 =A09c 9p-srv.c && 9l -o devdraw.9p 9p-srv.o > =A0 =A0 =A0 =A0cp devdraw.9p $PLAN9/bin > > Now, to run 9term in a rio window: > > =A0 =A0 =A0 =A0# From 9vx's rio: > =A0 =A0 =A0 =A0; mount $wsys /n/w new > =A0 =A0 =A0 =A0; bind -a '#i' /n/w > =A0 =A0 =A0 =A0; aux/listen1 -t 'tcp!*!12345' /bin/exportfs -r /n/w > > =A0 =A0 =A0 =A0# From unix: > =A0 =A0 =A0 =A0$ WSYS=3D'tcp!127.0.0.1!12345' > =A0 =A0 =A0 =A0$ DEVDRAW=3Ddevdraw.9p > =A0 =A0 =A0 =A0$ 9term > > These files are also included with wsys(4), in the util directory > (instructions are in the README). To use the drawing device with > wsys(4) just set WSYS to "unix!/tmp/ns.$USERNAME.$DISPLAY/wsys". > However, it is not working so well as with rio. The reason is probably > some bug in wsys, and not in 9p-srv. I hope to fix it at some point, > but is not an easy bug to track. > > If (after some more testing) the 9p drawing device could be included > with p9p that would be great. If it has to stay in the wsys repository > that is fine too but, could the p9p patch be applied at least? The two > small changes shouldn't be a problem for the other versions of > devdraw. > > Comments are welcomed. > > > [1] http://bitbucket.org/yiyus/devwsys-prev/ (there is also a blog > about the development of wsys(4) at > http://summerofdevdraw.blogspot.com/ and a WIP short paper is included > in the proceedings of the last iwp9). > > -- > - yiyus || JGL . >