Posts

Showing posts from September, 2004

lab 8 - treemap

Image
NAME lab 8 - small update to treemap. DESCRIPTION Tmap is a small util that takes the output of du and presents a treemap using algorithms from UMD HCILab To make it a bit more useful I want to zoom into the treemap and zoom out again. Button one selects a rectangle highlights it and it's path and presents information about the path and file sizes. Button two zooms one level into the selected area, where the mouse clicked. Button three zooms out one level. This was easy to add using Tk. I bind a command to the mouse events and send a message down a channel. On receiving the message I change the root of the tree, regenerate the layout and redraw the rectangles. CONCLUSION I find this a useful tool to find patterns in disk usage, such as large or duplicate files. Often the file hierachies are very deep, and so drilling down interactively is great. I should re-implement ...

lab 7 - sequencer

NAME lab 7 - sequencer; create a simple sequencer that can play back a subset of SKINI messages. SETUP Inferno 4th Edition release 20040830. DESCRIPTION 2004/0928 20:37 SKINI is the sequencing language from the STK. It is a readable form of MIDI, and was designed to be "extensable and hackable"; all of which make it ideally suited to this application and Inferno. Here is a brief example // Measure number 1 =0 NoteOn 0.416667 2 72 64 NoteOff 0.208333 2 72 64 NoteOn 0 2 71 64 NoteOff 0.208333 2 71 64 NoteOn 0 2 72 64 NoteOff 0.416667 2 72 64 NoteOn 0 2 67 64 NoteOff 0.416667 2 67 64 There is one command per line. The line begins with command name followed by parameters separated by space or tabs. The second parameter is always the time delta. For the NoteOn command, the third argument is channel (or...

lab 6 - signal filter

NAME lab 6 - signal modules; implement filter (again) for signalfs and test the recursiveness of the file server. SETUP Inferno 4th Edition 20040830. See also labs 4 an 5. DESCRIPTION 2004/0922 21:24 Changed filter.b to use the clone interface. The ctl file accepts a source command which takes a filename or another signal source which may be served by the same signalfs % echo source /usr/caerwyn/lab/6/mnt/wave > mnt/filter/2/ctl The filter module then opens ctl reads the number of the conversation directory and then opens data . The filter is then responsible for setup of the signal source. It should probably pass through commands written to ctl that it does not understand, so the wave can be controlled through the filter ctl . I made a small change to signalfs.b to not fork the namespace so the mount of the server affects the current process and the filter module is abl...

lab 5 - signalfs v2

NAME lab 5 - signalfs version 2; generalize and enhance the signalfs still further. Create a server that can load all the signal models, and each module has a connection directory per conversation. SETUP Inferno 4th Edition 20040830. DESCRIPTION The directory hierarchy presented by signalfs is now similar to ip (3). /ctl / module /clone / module / n / module / n /ctl / module / n /data One more requirement is that the server must be recursive, a signal module must be able to open other files served by the same signalfs. (The ds (3) device does this.) To illustrate, say we implement a module to return a Fibonacci number. I use the clone mechanism so each client has it's own connection to the module. To read the fifth Fibonacci number { d=/mnt/modfs/`{read 10} echo 5 >[1=0] read 10 } /mnt/modfs/clone The module itself uses the c...

lab 4 - signalfs

NAME lab 4 - signalfs; generalize wavefs to a family of file servers that support a variety of sound sources and filters. SETUP Inferno 4th edition release 20040830. Using wavefs and the Synthesis Toolkit in C++. DESCRIPTION I started with the wavefs source and abstracted out an interface for modules that the fileserver can call. The signal processor implements this interface. The compiled dis module that implements a specific dsp is passed as parameter to the signalfs which exports the standard files /signal /signalctl The interface is quite simple Signal: module { configstr: string; init: fn(args: list of string); config: fn(s: string); tickFrame: fn(): array of real; }; Messages written to /signalctl are passed to config , and reads return the contents of Signal.configstr . Reads from /signal , which is readonly, are sent data generated by tickFrame . I rewrote the wave loop modu...

lab 3 - wavefs

NAME lab 3 - create a filesystem, wavefs, that serves a looped waveform. This is our staring point for playing with DSP. SETUP Inferno 4th edition release 20040830. Using styxservers (2), audio (3), audio (6). and Synthesis Toolkit in C++ stk . Emu is running hosted on Windows XP. (I haven't gotten the sound figured out yet using esd.) DESCRIPTION I've been looking for tools to experiment with DSP. The synthesis toolkit has a good all round collection of DSP routines and the code is easy enough to read. I wanted this "sound workbench" well integrated with inferno. Where possible make the resources files or file2chans. The first step was to make a sound source; an oscillator. For this I created a file server that serves two files /ctl /data I started with the sample code from styxservers-nametree (2). The server is given a raw audio file to loop. I took the ...

lab 2 - cryptfs

NAME lab 2 - use file2chan to create a cryptfile that encrypts/decrypts all read and writes to an underlying file. This cryptfile can then be used by kfs to create a crypt file system. SETUP Inferno 4th edition release 20040830. Using kfs(4), file2chan(2), keyring-crypt(2). DESCRIPTION Keyring-crypt contains ECB algorithms for block encryption and random access to files. I'll use the Ideaecb for this session. I setup a simple file2chan prog that layers atop another file and passes through the read/writes. cryptfile0.b Tested this. % > t1 % cryptfile0 /chan/crypt t1 % echo this is a test > /chan/crypt % cat /chan/crypt this is a test % ls -l /chan/crypt --rw-rw---- s 0 caerwyn caerwyn 0 May 27 14:41 /chan/crypt The size of the file is always 0. I checked the /appl/cmd/disk/kfs.b for calls it makes to the file. All reads and writes are blocks; blocksize can be given as a parameter. It...

lab 1 - postdate

NAME lab 1 - implement ideas from postdate in inferno sh. write shell functions that are polymorphic along the valid timeline. SETUP Inferno 4th edition release 20040830. Using sh (1), and tickfs (1) and associated commands, rng (1), taq (1). DESCRIPTION Sh has command blocks which can be passed as params to commands, and executed. I want to exploit this to see if I can implement much of the flavor of Postdate in the shell. I already have tickfs in Inferno which supports bi-temporal binary relations. So the value for a tickfs entry could be the sh command block. Create a new relation with entry of command block % mount -c {tickfs} /n/tick % touch /n/tick/sh.bt % echo ${quote i . add {fc $1 $2 +}} > /n/tick/sh.bt % rng , |taq -1rm /n/tick/sh.bt 1094173750 add '{fc $1 $2 +}' I want shell function to return the command block from tickfs. It has to be a substitution function t...