David Hoskin: Portfolio



9webdraw is a Web-based graphical terminal for Plan 9, implementing the draw(3) protocol in Javascript. It draws to the HTML5 Canvas, and communicates with the Plan 9 host using the 9P filesystem protocol tunneled over a WebSocket. It was initially developed as part of the 2013 Google Summer of Code, and has since been included in the 9atom distribution of Plan 9.

A log of its development was maintained throughout the 2013 GSoC, including screenshots of enhancements as they were made.



Weebsocket is an implementation in C of the WebSocket protocol as a plugin for Plan 9's web server. It has been included in the 9atom distribution of Plan 9.



Yar is Yet Another Raytracer, written for my 300-level graphics class and comprising about 600 lines of Plan 9 C. It recursively renders spheres and planes with Phong illumination, reflections, shadowing, multiple lighting, and randomised antiäliasing.

It is fully multithreaded, and scales nearly perfectly (tested up to 8 cores) on a single machine.

(click to enlarge)



This is a very simple implementation of coöperative multithreading. It uses specially constructed setjmp(2) buffers to transfer control to a heap-allocated stack for each thread, and yield() simply records the thread's state with setjmp() before longjmp()ing back to the control routine.



demofs is a synthetic filesystem for Plan 9, which implements fun demos such as a “filesystem calculator”:

% cd /tmp/demo/sum/1/2/3/4/5/6/7/8/9; lc
avg sum
% echo sum `{cat sum} avg `{cat avg}
sum 45 avg 5



This is a school project from a 300-level operating systems course. It uses pthread mutices and a priority queue to simulate the scheduling of batch jobs as they arrive.