Plan 9 Google Summer of Code 2014

Hi, I'm David Hoskin, a fourth-year student at the University of Victoria.

I'm working on 9webdraw again for the Google Summer of Code, 2014.

9webdraw is a JavaScript implementation of drawterm for the Web, using HTML5 <canvas> and WebSockets.

A drawterm is a graphical remote desktop for Plan 9, which takes advantage of Plan 9's “everything is a filesystem” approach: it uses the 9P network filesystem protocol to export /dev/draw, /dev/mouse, /dev/cons and so on, which are mounted by a process on the server, and then used in the same way it would use the local devices provided by the kernel.

I started development of 9webdraw last year, for the 2013 Google Summer of Code. I continued some work on it over the winter, adding keyboard and mouse input, and rewriting the WebSocket server in C as an httpd(8) magic plugin.


I fixed some of the most annoying keyboard bugs: [tab] and [enter], and control characters work. Surprising events on middle- and right- clicks should be suppressed now.

I reworked the implementation of some of the graphics functions. For some unimaginable reason, I had been manually manipulating scalar x- and y-values, which was needlessly tedious and error-prone. Replacing that mess with Point and Rect objects and corresponding higher-level operations fixed up some bugs on its own, and enabled great cleanups throughout the code.

At this point, the Acme text editor, which I have been using as a test case, renders pretty much perfectly.

Rio can now display overlapping windows. Repainting all windows from back to front on each update (the painter's algorithm) worked, but was too slow. For now, I am using CSS to position each window's backing canvas directly over the screen. I am working on a proper implementation of memlayer(2) to clip overlapping windows natively.

Rio's own windows work perfectly, but clients run within them take over the entire screen. I think this is a simple problem, but I haven't investigated it yet.

I implemented native drawing functions in terms of pixel arrays as a replacement for canvas-native drawing, but I'm not sure if I'll actually use them.

Mail log

Wednesday, August 20th 2014
[gsoc] webdraw - wrapping up
Wednesday, July 7th 2014
[gsoc] webdraw - alphadraw
Friday, June 13th 2014
[gsoc] webdraw - rio works
Wednesday, June 4th 2014
[gsoc] webdraw - points and clipping
Saturday, May 31st 2014
[gsoc] acme selection is finally fixed!
Monday, May 5th 2014
[gsoc] web drawterm - getting started