Luigi Rizzo -- FreeBSD-related projects
Useful links
FreeBSD:
[SVN repo]
[CVS ports]
[FRESHports]
NetBSD:
[CVS repo]
anoncvs through cvs -d :pserver:anoncvs@anoncvs.NetBSD.org:/cvsroot
OpenBSD:
[CVS repo]
anoncvs through cvs -d anoncvs@anoncvs.de.openbsd.org:/cvs
Dragonfly BSD:
Linux:
[view source]
[kernel.org]
OpenWRT:
[viewvc]
svn co https://svn.openwrt.org/openwrt/trunk/
FreeBSD Compatibility notes
Software issues related to various versions of FreeBSD -- useful
when you need to upgrade to a new version.
FreeBSD Hardware Compatibility
It is becoming more and more problematic to run FreeBSD (but also linux
and other userland code) on newer hardware, so I am writing down some
notes on various hardware I have been playing with recently,
hoping it helps others. You can find these notes at
info.iet.unipi.it/~luigi/FreeBSD/hw.html
Assorted FreeBSD-related code
Some FreeBSD-related projects/code. Over time some of them are
being imported in FreeBSD, and some others have become
stale or obsoleted and are left here only for documentation reasons.
Note: in most cases the code
is in form of a gzipped tar archive. Be careful to instruct your
browser not to treat it as a text file and do unexpected conversions.
- [2009.03.07]
GEOM-based disk schedulers
Fabio Checconi and myself have developed a GEOM-based disk scheduler
for FreeBSD. The scheduler is made of a GEOM kernel module, the
corresponding userland class library, and other loadable kernel
modules that implement the actual scheduling algorithms.
The code is in FreeBSD 8.1 and above.
- [2009.01.12]
kldpatch (formerly
called kmodpatch), an utility
to print/alter the content of device tables in kernel modules
(available as a FreeBSD port).
These tables are generally used to identify
devices, and possibly apply specific quirks to enable/disable certain
features. kmodpatch is especially useful to let the kernel recognise a
new device without rebooting and rebuilding/reinstalling kernel or mod-
ules.
A couple of real life examples:
- kmodpatch umass.ko - @0 0x4050 0x4a5 0x0101 0x4200
set the kernel to use flags UMASS_PROTO_SCSI | UMASS_PROTO_BBB and
quirks WRONG_CSWSIG | NO_SYNCHRONIZE_CACHE for a certain GSM phone
that implements the umass interface;
- kmodpatch uscanner.ko - @0 0x04b8 0x084a 0
let uscanner.ko recognise a newly introduced MFP scanner device.
- [2008.12.30]
epkowa-port, a Freebsd
port of the Epkowa sane scanner backend (version 2.11.0) for various Epson
scanners (or multifunction printer/scanners).
This has been committed to FreeBSD ports as graphics/sane-epkowa
- [2009.01.02]
jpg2pdf is a small C program
to convert one or more JPG file into a PDF or Postscript document.
The program has no external dependencies and exploits the ability of
both PDF and Postscript to process a JPG file through filters: so the
program only produces the glue required to process images,
and has a minimal amount of options to scale the images.
- [2008.12.04]
iso2flash is a simple
script to convert ISO images to disk images that can be copied to
a flash device.
- [2008.12.03] some changes to newfs have been
committed to HEAD, allowing the creation of filesystems on plain files
- [2008.12.03] some changes to newfs_msdos
have been committed to HEAD, simplifynig the creation of filesystems
at arbitrary offsets on plain files
- [2008.12.02] an enhanced version of boot0.S has been
committed to HEAD, together with a matching boot0cfg, supporting
the selection of PXE/INT18 booting with key F6, and preserving
the NT/XP/Vista Volume ID. Committed to HEAD
- [2008.11.26] FreeBSD port of syslinux 3.72
The following tarball, syslinux-20081126.tgz
contains a port of syslinux to FreeBSD.
This is a useful tool to make bootable filesystem images.
Committed to FreeBSD ports as sysutils/syslinux
- [2008.08.19] FreeBSD port of busybox 1.11.1
The following tarball, busybox-port-20080819.tgz
contains a minimal port of busybox to FreeBSD.
Note that some of the system commands that rely on /proc do not work
on FreeBSD, but many other userland commands do their job just fine.
- [2008.07.28] edit annotations on Xpdf
Xpdf is a nice viewer for PDF file. The patch below, written together
with two students of mine, Gaetano Catalli and Matteo Landi,
implements support for freehand in Xpdf, with the option to
save and delete annotations from a file.
This code is on the official freebsd port, ports/print/xpdf,
but you need to build the port with "make WITH_DRAW=yes".
To try the code on an older version of FreeBSD, or on a different
platform, the patch file is
patch-zz-xpdf-annot.20080728a.
On FreeBSD you can put it
into the /usr/ports/graphics/xpdf/files directory,
and rebuild the port.
Then you can click on the Draw button in
xpdf to start an annotation, draw using the left button on the mouse,
and close the annotation with EndDraw. On Quit, or calling the
Save menu with the right button, you can save the modified file.
- [2008.06.02]minixmlrpc,
a very compact
program (and C library) to access XMLRPC servers and manipulate
the results from command line, shell or C programs, without
using a ton of external libraries.
The (dynamically linked) binary is only about 25k,
builds fine on OpenWRT,
and can talk to https servers if you have the openssl libraries.
You can do something like this:
./xmlrpc http://time.xmlrpc.com/RPC2 'currentTime.getCurrentTime()'
./xmlrpc - '{a=3, b=5, c=8}' '.keys()' '[a,c]'
- [2008.06.02]
dynstring-20080602.tgz,
a small set of C functions to implement dynamic C strings (and
byte arrays). This code is derived from something I implemented
some time ago for Asterisk, and is as easy to use as sprintf:
#include "dynstring.h"
...
dynstr s = NULL;
for (i=0; i < 10; i++)
dsprintf(&s, "next comes %d, ", i);
fprintf(stdout, "you wrote [%s]\n", ds_data(s));
ds_free(s);
- [2008.05.22]A firefox
plugin to run arbitrary applications within the browser
- [2008.04.26]patch to prevent
stalls in the 'nfe' driver. At least on the
ASUS M2N-VM DVI" board I have, using
the MCP67 ethernet chip, the 'nfe' driver stalls under heavy load.
The patch above tries to identify the stall condition and reinitialize
the chip to let the machine continue communication.
A related patch addresses
problems with the polling implementation.
- [2008.04.08]xorg.conf for dual-head nvidia,
a sample xorg.conf file to be used for nVidia cards with dual head
support and x11/nvidia-driver port.
- [2007.09.09]FreeBSD Port of xoscope,
an X11 oscilloscope using the soundcard as input device
(see the xoscope home page
on sourceforge).
- [2007.08.28]Support for Epson DX-5000/5050/6000 scanner,
some FreeBSD patches to get better support of the Epson DX-5050,
DX-6000 (and likely also DX-5000 and DX-6050)
printer-scanner. All three devices (scanner, printer, card reader)
are supported. Once you have this working you might want to
install the graphics/tesseract port, a nice OCR
software with support for several languages.
- [2007.07.04]Configuring CUPS to implement print-to-email, some simple instructions to configure cups and cups-pdf to implement
a print-to-email service for windows clients with credential checks (the
CUPS documentation is severely lacking in this area).
- [2007.02.26]Making a dumb switch into a managed one,
describes how to modify a cheap ethernet switch based on the Realtek8316
controller to be monitored/configured through the network
using the RRCP protocol.
- [2007.02.20]linphone-1.6.0.tgz, a port
of linphone with support for v4l webcams.
- [2007.02.09] emulation
layer for Linux device drivers
The goal of this project is to provide a linux compatibility
layer that Linux device drivers can use to be compiled (and work)
as loadable kernel modules under FreeBSD.
We have reached the point where unmodified 'gspca' and "ov'
linux drivers can be built and run with full functionality. See the
linux_bsd_kld
web page for more details, code and binary modules.
- [2007.01.17] enhanced kernel driver
for usb cameras
I am trying to link the pwc kernel driver for usb cameras
with other (available) userland programs that support more
cameras. See details in the linked page.
Note, this is somewhat superceded by the linux_bsd_kld
project above, which supports a lot more cameras.
- [2007.01.15] pwlib patch
pwlib is a library used by the Ekiga (formerly gnomemeeting)
videoconf package. One of its shortcomings is that it fails
to detect video devices on FreeBSD because it checks for the
device type using major/minor device numbers in the filesystem,
which have no meaning anymore with devfs.
The patch above fixes this behaviour letting pwlib detect
/dev/videoX devices.
Now committed to the FreeBSD port devel/pwlib
- [2007.01.01] Fix burncd termination
Apparently many DVD drives do not return a valid progress
indication as a response to the ATAPI_READ_CAPACITY command.
This causes burncd to not terminate. This patch does two
things: 1. in the kernel, disables the check for the
ATA_SENSE_VALID bit, thus enabling non-conforming drives
to return progress information (although it might be bogus);
2. in burncd, uses TEST UNIT READY to check for termination.
- [2007.01.01] DRM support for i915/dell X1
The i915 video chip has two PCI IDs, and the code in the
DRM driver only looks for the second one. This patch adds
it to the list of recognised identifiers.
With this, the Options "drm" and "dri" in xorg.conf,
and graphics/dri installed, hardware acceleration works
on the card.
- [2006.12.13] Patch to enable agpgart on the i945 [committed to RELENG_6, 2006.12.30]
This patch (against a FreeBSD RELENG_6 kernel of 2006.12.23) enables
agpgart on i945 video cards. It touches only one file,
/sys/pci/agp_i810.c, and it is essentially a backport of the
code already in RELENG_7.
Old stuff (before 2001)
Many of these things are now part of the standard FreeBSD distribution. When this
is the case (marked in the list), check there for their most
up-to-date version (the versions present here are just for reference
or use on other platforms, and possibly out of date).
Some others are just obsolete,
either because they were not interesting,
or because the hardware/software they control is not
in use anymore.
Multimedia
Networking stuff
Misc. device drivers and utilities
Detailed description
PnP support for FreeBSD
Derived from a previous work by Sujal Patel, this code
provides PnP support in FreeBSD. The code is now in FreeBSD 2.2.6
so the code provided here is mostly for people running earlier
versions (starting from 2.2.1).
A slightly modified utility (originally from Sujal M. Patel,
smpatel@umiacs.umd.edu) to dump the possible and the current
configuration of your PnP peripherals. This again is in
FreeBSD 2.2.6 i think.
This is very primitive code to convert g3 data (e.g. fax files)
directly to 4-level GIF, or to postscript. Written to be used
together with mgetty but should in fact work with any fax-handling
package.
There is no user interface or manual page yet...
This small program is a simple command-line utility to control
the tuner and the various controls of a meteor/brooktre848.
On the latter, it also permits fetching teletext pages
using the SAA5246 decoder.
This code allows you to decode teletext info from a video stream
acquired using a frame grabber. This code requires my version of
the bktr driver for FreeBSD.
There is also an unsupported
version for the Meteor which uses a local
hack to the /dev/meteor driver: when programmed for Secam mode (one
that is useless here), it saves only the lines containing teletext
info (lines 7 to 22 here in Italy).
The code programs directly the frame grabber to acquire a number of
frames, then does the appropriate resampling and sync extraction,
and tries a crude decoding of Teletext info. On a P5/133 it runs
slightly slower than realtime, but the current code is -- I estimate
-- 4..8 times slower than it should be because it does a lot of
unnecessary operation in the resampling process.
This archive includes a patched version for the "asc" driver, so
that a color scanhead can be used. I am using this under 2.1R,
there should be minimal differences with 2.1.6.
This code has been committed to the source tree so it should appear
into future releases of FreeBSD.
Also included is a small program (ascio.c) which allows you to
convert the (undocumented) format output from the scanner into
a PNM file.
This is an experimental version of PCBRIDGE 3.00. PCBRIDGE makes
a PC with a few ethernet cards work as an Ethernet bridge. This
version is mostly written in C, compiles under FreeBSD and hopefully
also Linux and djgpp. It is largely based on the FreeBSD's "netboot"
program. It supports WD/SMC and NE2000 boards, up to 5 on a single
bridge. It is ROMable.
This is Amancio Hasty's great program "tv", which plays live video from
the Matrox Meteor. I have added code to save frames to jpeg files. Requires
you have installed libjpeg to compile. Just press enter on the xterm to save
frames to "imgXXX.jpg" in the same directory.
diff -c output for an implementation of SACKs and TSACKs on FreeBSD2.1R.
This is very experimental code representing work in progress.
It compiles correctly, but is not guaranteed to work
(is any software guaranteed at all ?).
This code, originally from Tor Egge, allows a FreeBSD 2.1.X kernel
to acquire parameters such as IP address and the like from a bootp
server. Note: most of this has been included in FreeBSD2.2.X.,
and is even more complete.
Luigi Rizzo
Dipartimento di Ingegneria dell'Informazione -- Univ. di Pisa
via Diotisalvi 2 -- 56126 PISA
tel. +39-050-2211611 Fax +39-050-2217600
email:
rizzo@iet.unipi.it