Posted by avsm
Sat, 04 Jun 2005 15:14:18 GMT
Finally had some time to get back from the OpenBSD hackathon and take stock of what I worked on. It was pretty interesting one this year, as I went without having much idea of what to work on (unlike last year, when I had a mad backlog to catch up on). Some stuff I did during the week included:
- Clean up the atomicio interface used in OpenSSH and nc(1) to provide simpler semantics. Error checking from read/write functions are a real headache in C, as the functions return -1 on error, which means a signed ssize_t is returned. However, they accept an unsigned value as the size of the buffer to process, which means they could potentially return a value outside the range of the return value. This means you have to check if the return is -1, which indicates an error, and otherwise cast to a size_t to correctly get the buffer size back. With the new atomicio, it always returns a size_t, and returns 0 to signal an error (with errno containing the error, and EPIPE being set for an EOF condition).
- Start looking at the Bluetooth stack to get L2CAP and RFCOMM support. We are half-way through un-netgraphing the FreeBSD stack and having a more traditional netbt socket interface (much like netinet or netinet6) to Bluetooth.
- Use CIL to implement a few fun kernel source->source transforms. kerneltrace just accepts a regular expression and inserts a printf in the function prologue which outputs the function name and any arguments passed into it. Had this idea when chatting with Marius, and it turned out to be very useful when trying to figure out dataflow in the Bluetooth stack (just compile with make CC="/usr/local/bin/cilly --dokerneltrace --trace-regexp='ubt|ng_blue'").
The second one was even simpler; randomvars assigns a non-zero value to every local variable in a function call to help track down uninitialized-local-variable bugs. Heres one Chad Loder found in mg(1).
- Other random signed/unsigned cleanups in OpenSSH. Boring but important I guess...
All in all, the hackathon re-motivated me to continue work on the OCaml-based daemons that Dave and I have been hacking on. I don't want to be fixing random buffer or integer overflows in an OpenBSD hackathon 5 years from now; we need to move on to more high-level issues.
Posted in hacking, openbsd | no comments
Posted by avsm
Mon, 23 May 2005 20:00:04 GMT
I got tired of trying to combine the various blogging and gallery tools
into something that did what I wanted: take a simple directory of images,
blog entries, links, papers and output a nice HTML/RSS version of the
directory. So I hacked up a quick blog tool in OCaml that does the trick,
and put it live.
Its got quite a few rough edges at the moment, especially to do with
the lack of date archives and the large number of images on the front page
of the gallery.
Note that the location of the RSS links have changed as well, as I've
switched to using ocaml-rss for outputting
it instead of the homebrew format used before in blosxom.
One thing that has come out really well is the use of a flat tag namespace instead of the previous directory structure; it allows me to share stories and images among multiple categories without needing symlink hacks.
Posted in hacking, recoil | no comments
Posted by avsm
Wed, 04 May 2005 15:34:13 GMT
I got tired of using the older version of Subethaedit just for its OCaml syntax highlighting mode, so I ported the highlighter to the latest version of the editor. You can grab it from my projects page.
I think the only thing Subethaedit needs for perfection would be to be able to revert to a saved version more reliably; right now if I CVS commit a file, I need to close and re-open it in the editor or else the next save goes wrong. That, and a clean tabbed view for multiple document. And ... and ... I guess the list goes on, and it'll just be bloated like crazy!
Posted in hacking | no comments
Posted by avsm
Thu, 21 Oct 2004 04:14:03 GMT
AppleInsider has the scoop on the new features in QuickTime 7, to be part of the next major release of MacOS X. The thing I found particularly interesting is to be found at the end:
|
Likewise, QuickTime 6.6 with also mark the debut of an OpenGL texture context, a specific implementation of the aforementioned visual context that will provide a movie's visual data to a client applications as OpenGL textures. These textures can then be rendered to the screen using OpenGL, composited with other graphics, or run through CoreImage filters.
|
I played with this stuff at Fraser Research last summer, and its great to see more integrated support between QT and OpenGL. This stuff could be done before, but it was really awkward avoiding excessive data copying between main memory and the graphics card texture memory. Hmm, maybe I made a mistake ordering my new HushPC box to run MythTV on; perhaps it ought to have been an iMac instead! The CoreImage API looks pretty useful as well for processing ultra-high resolution images for SpotCode detection as well, something that takes a lot of CPU at the moment.
Posted in hacking, computers | no comments
Posted by avsm
Sun, 10 Oct 2004 17:01:35 GMT
It only took 7 days, 10 phonecalls, and 16 hours of waiting around for engineers to show up to get my NTL cable modem installed at the new flat. The hassle always seems to be getting hold of the installation guys; once they actually arrived, the process took about 15 minutes! I see why this website was set up though...
While moving all the computer kit around, I took the opportunity to upgrade my Soekris NET4521 to the latest snapshot of OpenBSD. I use the flashdist scripts modified to include a few extra things such as ntpd and symon, as well as bring it up to date with the latest snapshots. You can grab the custom kernel config NET45x1 and the distribution set.
Posted in cambridge, hacking | no comments
Posted by avsm
Mon, 16 Aug 2004 20:04:18 GMT
Apparently rumours are flying around at Crypto 2004 that the popular cryptographic hash function SHA-1 has been partially cracked. A collision for SHA-0 was also announced at the conference. More details in Ed Felten's blog.
Posted in hacking | no comments
Posted by avsm
Sun, 15 Aug 2004 12:30:59 GMT
Although dynamically typed (so-called "scripting languages") such as
Python and PHP have been gaining popularity in recent years, statically typed languages which fail on type errors at compile-time as opposed to run-time (e.g. OCaml) are often overlooked. Static typing prevents a number of stupid errors from happening at some random point in a program's execution, but forces the programmer to go through greater effort to actually design the program. I stumbled across the excellent Lambda the Ultimate programming languages weblog which has two great, largely flame-free discussions about the relative merits of both approaches. Check out the threads here and here.
Posted in hacking | no comments
Posted by avsm
Fri, 13 Aug 2004 21:59:11 GMT
Nick pointed me out to an extremely impressive project demoed at SIGGRAPH this year. The algorithm brings two videos into spatio-temporal alignment in order to perform various transforms such as background subtraction, increasing dynamic range, or even nifty compositing effects. There's a really cool video with a voice-over that explains everything, and further information in their paper.
Posted in hacking | no comments
|