diff --git a/sdbfs/doc/Makefile b/sdbfs/doc/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..553ac807ed183d1517da4c1dffe2b0d8a559d04f
--- /dev/null
+++ b/sdbfs/doc/Makefile
@@ -0,0 +1,60 @@
+#
+# Makefile for the documentation directory
+#
+# Copyright 1994,2000,2010,2011   Alessandro Rubini <rubini@linux.it>
+#
+#################
+
+# There is not basenames here, all *.in are considered input
+INPUT = $(wildcard *.in)
+
+TEXI = $(INPUT:.in=.texi)
+INFO = $(INPUT:.in=.info)
+HTML = $(INPUT:.in=.html)
+TXT  = $(INPUT:.in=.txt)
+PDF  = $(INPUT:.in=.pdf)
+
+ALL    = $(INFO) $(HTML) $(TXT) $(PDF)
+
+MAKEINFO ?= makeinfo
+
+%.texi: %.in
+	@rm -f $@
+	sed -f ./infofilter $< > $@
+	emacs -batch --no-site-file -l fixinfo $@
+	chmod -w $@
+
+%.pdf: %.texi
+	texi2pdf --batch $<
+
+%.info: %.texi
+	$(MAKEINFO) $< -o $@
+
+%.html: %.texi
+	$(MAKEINFO) --html --no-split -o $@ $<
+
+%.txt: %.texi
+	$(MAKEINFO) --no-headers $< > $@
+
+##############################################
+.PHONY: all images check terse clean install
+.INTERMEDIATE: $(TEXI)
+
+all: images $(ALL)
+	$(MAKE) terse
+
+images::
+	if [ -d images ]; then $(MAKE) -C images || exit 1; fi
+
+check: _err.ps
+	gs -sDEVICE=linux -r320x200x16 $<
+
+terse:
+	for n in cp fn ky pg toc tp vr aux log; do rm -f *.$$n; done
+	rm -f *~
+
+clean: terse
+	rm -f $(ALL) $(TEXI)
+
+install:
+
diff --git a/sdbfs/doc/fixinfo b/sdbfs/doc/fixinfo
new file mode 100644
index 0000000000000000000000000000000000000000..b7ae0ba57f9b4fcc53fcd3a97a7197aeaef88cbc
--- /dev/null
+++ b/sdbfs/doc/fixinfo
@@ -0,0 +1,18 @@
+
+;; use:
+;;     emacs -batch -l ./fixinfo.el <file>
+;; or, better:
+;;     emacs -batch --no-site-file -l ./fixinfo.el <file>
+
+(defun fixinfo (file)
+  (find-file-other-window file)
+  (message (concat "Maxing texinfo tree in " file))
+  (texinfo-all-menus-update)
+  (texinfo-every-node-update)
+  (save-buffer)
+  (kill-buffer (current-buffer))
+)
+
+;; loop over command line arguments
+(mapcar 'fixinfo command-line-args-left)
+(kill-emacs)
diff --git a/sdbfs/doc/infofilter b/sdbfs/doc/infofilter
new file mode 100644
index 0000000000000000000000000000000000000000..d153d0907500eccb0af0d47fa9606c8522e40e6e
--- /dev/null
+++ b/sdbfs/doc/infofilter
@@ -0,0 +1,21 @@
+#! /usr/bin/sed -f
+
+# allow "%" as a comment char, but only at the beginning of the line
+s/^%/@c /
+#s/[^\\]%.*$//
+s/^\\%/%/
+
+
+#preserve blanks and braces in @example blocks
+/^@example/,/^@end example/ s/{/@{/g
+/^@example/,/^@end example/ s/}/@}/g
+/^@example/,/^@end example/ p
+/^@example/,/^@end example/ d
+/^@smallexample/,/^@end smallexample/ s/{/@{/g
+/^@smallexample/,/^@end smallexample/ s/}/@}/g
+/^@smallexample/,/^@end smallexample/ p
+/^@smallexample/,/^@end smallexample/ d
+
+# remove leading blanks
+s/^[ 	]*//
+