This directory contains a few of the software elements
described in the paper presented at the 2002 SANE conference:
Diomidis Spinellis. The information furnace: User-friendly home control. In Proceedings of the 3rd International System Administration and Networking Conference SANE 2002, pages 145-174, Maastricht, The Netherlands, May 2002.
and in a companion journal article:
Diomidis Spinellis. The information furnace: Consolidated home control. Personal and Ubiquitous Computing, 7(1):53-69, 2003.
The linked pages do not contain navigation links.
Use your browser's back button to return to this page.
Parallel I/O Device Driver
The source files in this section comprise a FreeBSD device driver for the
Adaptec PCL-724 card.
The PCL-724 card emulates the Intel 8255A programmable
peripheral interface chip running in mode 0 (simple I/O).
It provides two 8-bit ports (port A and port B) and
two 4-bit ports (port C upper, port C lower).
Each port can be individually programmed for input and
(latched) output and appears at a different offset of the device's
base I/O address.
A separate register allows the configuration of ports for input
The device is so simple, that reliably probing for it when
input data arrives at its terminals is impossible;
therefore the kernel configuration has to specify the
device's base address.
The device driver provides four character devices that
correspond to the card's I/O ports.
Opening a device for read or write, automatically configures
the corresponding hardware port for input or output.
Initially all ports are set for input to avoid damaging
# Parallel (8255 PPI) basic I/O (mode 0) port device pbio0 at isa? port 0x360To create the devices go into the /dev directory and run:
mknod c 32 0 pbio0a mknod c 32 1 pbio0b mknod c 32 2 pbio0ch mknod c 32 3 pbio0cl
Playlists are generated by a sed(1) command that prints the master playlist from the music part selected until its end. The master playlist contains the location of MP3 files, and, as comments, the number used to access the particular track or CD. I use 3 and 4-digit numbers for complete CDs and five-digit numbers for individual tracks:
# 521 # 10297 /vol/music/Classical/Bach/FrenchSuites/cd1/track01.mp3 # 10298 /vol/music/Classical/Bach/FrenchSuites/cd1/track02.mp3 # 10299 /vol/music/Classical/Bach/FrenchSuites/cd1/track03.mp3As music is sorted and traversed according to its content, when the player finishes the selected track or CD, it will continue playing roughly similar content.
A separate function allows the shuffling of complete collections. These are defined as files in a separate directory. Each file contains a line specifying the collection number, and a sequence of lines containing CD numbers:
CN 5 690 691 692 694Playing the given collection will randomly shuffle the tracks from all CDs comprising the collection. Shuffling of music tracks is simply accomplished using the NetBSD shuffle(1) command.
The MP3 files of each CD are organised into a separate directory. The files are named following the trackNN.mp3 convention. Each directory also contains the disk's FreeDB identifier, and two automatically generated files used for indexing and cataloging the collection.
index.txt (indexing for list creation) file contains:
# Index DN 709 TN 12763^Atrack01.mp3 TN 12764^Atrack02.mp3 TN 12765^Atrack03.mp3 TN 12766^Atrack04.mp3 TN 12767^Atrack05.mp3 TN 12768^Atrack06.mp3 TN 12769^Atrack07.mp3 TN 12770^Atrack08.mp3 TN 12771^Atrack09.mp3 TN 12772^Atrack10.mp3 TN 12773^Atrack11.mp3
info.txt (CDDB saved output) file contains:
# Disk information DI 8f0b650b 11 150 22570 29675 56235 64782 95550 115047 144962 157867 179202 196130 2911 AL A Chorus Line GE soundtrack AR Joseph Papp NT 11 DU 2911 TR 01^AI Hope I Get It^Atrack01.mp3 TR 2^AI Can Do That^Atrack02.mp3 TR 3^AAt The Ballet^Atrack03.mp3 TR 4^ASing!^Atrack04.mp3 TR 5^AHello Twelve, Hello Thirteen, Hello Love^Atrack05.mp3 TR 6^ANothing^Atrack06.mp3 TR 7^AThe Music And The Mirror^Atrack07.mp3 TR 8^ADance: Ten; Looks: Three^Atrack08.mp3 TR 9^AOne^Atrack09.mp3 TR 10^AWhat I Did For Love^Atrack10.mp3 TR 11^AOne (Reprise)^Atrack11.mp3
mklist program creates (using the above files) human and machine
readable versions of the music collections:
the list in HTML and LaTeX format, and the master playlist that
All scripts expect the disk database to reside under
/vol/db and individual music directories under
The montty program will run as a daemon, taking as arguments the serial line to monitor (e.g. cuaa0) and a sequence of initialisation strings to send to the line once it acquires control over it. Example (for obtaining CLID from Intracom's NetMod):
montty cuaa0 'AT\r\n' 'ATZ\r\n' 'ATS82=76\r\n'Input read from the device is logged using the LOCAL0 logging facility.
The program works by polling for data on the device port and trying to acquire an exclusive lock to read it. If no lock can be acquired we assume that another program (e.g. the PPP daemon) is controlling the device and sleep. The initialisation string is only sent to the device after we detect that another program has messed with it. It has been tested under FreeBSD 4.1.
Diomidis Spinellis home page