diff --git a/LDP/migration-2016/faqmigration.py b/LDP/migration-2016/faqmigration.py new file mode 100644 index 00000000..ad68c0e5 --- /dev/null +++ b/LDP/migration-2016/faqmigration.py @@ -0,0 +1,173 @@ +#! /usr/bin/python +# +# -- migrate to the new naming scheme + +from __future__ import absolute_import, division, print_function + +import os +import sys +import time +import errno +import shutil +import logging +import functools + +logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s ' \ + + '%(funcName)s %(message)s' +logging.basicConfig(stream=sys.stderr, format=logformat, level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# -- short names +# +opa = os.path.abspath +opb = os.path.basename +opd = os.path.dirname +opj = os.path.join +opn = os.path.normpath +opr = os.path.relpath +ops = os.path.split + +faqdocs = '''Ftape-FAQ +Linux-RAID-FAQ +LDP-FAQ +AfterStep-FAQ'''.split() + + +def validate_args(argv): + if len(argv) == 4: + for d in argv[:3]: + if not os.path.isdir(d): + return False + return True + return False + + +def collect_published_stems(dirbase): + d = dict() + for stem in os.listdir(dirbase): + if not os.path.isdir(opj(dirbase, stem)): + continue + d[stem] = stem + return d + + +def make_refresh(target, title, delay=0): + text = ''' + + {1}: {0} + + + +

This page has moved permanently to + {0}. + Update your bookmarks if you wish. The compatibility + redirect will remain through, at least, early 2017. +

+ + +''' + return text.format(target, title, delay) + +def swapfiles(a, b): + '''use os.rename() to make "a" become "b"''' + if not os.path.isfile(a): + raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), a) + tf = None + if os.path.exists(b): + _, tf = mkstemp(prefix='swapfile-', dir=opd(opa(a))) + logger.debug("Created tempfile %s.", tf) + logger.debug("About to rename %s to %s.", b, tf) + os.rename(b, tf) + logger.debug("About to rename %s to %s.", a, b) + os.rename(a, b) + if tf: + logger.debug("About to rename %s to %s.", tf, a) + os.rename(tf, a) + logger.debug("About to remove %s.", tf) + os.rmdir(tf) + + +def create_symlink(source, target): + assert not os.path.exists(target) + targetdir = os.path.dirname(target) + if not os.path.isdir(targetdir): + logger.debug("Creating directory %s", targetdir) + os.makedirs(targetdir) + logger.debug("Creating symlink %s, pointing to %s", target, source) + os.symlink(os.path.relpath(source, start=targetdir), target) + + +def create_refresh_meta_equiv(fname, url, stem, **kwargs): + assert not os.path.exists(fname) + targetdir = os.path.dirname(fname) + if not os.path.isdir(targetdir): + logger.debug("Creating directory %s", targetdir) + os.makedirs(targetdir) + logger.debug("Creating file %s, with redirect to %s", fname, url) + with open(fname, 'w') as f: + f.write(make_refresh(url, stem, **kwargs)) + + +def newhtmlfilename(pubdir, stem, fname): + sought = opj(pubdir, stem, fname) + if not os.path.isfile(sought): + return opj(pubdir, stem, 'index.html') + return sought + + +def faqs(stems, faqpath, faqcompat, pubdir, urlbase): + + for stem in faqdocs: + if stem not in stems: + logger.critical("Stem %s not found in %s.", stem, pubdir) + sys.exit(1) + + # -- PDF handling + newpdf = opj(pubdir, stem, stem + '.pdf') + oldpdf = opj(faqcompat, 'pdf', stem + '.pdf') + if os.path.exists(oldpdf): + assert os.path.exists(oldpdf) + assert os.path.exists(newpdf) + os.rename(oldpdf, oldpdf + '.' + str(int(time.time()))) + create_symlink(newpdf, oldpdf) + + # -- HTML handling + htmldir = opj(faqcompat, stem) + if os.path.isdir(htmldir): + # -- LDP-FAQ and Linux-RAID-FAQ + for fn in os.listdir(htmldir): + if not fn.endswith('.html'): + continue + pubpath = newhtmlfilename(pubdir, stem, fn) + url = pubpath.replace(pubdir, urlbase) + fullname = opj(htmldir, fn) + os.rename(fullname, fullname + '.' + str(int(time.time()))) + create_refresh_meta_equiv(fullname, url, stem, delay=2) + else: + # -- AfterStep-FAQ and Ftape-FAQ + htmldir = faqcompat + for fn in os.listdir(htmldir): + if not fn.startswith(stem): + continue + pubpath = newhtmlfilename(pubdir, stem, fn) + url = pubpath.replace(pubdir, urlbase) + fullname = opj(htmldir, fn) + os.rename(fullname, fullname + '.' + str(int(time.time()))) + create_refresh_meta_equiv(fullname, url, stem, delay=2) + + +def main(fin, fout, argv): + me = os.path.basename(sys.argv[0]) + usage = "usage: %s " % (me,) + if not validate_args(argv): + return usage + faqpath, faqcompat, pubdir, urlbase = argv + stems = collect_published_stems(pubdir) + faqs(stems, faqpath, faqcompat, pubdir, urlbase) + return os.EX_OK + + +if __name__ == '__main__': + sys.exit(main(sys.stdin, sys.stdout, sys.argv[1:])) + +# -- end of file diff --git a/LDP/migration-2016/golive.sh b/LDP/migration-2016/golive.sh new file mode 100644 index 00000000..87702c4a --- /dev/null +++ b/LDP/migration-2016/golive.sh @@ -0,0 +1,52 @@ +#! /bin/bash + +set -e +set -x + +squawk () { printf >&2 "%s\n" "$@"; } +abort () { squawk "$@" ; exit 1; } + +SELFNAME="$( readlink --canonicalize ${0})" +ME="${SELFNAME##*/}" # -- basename +HERE="${SELFNAME%/*}" # -- dirname + +# -- SET THIS VARIABLE to the full path of the LDP content +# +CONTENTROOT=/home/mabrown/wip/tldp/website/html + +# -- trailing slash, atypically included on PUBDIR, here +PUBDIR="${CONTENTROOT}/en/" + +cd "$CONTENTROOT" + +READY=yes +for D in REF FAQ LDP HOWTO; do + if ! test -d "${D}"; then + squawk "Could not find directory ${D}." + READY=no + fi + if ! test -d "${D}.compat"; then + squawk "Could not find directory ${D}.compat." + READY=no + fi +done + +if test "$READY" != "yes"; then + abort "Cowardly, refusing to throw the switch." +fi + +for D in REF FAQ LDP HOWTO; do + + squawk "Activating new ${D}." + + mv -v "${D}" "old.${D}" && mv -v "${D}.compat" "${D}" + + squawk "Activated new ${D}." + +done + +squawk "Done. Success." + +exit 0 + +# -- end of file diff --git a/LDP/migration-2016/guidemigration.py b/LDP/migration-2016/guidemigration.py new file mode 100644 index 00000000..2dced884 --- /dev/null +++ b/LDP/migration-2016/guidemigration.py @@ -0,0 +1,213 @@ +#! /usr/bin/python +# +# -- migrate to the new naming scheme + +from __future__ import absolute_import, division, print_function + +import os +import sys +import time +import errno +import shutil +import logging +import functools + +logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s ' \ + + '%(funcName)s %(message)s' +logging.basicConfig(stream=sys.stderr, format=logformat, level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# -- short names +# +opa = os.path.abspath +opb = os.path.basename +opd = os.path.dirname +opj = os.path.join +opn = os.path.normpath +opr = os.path.relpath +ops = os.path.split + + +# -- Stem handling for HTML + +predictably_named_guides = '''Bash-Beginners-Guide +cpg +espk-ug +EVMSUG +GNU-Linux-Tools-Summary +LDP-Author-Guide +Linux-Dictionary +Linux-Filesystem-Hierarchy +Linux-Media-Guide +Mobile-Guide +Pocket-Linux-Guide +sag'''.split() + +stems = dict(zip(predictably_named_guides, predictably_named_guides)) + +# -- no "html" subdirectory +# +stems['lki'] = 'lki' +stems['nag2'] = 'nag2' + +# -- two kernel versions, same name (in days of yore) +# +stems['lkmpg/2.4'] = 'lkmpg-2.4' +stems['lkmpg/2.6'] = 'lkmpg-2.6' + +# -- wacky path naming +# +stems['lame/LAME/linux-admin-made-easy'] = 'lame' +stems['solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3'] = 'solrhe' + +# -- name changers +# +stems['abs'] = 'abs-guide' +stems['intro-linux'] = 'Intro-Linux' + + +# -- PDF handling + +pdflist = '''Bash-Beginners-Guide/Bash-Beginners-Guide.pdf +EVMSUG/EVMSUG.pdf +GNU-Linux-Tools-Summary/GNU-Linux-Tools-Summary.pdf +LDP-Author-Guide/LDP-Author-Guide.pdf +Linux-Dictionary/Linux-Dictionary.pdf +Linux-Filesystem-Hierarchy/Linux-Filesystem-Hierarchy.pdf +Linux-Media-Guide/Linux-Media-Guide.pdf +Mobile-Guide/Mobile-Guide.pdf +Pocket-Linux-Guide/Pocket-Linux-Guide.pdf +cpg/Custom-Porting-Guide.pdf +espk-ug/espk-ug.pdf +lame/lame.pdf +lki/lki.pdf +nag2/nag2.pdf +sag/sag.pdf +solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3.pdf'''.split() + +extrapdfs = dict() +extrapdfs['lkmpg/2.4/lkmpg.pdf'] = 'lkmpg-2.4' +extrapdfs['lkmpg/2.6/lkmpg.pdf'] = 'lkmpg-2.6' +extrapdfs['abs/abs-guide.pdf'] = 'abs-guide' +extrapdfs['intro-linux/intro-linux.pdf'] = 'Intro-Linux' + +def validate_args(argv): + if len(argv) == 4: + for d in argv[:3]: + if not os.path.isdir(d): + return False + return True + return False + + +def make_refresh(target, title, delay=0): + text = ''' + + {1}: {0} + + + +

This page has moved permanently to + {0}. + Update your bookmarks if you wish. The compatibility + redirect will remain through, at least, early 2017. +

+ + +''' + return text.format(target, title, delay) + +def swapfiles(a, b): + '''use os.rename() to make "a" become "b"''' + if not os.path.isfile(a): + raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), a) + tf = None + if os.path.exists(b): + _, tf = mkstemp(prefix='swapfile-', dir=opd(opa(a))) + logger.debug("Created tempfile %s.", tf) + logger.debug("About to rename %s to %s.", b, tf) + os.rename(b, tf) + logger.debug("About to rename %s to %s.", a, b) + os.rename(a, b) + if tf: + logger.debug("About to rename %s to %s.", tf, a) + os.rename(tf, a) + logger.debug("About to remove %s.", tf) + os.rmdir(tf) + + +def create_symlink(source, target): + assert not os.path.exists(target) + targetdir = os.path.dirname(target) + if not os.path.isdir(targetdir): + logger.debug("Creating directory %s", targetdir) + os.makedirs(targetdir) + logger.debug("Creating symlink %s, pointing to %s", target, source) + os.symlink(os.path.relpath(source, start=targetdir), target) + + +def create_refresh_meta_equiv(fname, url, stem, **kwargs): + assert not os.path.exists(fname) + targetdir = os.path.dirname(fname) + if not os.path.isdir(targetdir): + logger.debug("Creating directory %s", targetdir) + os.makedirs(targetdir) + logger.debug("Creating file %s, with redirect to %s", fname, url) + with open(fname, 'w') as f: + f.write(make_refresh(url, stem, **kwargs)) + + +def newhtmlfilename(pubdir, stem, fname): + sought = opj(pubdir, stem, fname) + if not os.path.isfile(sought): + return opj(pubdir, stem, 'index.html') + return sought + +def guides(stems, guidepath, guidecompat, pubdir, urlbase): + + for pdf in pdflist: + stem, _ = os.path.split(pdf) + oldpdf = opj(guidecompat, pdf) + newpdf = opj(pubdir, stem, stem + '.pdf') + assert os.path.exists(oldpdf) + assert os.path.exists(newpdf) + os.rename(oldpdf, oldpdf + '.' + str(int(time.time()))) + create_symlink(newpdf, oldpdf) + + for pdf, stem in extrapdfs.items(): + oldpdf = opj(guidecompat, pdf) + newpdf = opj(pubdir, stem, stem + '.pdf') + assert os.path.exists(oldpdf) + assert os.path.exists(newpdf) + os.rename(oldpdf, oldpdf + '.' + str(int(time.time()))) + create_symlink(newpdf, oldpdf) + + for stem, newstem in sorted(stems.items(), key=lambda x: x[1].lower()): + htmldir = opj(guidecompat, stem, 'html') + if not os.path.isdir(htmldir): + htmldir, _ = os.path.split(htmldir) + assert os.path.exists(htmldir) + for fn in os.listdir(htmldir): + if not fn.endswith('.html'): + continue + pubpath = newhtmlfilename(pubdir, newstem, fn) + url = pubpath.replace(pubdir, urlbase) + fullname = opj(htmldir, fn) + os.rename(fullname, fullname + '.' + str(int(time.time()))) + create_refresh_meta_equiv(fullname, url, newstem, delay=2) + + +def main(fin, fout, argv): + me = os.path.basename(sys.argv[0]) + usage = "usage: %s " % (me,) + if not validate_args(argv): + return usage + guidepath, guidecompat, pubdir, urlbase = argv + guides(stems, guidepath, guidecompat, pubdir, urlbase) + return os.EX_OK + + +if __name__ == '__main__': + sys.exit(main(sys.stdin, sys.stdout, sys.argv[1:])) + +# -- end of file diff --git a/LDP/migration-2016/howtomigration.py b/LDP/migration-2016/howtomigration.py new file mode 100644 index 00000000..ab2a24d5 --- /dev/null +++ b/LDP/migration-2016/howtomigration.py @@ -0,0 +1,313 @@ +#! /usr/bin/python +# +# -- migrate to the new naming scheme + +from __future__ import absolute_import, division, print_function + +import os +import sys +import errno +import shutil +import logging +import functools + +logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s ' \ + + '%(funcName)s %(message)s' +logging.basicConfig(stream=sys.stderr, format=logformat, level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# -- short names +# +opa = os.path.abspath +opb = os.path.basename +opd = os.path.dirname +opj = os.path.join +opn = os.path.normpath +opr = os.path.relpath +ops = os.path.split + +SKIP = object() + + +def add_renamed_stems(stems): + stems['ppp-ssh'] = 'VPN-PPP-SSH-HOWTO' + stems['intro-linux'] = 'Intro-Linux' + stems['DPT-Hardware-RAID'] = 'DPT-Hardware-RAID-HOWTO' + stems['Loadlin+Win95'] = 'Loadlin+Win95-98-ME' + stems['Laptop-HOWTO'] = 'Mobile-Guide' + stems['IR-HOWTO'] = 'Infrared-HOWTO' + stems['Xnews-under-Linux-HOWTO'] = 'Windows-Newsreaders-under-Linux-HOWTO' + stems['Access-HOWTO'] = 'Accessibility-HOWTO' + stems['Adv-Bash-Scr-HOWTO'] = 'abs-guide' + stems['abs'] = 'abs-guide' + stems['Mosix-HOWTO'] = 'openMosix-HOWTO' + stems['Partition-Rescue-New'] = 'Partition-Rescue' + stems['Partition-Mass-Storage-Dummies-Linux-HOWTO'] = 'Partition-Mass-Storage-Definitions-Naming-HOWTO' + + +def add_skipped_stems(stems): + stems['index.html'] = SKIP + stems['INDEX'] = SKIP + stems['README'] = SKIP + stems['COPYRIGHT'] = SKIP + stems['.htaccess'] = SKIP + stems['GCC-HOWTO'] = SKIP + stems['Netscape+Proxy'] = SKIP + stems['Sendmail+UUCP'] = SKIP + stems['GTEK-BBS-550'] = SKIP + stems['Consultants-HOWTO'] = SKIP + stems['Acer-Laptop-HOWTO'] = SKIP + stems['Linux-From-Scratch-HOWTO'] = SKIP + stems['Distributions-HOWTO'] = SKIP + stems['MIPS-HOWTO'] = SKIP + stems['3Dfx-HOWTO'] = SKIP + stems['PostgreSQL-HOWTO'] = SKIP + stems['Term-Firewall'] = SKIP + stems['WikiText-HOWTO'] = SKIP + stems['HOWTO-INDEX'] = SKIP + stems['HOWTO-HOWTO'] = SKIP + stems['Security-Quickstart-Redhat-HOWTO'] = SKIP + + +def collect_published_stems(dirbase): + d = dict() + for stem in os.listdir(dirbase): + if not os.path.isdir(opj(dirbase, stem)): + continue + d[stem] = stem + add_renamed_stems(d) + add_skipped_stems(d) + return d + + +def validate_args(argv): + if len(argv) == 4: + for d in argv[:3]: + if not os.path.isdir(d): + return False + return True + return False + + +def walk_simple(stems, dirbase, root): + for name in os.listdir(dirbase): + if name.endswith('.pdf'): + stem, _ = os.path.splitext(name) + else: + stem = name + relpath = opr(opj(dirbase, name), start=root) + newstem = stems.get(stem, None) + if newstem is None: + logger.error("%s missing stem: %s", stem, relpath) + continue + elif newstem is SKIP: + logger.info("%s ignoring stem: %s", stem, relpath) + continue + yield newstem, relpath + + +def walk_html_single(stems, dirbase, root): + for name in os.listdir(dirbase): + if name == 'images': + continue + dirname = opj(dirbase, name) + if not os.path.isdir(dirname): + continue + indexhtml = opj(dirname, 'index.html') + if not os.path.isfile(indexhtml): + logger.error("%s missing index.html: %s", stem, indexhtml) + stem = name + relpath = opr(indexhtml, start=root) + newstem = stems.get(stem, None) + if newstem is None: + logger.error("%s missing stem: %s", stem, relpath) + continue + elif newstem is SKIP: + logger.info("%s ignoring stem: %s", stem, relpath) + continue + yield newstem, relpath + + +def walk_html_chunked_dirs(stems, dirbase, root): + for name in os.listdir(dirbase): + if name in ('images', 'pdf', 'text', 'html_single', 'archived'): + continue + dirname = opj(dirbase, name) + if not os.path.isdir(dirname): + continue + for subname in os.listdir(dirname): + fname = opj(dirname, subname) + if os.path.isdir(fname): + continue + stem = name + relpath = opr(fname, start=root) + newstem = stems.get(stem, None) + if newstem is None: + logger.error("%s missing stem: %s", stem, relpath) + continue + elif newstem is SKIP: + logger.info("%s ignoring stem: %s", stem, relpath) + continue + yield newstem, relpath + + +def walk_html_chunked_files(stems, dirbase, root): + for name in os.listdir(dirbase): + fname = opj(dirbase, name) + if not os.path.isfile(fname): + continue + stem, ext = os.path.splitext(name) + if stem == 'index' or ext != '.html': + continue + if stem not in stems: + stem = '-'.join(stem.split('-')[:-1]) + if stem not in stems: + logger.error("Could not determine stem for %s", fname) + continue + relpath = opr(fname, start=root) + newstem = stems.get(stem, None) + if newstem is None: + logger.error("%s missing stem: %s", stem, relpath) + continue + elif newstem is SKIP: + logger.info("%s ignoring stem: %s", stem, relpath) + continue + yield newstem, relpath + + +def htmlf(stem, relpath, pubdir, newtree): + pubf = opj(pubdir, stem, relpath) + newf = opj(newtree, relpath) + if os.path.exists(pubf): + return stem, relpath, newf, pubf + else: + return stem, relpath, newf, opj(pubdir, stem, 'index.html') + + +def htmld(stem, relpath, pubdir, newtree): + pubf = opj(pubdir, relpath) + newf = opj(newtree, relpath) + if os.path.exists(pubf): + return stem, relpath, newf, pubf + else: + return stem, relpath, newf, opj(pubdir, stem, 'index.html') + + +def htmls(stem, relpath, pubdir, newtree): + pubf = opj(pubdir, stem, stem + '-single.html') + newf = opj(newtree, relpath) + if os.path.exists(pubf): + return stem, relpath, newf, pubf + else: + return stem, relpath, newf, opj(pubdir, stem, 'index.html') + + +def txt(stem, relpath, pubdir, newtree): + pubf = opj(pubdir, stem, stem + '.txt') + newf = opj(newtree, relpath) + if os.path.exists(pubf): + return stem, relpath, newf, pubf + else: + return stem, relpath, newf, None + + +def pdf(stem, relpath, pubdir, newtree): + pubf = opj(pubdir, stem, stem + '.pdf') + newf = opj(newtree, relpath) + if os.path.exists(pubf): + return stem, relpath, newf, pubf + else: + return stem, relpath, newf, None + +def make_refresh(target, title, delay=0): + text = ''' + + {1}: {0} + + + +

This page has moved permanently to + {0}. + Update your bookmarks if you wish. The compatibility + redirect will remain through, at least, early 2017. +

+ + +''' + return text.format(target, title, delay) + + +def create_symlink(source, target): + assert not os.path.exists(target) + targetdir = os.path.dirname(target) + if not os.path.isdir(targetdir): + logger.debug("Creating directory %s", targetdir) + os.makedirs(targetdir) + logger.debug("Creating symlink %s, pointing to %s", target, source) + os.symlink(os.path.relpath(source, start=targetdir), target) + + +def create_refresh_meta_equiv(fname, url, stem, **kwargs): + assert not os.path.exists(fname) + targetdir = os.path.dirname(fname) + if not os.path.isdir(targetdir): + logger.debug("Creating directory %s", targetdir) + os.makedirs(targetdir) + logger.debug("Creating file %s, with redirect to %s", fname, url) + with open(fname, 'w') as f: + f.write(make_refresh(url, stem, **kwargs)) + + +def howtos(stems, howtopath, newtree, pubdir, urlbase): + ldptree = dict() + for s, r in walk_html_chunked_files(stems, howtopath, howtopath): + ldptree[r] = htmlf(s, r, pubdir, newtree) + # print('chunked_files', s, r) + + for s, r in walk_html_chunked_dirs(stems, howtopath, howtopath): + ldptree[r] = htmld(s, r, pubdir, newtree) + # print('chunked_dirs', s, r) + + howto_htmls = opj(howtopath, 'html_single') + for s, r in walk_html_single(stems, howto_htmls, howtopath): + ldptree[r] = htmls(s, r, pubdir, newtree) + # print('html_single', s, r) + + for s, r in walk_simple(stems, opj(howtopath, 'text'), howtopath): + ldptree[r] = txt(s, r, pubdir, newtree) + # print('text', s, r) + + for s, r in walk_simple(stems, opj(howtopath, 'pdf'), howtopath): + ldptree[r] = pdf(s, r, pubdir, newtree) + # print('pdf', s, r) + + # -- have to symlink the PDF and TXT files + # + for fname in sorted(ldptree.keys(), key=lambda x: x.lower()): + stem, relpath, newpath, pubpath = ldptree[fname] + url = pubpath.replace(pubdir, urlbase) + if fname.startswith('text/') or fname.startswith('pdf/'): + create_symlink(pubpath, newpath) + else: + url = pubpath.replace(pubdir, urlbase) + create_refresh_meta_equiv(newpath, url, stem, delay=2) + + +def main(fin, fout, argv): + me = os.path.basename(sys.argv[0]) + usage = "usage: %s " % (me,) + if not validate_args(argv): + return usage + howtopath, howtocompat, pubdir, urlbase = argv + oldtree = opd(opn(howtopath)) + + stems = collect_published_stems(pubdir) + + howtos(stems, howtopath, howtocompat, pubdir, urlbase) + return os.EX_OK + + +if __name__ == '__main__': + sys.exit(main(sys.stdin, sys.stdout, sys.argv[1:])) + +# -- end of file diff --git a/LDP/migration-2016/migration-helper.sh b/LDP/migration-2016/migration-helper.sh new file mode 100644 index 00000000..26e79397 --- /dev/null +++ b/LDP/migration-2016/migration-helper.sh @@ -0,0 +1,71 @@ +#! /bin/bash + +set -e +set -x + +SELFNAME="$( readlink --canonicalize ${0})" +ME="${SELFNAME##*/}" # -- basename +HERE="${SELFNAME%/*}" # -- dirname + +# -- SET THIS VARIABLE to the full path of the LDP content +# +CONTENTROOT=/home/mabrown/wip/tldp/website/html + +# -- trailing slash, atypically included on PUBDIR, here +PUBDIR="${CONTENTROOT}/en/" +URL_PUBDIR=http://www.tldp.org/en/ + +cd "$CONTENTROOT" + +# -- HOWTO handling: build symlinks and HTTP META-EQUIV files +# +HOWTOS="${CONTENTROOT}/HOWTO/" +HOWTO_COMPAT=HOWTO.compat/ +HOWTO_MIGRATOR=${HERE}/howtomigration.py + +test -d "${HOWTO_COMPAT}" \ + || mkdir "${HOWTO_COMPAT}" +HOWTO_COMPAT=$( readlink --canonicalize "$HOWTO_COMPAT" ) +python \ + "${HOWTO_MIGRATOR}" "${HOWTOS}" "${HOWTO_COMPAT}" "${PUBDIR}" "${URL_PUBDIR}" + + +# -- guide handling: build symlinks and HTTP META-EQUIV files +# +GUIDES="${CONTENTROOT}/LDP/" +GUIDE_COMPAT=LDP.compat/ +GUIDE_MIGRATOR=${HERE}/guidemigration.py + +rsync --archive --verbose -- "${GUIDES}" "${GUIDE_COMPAT}" +GUIDE_COMPAT=$( readlink --canonicalize "$GUIDE_COMPAT" ) +python \ + "${GUIDE_MIGRATOR}" "${GUIDES}" "${GUIDE_COMPAT}" "${PUBDIR}" "${URL_PUBDIR}" + + +# -- ref handling: build symlinks and HTTP META-EQUIV files +# +REFS="${CONTENTROOT}/REF/" +REF_COMPAT=REF.compat/ +REF_MIGRATOR=${HERE}/refmigration.py + +rsync --archive --verbose -- "${REFS}" "${REF_COMPAT}" +REF_COMPAT=$( readlink --canonicalize "$REF_COMPAT" ) +python \ + "${REF_MIGRATOR}" "${REFS}" "${REF_COMPAT}" "${PUBDIR}" "${URL_PUBDIR}" + + +# -- ref handling: build symlinks and HTTP META-EQUIV files +# +FAQS="${CONTENTROOT}/FAQ/" +FAQ_COMPAT=FAQ.compat/ +FAQ_MIGRATOR=${HERE}/faqmigration.py + +rsync --archive --verbose -- "${FAQS}" "${FAQ_COMPAT}" +FAQ_COMPAT=$( readlink --canonicalize "$FAQ_COMPAT" ) +python \ + "${FAQ_MIGRATOR}" "${FAQS}" "${FAQ_COMPAT}" "${PUBDIR}" "${URL_PUBDIR}" + + +exit 0 + +# -- end of file diff --git a/LDP/migration-2016/migration-preparation.sh b/LDP/migration-2016/migration-preparation.sh new file mode 100644 index 00000000..52c6edac --- /dev/null +++ b/LDP/migration-2016/migration-preparation.sh @@ -0,0 +1,66 @@ +#! /bin/bash + +set -e +set -x + +SELFNAME="$( readlink --canonicalize ${0})" +ME="${SELFNAME##*/}" # -- basename +DIR="${SELFNAME%/*}" # -- dirname + +CONTENTROOT=/home/mabrown/wip/tldp/website/html +cd "$CONTENTROOT" + +# -- minor cleanup of dangling or otherwise broken symlinks: +for LINK in \ + html/pub/Linux/docs/HOWTO/translations/polish/.message \ + html/pub/Linux/docs/HOWTO/translations/pl/.message \ + html/LDP/LGNET/182/184 \ + ; do + + test -L "$LINK" && rm -f "$LINK" + +done + +ARCHIVE=archive +test -d "${ARCHIVE}" \ + || mkdir "${ARCHIVE}" + +# -- populate the archive with retired items +# +mv \ + --target-directory "${ARCHIVE}" \ + --verbose \ + -- \ + HOWTO/Netscape+Proxy.html \ + HOWTO/Sendmail+UUCP.html \ + HOWTO/GTEK-BBS-550.html \ + HOWTO/DPT-Hardware-RAID.html \ + HOWTO/Consultants-HOWTO.html \ + HOWTO/WikiText-HOWTO \ + HOWTO/Security-Quickstart-Redhat-HOWTO \ + REF/palmdevqs \ + REF/ls_quickref \ + REF/Joe-Command-Reference \ + FAQ/Linux-FAQ \ + FAQ/sig11 \ + FAQ/Threads-FAQ \ + FAQ/WordPerfect-Linux-FAQ \ + +# -- and toss aside the neolithically-ancient crap +# +TODELETE=todelete-$( date +%F ) +test -d "${TODELETE}" \ + || mkdir "${TODELETE}" + +mv \ + --target-directory "${TODELETE}" \ + --verbose \ + -- \ + HOWTO/Acer-Laptop-HOWTO.html \ + HOWTO/Linux-From-Scratch-HOWTO.html \ + HOWTO/Distributions-HOWTO.html \ + HOWTO/MIPS-HOWTO.html \ + HOWTO/3Dfx-HOWTO.html \ + HOWTO/PostgreSQL-HOWTO.html \ + +# -- end of file diff --git a/LDP/migration-2016/refmigration.py b/LDP/migration-2016/refmigration.py new file mode 100644 index 00000000..ffcfb8fe --- /dev/null +++ b/LDP/migration-2016/refmigration.py @@ -0,0 +1,172 @@ +#! /usr/bin/python +# +# -- migrate to the new naming scheme + +from __future__ import absolute_import, division, print_function + +import os +import sys +import time +import errno +import shutil +import logging +import functools + +logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s ' \ + + '%(funcName)s %(message)s' +logging.basicConfig(stream=sys.stderr, format=logformat, level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# -- short names +# +opa = os.path.abspath +opb = os.path.basename +opd = os.path.dirname +opj = os.path.join +opn = os.path.normpath +opr = os.path.relpath +ops = os.path.split + +refdocs = '''CVS-BestPractices +VideoLAN-Quickstart +VLC-User-Guide +VLS-User-Guide +INTRO/Backup-INTRO +INTRO/Intrusion-INTRO +INTRO/PhysSecurity-INTRO +INTRO/SecuringData-INTRO +INTRO/Virus-INTRO'''.split() + + +def validate_args(argv): + if len(argv) == 4: + for d in argv[:3]: + if not os.path.isdir(d): + return False + return True + return False + + +def collect_published_stems(dirbase): + d = dict() + for stem in os.listdir(dirbase): + if not os.path.isdir(opj(dirbase, stem)): + continue + d[stem] = stem + # add_renamed_stems(d) + # add_skipped_stems(d) + return d + + +def make_refresh(target, title, delay=0): + text = ''' + + {1}: {0} + + + +

This page has moved permanently to + {0}. + Update your bookmarks if you wish. The compatibility + redirect will remain through, at least, early 2017. +

+ + +''' + return text.format(target, title, delay) + +def swapfiles(a, b): + '''use os.rename() to make "a" become "b"''' + if not os.path.isfile(a): + raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), a) + tf = None + if os.path.exists(b): + _, tf = mkstemp(prefix='swapfile-', dir=opd(opa(a))) + logger.debug("Created tempfile %s.", tf) + logger.debug("About to rename %s to %s.", b, tf) + os.rename(b, tf) + logger.debug("About to rename %s to %s.", a, b) + os.rename(a, b) + if tf: + logger.debug("About to rename %s to %s.", tf, a) + os.rename(tf, a) + logger.debug("About to remove %s.", tf) + os.rmdir(tf) + + +def create_symlink(source, target): + assert not os.path.exists(target) + targetdir = os.path.dirname(target) + if not os.path.isdir(targetdir): + logger.debug("Creating directory %s", targetdir) + os.makedirs(targetdir) + logger.debug("Creating symlink %s, pointing to %s", target, source) + os.symlink(os.path.relpath(source, start=targetdir), target) + + +def create_refresh_meta_equiv(fname, url, stem, **kwargs): + assert not os.path.exists(fname) + targetdir = os.path.dirname(fname) + if not os.path.isdir(targetdir): + logger.debug("Creating directory %s", targetdir) + os.makedirs(targetdir) + logger.debug("Creating file %s, with redirect to %s", fname, url) + with open(fname, 'w') as f: + f.write(make_refresh(url, stem, **kwargs)) + + +def newhtmlfilename(pubdir, stem, fname): + sought = opj(pubdir, stem, fname) + if not os.path.isfile(sought): + return opj(pubdir, stem, 'index.html') + return sought + + +def refs(stems, refpath, refcompat, pubdir, urlbase): + + for doc in refdocs: + stem = doc.replace('INTRO/', '') + if stem not in stems: + logger.critical("Stem %s not found in %s.", stem, pubdir) + sys.exit(1) + + # -- PDF handling + newpdf = opj(pubdir, stem, stem + '.pdf') + oldpdf = opj(refcompat, doc + '.pdf') + if not os.path.exists(oldpdf): + oldpdf = opj(refcompat, stem, stem + '.pdf') + assert os.path.exists(oldpdf) + assert os.path.exists(newpdf) + os.rename(oldpdf, oldpdf + '.' + str(int(time.time()))) + create_symlink(newpdf, oldpdf) + + # -- HTML handling + htmldir = opj(refcompat, doc, 'html') + if not os.path.isdir(htmldir): + htmldir, _ = os.path.split(htmldir) + assert os.path.exists(htmldir) + for fn in os.listdir(htmldir): + if not fn.endswith('.html'): + continue + pubpath = newhtmlfilename(pubdir, stem, fn) + url = pubpath.replace(pubdir, urlbase) + fullname = opj(htmldir, fn) + os.rename(fullname, fullname + '.' + str(int(time.time()))) + create_refresh_meta_equiv(fullname, url, stem, delay=2) + + +def main(fin, fout, argv): + me = os.path.basename(sys.argv[0]) + usage = "usage: %s " % (me,) + if not validate_args(argv): + return usage + refpath, refcompat, pubdir, urlbase = argv + stems = collect_published_stems(pubdir) + refs(stems, refpath, refcompat, pubdir, urlbase) + return os.EX_OK + + +if __name__ == '__main__': + sys.exit(main(sys.stdin, sys.stdout, sys.argv[1:])) + +# -- end of file diff --git a/LDP/migration-2016/run-whole-thing.sh b/LDP/migration-2016/run-whole-thing.sh new file mode 100644 index 00000000..f85bba8d --- /dev/null +++ b/LDP/migration-2016/run-whole-thing.sh @@ -0,0 +1,21 @@ +#! /bin/bash + +set -e +set -x + +SELFNAME="$( readlink --canonicalize ${0})" +ME="${SELFNAME##*/}" # -- basename +HERE="${SELFNAME%/*}" # -- dirname + +{ + exec 2>&1; + + bash $HERE/migration-preparation.sh; + + bash $HERE/migration-helper.sh; + + bash $HERE/golive.sh; + +} | tee logfile-$( date +%F ).log + +# -- end of file diff --git a/LDP/retired/3Dfx-HOWTO.sgml b/LDP/retired/3Dfx-HOWTO.sgml new file mode 100644 index 00000000..f9f094a8 --- /dev/null +++ b/LDP/retired/3Dfx-HOWTO.sgml @@ -0,0 +1,2278 @@ + + + + + + + + + + + + + + + + + + + + ] > + + + + + + + + +
+ +The Linux &c3Dfx; HOWTO +<author>Bernd Kreimeier + (<htmlurl + url="mailto:bk@gamers.org" + name="bk@gamers.org">) +<date>v1.16, 6 February 1998 + + +<abstract> +The Linux &c3Dfx; HOWTO is not being maintained by the author, +and is no longer relevant to the modern Linux system. It was removed +from the collection May 6, 2004 by Emma Jane Hogbin (Technical Review +Coordinator) based on the advice of the maintainer at the time, Michael +Scherer. Comments should be sent to discuss@en.tldp.org +<p> +This document describes &c3Dfx; graphics accelerator chip +support for Linux. It lists some supported hardware, +describes how to configure the drivers, and answers +frequently asked questions. +</abstract> + + +<!-- ====================================================== --> +<!-- Indexing --> +<!-- The index entries below might overlap with similar + entries from other HOWTO's e.g. on Mesa, GLint based + graphics, XFree86. Thus they are set as "idxentry" + style entries not meant to be tied to a particular + location. They could be anywhere in the file. + As the current backends maps invisible index entries + into the Index, that is, has no "idxentry" complement + to "idxref", I tried to put the index list in front + of the table of contents which was organized + in a way to remove the need for Index e.g. in HTML + backends, where indexing is currently not supported + anyway. + Keeping them in one spot should ease manual adjustment + of index entries from several documents into one + global index not using too many synonyms. --> + + + +<toc> + + +<![ %Indexing + [ + +<p> +<nidx>Hardware accelerated 3D graphics with 3Dfx Voodoo</nidx> + +<nidx>XFree86 and 3Dfx Voodoo</nidx> +<nidx>OpenGL and 3Dfx Voodoo</nidx> +<nidx>Mesa and 3Dfx Voodoo</nidx> +<nidx>GLUT and 3Dfx Voodoo</nidx> +<nidx>GGI and 3Dfx Voodoo</nidx> + +<nidx>3Dfx</nidx> +<nidx>Voodoo chipset</nidx> +<nidx>Glide API for Linux</nidx> + +<nidx>Quantum 3D</nidx> +<nidx>Obsidian graphics boards</nidx> + +<nidx>Orchid Righteous 3D</nidx> +<nidx>Canopus Pure 3D</nidx> +<nidx>Hercules Stealth 3D</nidx> +<nidx>Diamond Monster 3D</nidx> + +<nidx>Quake for Linux</nidx> +<nidx>GLQuake for Linux</nidx> +<nidx>GLQuake and 3Dfx Voodoo</nidx> +</p> + + ]]> + +<!-- ====================================================== --> + +<sect>Introduction + + +<p> +This is the Linux &c3Dfx; HOWTO document. It is intended as a quick +reference covering everything you need to know to install and +configure &c3Dfx; support under Linux. Frequently asked questions +regarding the &c3Dfx; support are answered, and references +are given to some other sources of information on a variety of topics +related to computer generated, hardware accelerated 3D graphics. +<p> +This information is only valid for Linux on the Intel platform. Some +information may be applicable to other processor architectures, but I +have no first hand experience or information on this. It is only +applicable to boards based on &c3Dfx; technology, any other graphics +accelerator hardware is beyond the scope of this document. + + +<sect1>Contributors and Contacts +<p> +This document would not have been possible without all the +information contributed by other people - those involved +in the Linux &Glide; port and the beta testing process, in +the development of &Mesa; and the &VooMesa; drivers, or +rewieving the document on behalf of &c3Dfx; and Quantum3D. +Some of them contributed entire sections to this document. +<p> +Daryll Strauss +<htmlurl + url="mailto:Daryll Strauss <daryll@harlot.rb.ca.us>" + name="daryll@harlot.rb.ca.us"> did the port, +Paul J. Metzger +<htmlurl + url="mailto:Paul J. Metzger <pjm@rbd.com>" + name="pjm@rbd.com"> +modified the &VooMesa; driver (written by +David Bucciarelli +<htmlurl + url="mailto:David Bucciarelli <tech.hmw@plus.it>" + name="tech.hmw@plus.it">) for Linux, +Brian Paul +<htmlurl + url="mailto:Brian Paul <brianp@RA.AVID.COM>" + name="brianp@RA.AVID.COM"> +integrated it +with his famous &Mesa; library. With respect to &VooDoo; +accelerated Mesa, additional thanks has to go to Henri Fousse, +Gary McTaggart, and the maintainer of the &c3Dfx; Mesa +for DOS, Charlie Wallace +<htmlurl + url="mailto:Charlie Wallace <Charlie.Wallace@unistudios.com>" + name="Charlie.Wallace@unistudios.com">. +The folks at &c3Dfx;, +notably Gary Sanders, Rod Hughes, and Marty Franz, provided +valuable input, as did Ross Q. Smith of Quantum3D. The +pages on the Voodoo Extreme and Operation 3Dfx websites +provided useful info as well, and in some case I relied on +the &c3Dfx; local Newsgroups. The Linux glQuake2 port +that uses Linux &Glide; and &Mesa; is maintained by +Dave Kirsch <htmlurl + url="mailto:Dave Kirsch <zoid@idsoftware.com>" + name="zoid@idsoftware.com">. +Thanks to all those who sent +e-mail regarding corrections and updates, and special +thanks to Mark Atkinson for reminding me of the dual +cable setup. +<p> +Thanks to the &SGMLT; package (formerly known as Linuxdoc-SGML), +this HOWTO is available in several formats, all generated from a +common source file. For information on &SGMLT; see its homepage +at +<htmlurl + url="http://pobox.com/~cg/sgmltools" + name="pobox.com/~cg/sgmltools">. + + +<sect1>Acknowledgments +<p> +&c3Dfx;, the &c3Dfx; Interactive logo, &VooDoo;, and &VooRush; +are registered trademarks of &c3Dfx; Interactive, Inc. +&Glide;, &TexUs;, &Pixelfx; and &Texelfx; are trademarks of +3Dfx Interactive, Inc. &OGL; is a registered trademark of +Silicon Graphics. Obsidian is a trademark of Quantum3D. +Other product names are trademarks of the respective holders, +and are hereby considered properly acknowledged. + +<sect1>Revision History +<p> +<descrip> +<tag>Version 1.03</tag>First version for public release. +<tag>Version 1.16</tag>Current version &CurrentVer; &CurrentDate;. +</descrip> + +<![ %Internal + [ +<sect2>Internal Revision History +<p> +The verbose revision history below is for internal use only, +to provide assistance during the review/copy editing process. + + <code> + Version 0.1i + First version; used for proof-reading purposes only. + Version 0.2i + Added Flash3D, added Orchid R3D to list of boards + known to work, minor fixes. + FAQ regarding grSstWinOpen() added, FAQ regarding + Glide demos with ATB. Trademark acknowdlegments. + Version 0.3i + Added Quantum3D statements about Linux support, + chipset definitions, Obsidian board. Added a + bit on Voodoo architecture. + Version 0.4i + Official Obsidian taxonomy from Ross Q. Smith. + Explanation on setuid from Daryll Strauss. + Comments on Voodoo GLUT by David Bucciarelli. + Version 0.5i + Upgraded to 2.3.1, added Intergraph Intense. + Version 1.0i + Fixed news.3dfx hierarchy, added bug report + group pointer, ready for release. + Version 1.01i + Corrections from Daryll, SST_DUALSCREEN, snapping + vertices, removed setuid/device/XAA discussion. + Version 1.02i + P5 added to requirements. Removed Banshee. No + Intergraph support. FAQ section overiew. + Version 1.03 + Corrected typos, added Macintosh. Changed wording + on grSstOpen error - might be removed entirely. + Added a Mesa compilation problems section. More + trademarks from the Glide docs. TexUS. ATB doc + mentioned. Upp'ed to pending 2.4 release. + + Version 1.10i + Internal revision, for long overdue update. + Removed some general accelerated 3D graphics + explanations. Stripped some vendor references, + as I am not going to keep track of that in + all detail. Added some Pixelfx, Texelfx, + SLI, AGP, and other 3Dfx specific technical + backgrounder. Removed the outdated commercial + Linux OpenGL details. Added some more URL's + of 3Dfx web and FTP site, ATB info, miniport + info. Added some details to the Rush support + issue (DirectDraw, SSST96). Added Mesa window + hack. Removed the deprecated mdw LDP URL. + LDP license link, copyright changed. Link to + Stingray FAQ. Added info@quantum3d. Added a + memory/board(s) configuration formula. + A few GGI changes, resolved SVGA duplicate. + Corrected GLUT version number. + + Version 1.11i + Internal revision. Added www.opengl.org, + emphasized pointer to Gateway. Added Mark + Kilgard to beta mail alias. Added OpenGL + GameDev list and ListServ archive reference. + Hercules FAQ maintained by Kertis Henderson + (kertis@frozenwave.com) confirmed. Added TMU + alias to Texelfx entry. FAQ on support for + multi TMU in current release. Added mention + of seperate VR/VG distributions to current + version FAQ. No mention of any upcoming Glide + revisions. Added Mesa/Glide combo portability, + and Charlie Wallace' DOS port. Moved X vs. AT3D + into the X11 section, added technical details + on problem to pacify those bitching, mentioned + XFree86 3.3.3.2. Added Dirk Hohndel to beta mail + alias. Added assembly remark to Alpha + port question. Added texture size entry. + Replaced max res. 1280x960 for SLI with 1024x768. + Added overclocking/cooling comments. Removed + outdated Mesa-2.3.x and Glide 2.3 specifics + like grSstWinOpen/grSstOpen. Added glQuake in + window remark. Removed outdated VoodooGLUT in + Mesa remark. + + Installed SGML-Tools v1.0.3. Added some minimal + indexing for RedHat LDP compilation. Switched to + Linuxdoc96 for release, as the nidx element has + not been added to strict DTD, while idx has. + Invisible indices cannot be created prior to + ToC - bugger. + Formatting: run into the familiar problem with + LaTeX styles not updated properly, and a duplicate + url.sty in a different location. Manual removal + and copy. Run texconfig rehash, fixed read permit + on style files. Formatting runs. + The url attribute rendering screws up underscores + and tilde character. OPP (other people's problem). + Strange, a misspelled &3Dfx; entity slips through + validation? + + Version 1.12i + Rephrased multitexture in Mesa remark. Clarified + the 1024x768 issue, ruled out 1280x960. Reworked + info file for linux-3dfx@gamers.org proposal, + rephrased entry. Fixed Glide version 2.4. + ATB source hint, whatever it's worth. Fixed 3Dfx/ + Quantum corporate entry. Added Linux Quake setuid, + an GL related bugs/workarounds from Dave Kirsch's + plan. Added LinuxQuake sites. + + Version 1.13i + Added "Internal" marked section, moved revision + history out of comment. Have to take out <nidx> + indexing after submission to RedHat, because it + breaks HTML output. Added "Indexing" marked + section, might actually scatter some more indices + throughout the document that way. Memory speed + mentioned as overclocking issue, lot of typos + fixed there. Fixed outdated SGML-Tools URL. Mesa + 2.6b5 (current) and 3.0 (upcoming) mentioned. + Made separate Mesa multitexturing entry. Also made + LinuxQuake multitexturing entry. + + Version 1.14i + Added blatant plug to "supported hardware" section, + for Voodoo2 board loans and DEC Alpha. Reworded + Glide multitexture section a bit, added Mesa + single pass trilinear filtering. Added "as of 2.6b5" + to Mesa statements. + + Version 1.15i + Upped Mesa to 2.6b6. Feedback from Daryll, Paul, and + Brian so far. Created a Contributors and Contacts + section following Paul's suggestion, included all + e-mails of those publicly visible (no 3Dfx/Quantum3D + mailto). Added single screen dual cable as proposed + by Mark Atkinson. Typos. Slightly reworded Quantum3D + entry added to How do boards differ. Added two cross + references to Mesa window hack. Added single board + Obsidian SB SLI, added resetting dual and single + board SLI reset problem. Glide 3.0 is publicly talked + about, thus added a remark to current version. Keep + linux-3dfx mailing list entry. Disclaimer with Mark + Kilgards SGI address, GLUT mailing list. + Version 1.16 + Switched Internal to IGNORE, upped current version, + notified LDP. + + </code> + + ]]> + + + +<!-- ====================================================== --> +<sect1>New versions of this document +<p> +You will find the most recent version of this document at +<htmlurl + url="http://www.gamers.org/dEngine/xf3D/" + name="www.gamers.org/dEngine/xf3D/">. +<p> +New versions of this document will be periodically posted to the +<htmlurl +url="news:comp.os.linux.answers" +name="comp.os.linux.answers"> newsgroup. They will also be uploaded +to various anonymous ftp sites that archive such information including +<htmlurl +url="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/" +name ="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/">. +<p> +Hypertext versions of this and other Linux HOWTOs are available on +many World-Wide-Web sites, including +<htmlurl +url="http://sunsite.unc.edu/LDP/" +name="sunsite.unc.edu/LDP/">. Most Linux CD-ROM +distributions include the HOWTOs, often under the +<tt>/usr/doc/</tt>directory, and you can also buy printed copies from +several vendors. +<p> +If you make a translation of this document into another language, let +me know and I'll include a reference to it here. + + +<sect1>Feedback +<p> +I rely on you, the reader, to make this HOWTO useful. If you have any +suggestions, corrections, or comments, please send them to me ( +<htmlurl + url="mailto:bk@gamers.org" + name="bk@gamers.org">), and I will try to +incorporate them in the next revision. Please add +<tt>HOWTO 3Dfx</tt> to the Subject-line of the mail, so procmail +will dump it in the appropriate folder. +<p> +Before sending bug reports or questions, <EM>please read all of the +information in this HOWTO</EM>, and <EM>send detailed information +about the problem</EM>. +<p> +If you publish this document on a CD-ROM or in hardcopy form, a +complimentary copy would be appreciated. Mail me for my postal +address. Also consider making a donation to the +Linux Documentation Project to help support +free documentation for Linux. Contact the +Linux HOWTO coordinator, Tim Bynum +(<htmlurl + url="mailto:linux-howto@sunsite.unc.edu" + name="linux-howto@sunsite.unc.edu">), +for more information. + + +<sect1>Distribution Policy +<p> +Copyright (c) 1997, 1998 by Bernd Kreimeier. +This document may be + distributed under the terms set forth in the LDP license + at +<htmlurl + url="http://sunsite.unc.edu/LDP/COPYRIGHT.html" + name="sunsite.unc.edu/LDP/COPYRIGHT.html">. +<p> +This HOWTO is free documentation; you can redistribute it and/or +modify it under the terms of the LDP license. +This document is distributed in the hope that it will be useful, but +<bf>without any warranty</bf>; without even the implied warranty of +<bf>merchantability</bf> or <bf>fitness for a particular purpose</bf>. +See the LDP license for more details. + + + + +<!-- ====================================================== --> +<sect>Graphics Accelerator Technology + +<sect1>Basics +<p> +This section gives a <em>very</em> cursory overview of computer +graphics accelerator technology, in order to help you understand +the concepts used later in the document. You should consult e.g. +a book on &OGL; in order to learn more. + +<sect1>Hardware configuration +<p> +Graphics accelerators come in different flavors: either +as a separate PCI board that is able to pass through +the video signal of a (possibly 2D or video accelerated) +VGA board, or as a PCI board that does both VGA and +3D graphics (effectively replacing older VGA controllers). +The &c3Dfx; boards based on the &VooDoo; belong to the +former category. We will get into this again later. +<p> +If there is no address conflict, any 3D accelerator +board could be present under Linux without interfering, +but in order to access the accelerator, you will need +a driver. A combined 2D/3D accelerator might behave +differently. + +<sect1>A bit of &VooDoo; architecture +<p> +Usually, accessing texture memory and frame/depth buffer is a +major bottleneck. For each pixel on the screen, there are +at least one (nearest), four (bi-linear), or eight (tri-linear +mipmapped) read accesses to texture memory, plus a read/write +to the depth buffer, and a read/write to frame buffer memory. +<p> +The &VooDoo; architecture separates texture memory from +frame/depth buffer memory by introducing two separate +rendering stages, with two corresponding units (&Pixelfx; and +&Texelfx;), each having a separate memory interface to dedicated +memory. This gives an above-average fill rate, paid for +restrictions in memory management (e.g. unused framebuffer +memory can not be used for texture caching). +<p> +Moreover, a &VooDoo; could use two TMU's (texture management +or texelfx units), and finally, two &VooDoo; could be +combined with a mechanism +called Scan-Line Interleaving (SLI). SLI essentially +means that each &Pixelfx; unit effectively provides only +every other scanline, which decreases bandwidth impact +on each &Pixelfx;' framebuffer memory. + + +<sect>Installation +<p> +Configuring Linux to support &c3Dfx; accelerators involves the +following steps: + +<enum> +<item>Installing the board. +<item>Installing the &Glide; distribution. +<item>Compiling, linking and/or running the application. +</enum> + +The next sections will cover each of these steps in detail. + +<sect1>Installing the board +<p> +Follow the manufacturer's instructions for installing the hardware or +have your dealer perform the installation. +It should not be necessary to select settings for IRQ, DMA channel, +either Plug&Pray (tm) or factory defaults should work. The +add-on boards described here are memory mapped devices and do +not use IRQ's. The only kind of conflict to avoid +is memory overlap with other devices. +<p> +As &c3Dfx; does not develop or sell any boards, do not contact +them on any problems. + +<sect2>Troubleshooting the hardware installation +<p> +To check the installation and the memory mapping, do +<tt>cat /proc/pci</tt>. The output should contain something like +<code> + Bus 0, device 12, function 0: + VGA compatible controller: S3 Inc. Vision 968 (rev 0). + Medium devsel. IRQ 11. + Non-prefetchable 32 bit memory at 0xf4000000. + + Bus 0, device 9, function 0: + Multimedia video controller: Unknown vendor Unknown device (rev 2). + Vendor id=121a. Device id=1. + Fast devsel. Fast back-to-back capable. + Prefetchable 32 bit memory at 0xfb000000. +</code> +for a Diamond Monster 3D used with a Diamond Stealth-64. Additionally +a <tt>cat /proc/cpuinfo /proc/meminfo</tt> might be helpfull for +tracking down conflicts and/or submitting a bug report. +<p> +With current kernels, you will probably get a boot warning +like +<code> +Jun 12 12:31:52 hal kernel: Warning : Unknown PCI device (121a:1). +Please read include/linux/pci.h +</code> +which could be safely ignored. If you happen to have a board +not very common, or have encountered a new revision, you should +take the time to follow the advice in <tt>/usr/include/linux/pci.h</tt> +and send all necessary information +to +<htmlurl + url="mailto:linux-pcisupport@cao-vlsi.ibp.fr" + name="linux-pcisupport@cao-vlsi.ibp.fr">. +<p> +If you experience any problems with the board, you should +try to verify that DOS and/or Win95 or NT support works. You +will probably not receive any useful response from a +board manufacturer on a bug report or request regarding +Linux. Having dealt with the Diamond support e-mail +system, I would not expect useful responses for other +operating systems either. + +<sect2>Configuring the kernel +<p> +There is no kernel configuration necessary, as long as PCI +support is enabled. +The <url url="http://sunsite.unc.edu/mdw/HOWTO/Kernel-HOWTO.html" +name="Linux Kernel HOWTO"> should be consulted for the details of +building a kernel. + + +<sect2>Configuring devices +<p> +The current drivers do not (yet) require any special devices. +This is different from other driver developments +(e.g. the sound drivers, where you will find +a <tt>/dev/dsp</tt> and <tt>/dev/audio</tt>). The +driver uses the <tt>/dev/mem</tt> device which should +always be available. In consequence, you need to use +<tt>setuid</tt> or root privileges to access the +accelerator board. + +<sect1>Setting up the Displays +<p> +There are two possible setups with add-on boards. You +could either pass-through the video signal from your +regular VGA board via the accelerator board to the +display, or you could use two displays at the same time. +Rely to the manual provided by the board manufacturer +for details. Both configurations have been tried with +the Monster 3D board. + +<sect2>Single screen display solution +<p> +This configuration allows you to check basic operations +of the accelerator board - if the video signal is not +transmitted to the display, hardware failure is possible. +<p> +Beware that the video output signal might deteoriate +significantly if passed through the video board. To +a degree, this is inevitable. However, reviews have +complained about below-average of the cables provided +e.g. with the Monster 3D, and judging from the one I +tested, this has not changed. +<p> +There are other pitfalls in single screen configurations. +Switching from the VGA display mode to the accelerated +display mode will change resolution and refresh rate as +well, even if you are using 640x480 e.g. with X11, too. +Moreover, if you are running X11, your application is +responsible for demanding all keyboard and mouse events, +or you might get stuck because of changed scope and exposure +on the X11 display (that is effectively invisible when the +accelerated mode is used) You could use SVGA console mode +instead of X11. +<p> +If you are going to use a single screen configuration and +switch modes often, remember that your monitor hardware +might not enjoy this kind of use. + + +<sect2>Single screen dual cable setup +<p> +Some high end monitors (e.g. the EIZO F-784-T) +come with two connectors, one with 5 BNC connectors +for RGB, HSync, VSync, the other e.g. a regular VGA +or a 13W3 Sub-D VGA. +These displays usually also feature a front panel +input selector to safely switch from one to the +other. It is thus possible to use e.g. a VGA-to-BNC +cable with your high end 2D card, and a VGA-to-13W3 +Sub-D cable with your 3Dfx, and effectively run dual +screen on one display. + + +<sect2>Dual screen display solution +<p> +The accelerator board does not need the VGA input signal. +Instead of routing the common video output through the +accelerator board, you could attach a second monitor to +its output, and use both at the same time. This solution +is more expensive, but gives best results, as your main +display will still be hires and without the signal +quality losses involved in a pass-through solution. In +addition, you could use X11 and the accelerated full +screen display in parallel, for development and debugging. +<p> +A common problem is that the accelerator board will not +provide any video signal when not used. In consequence, +each time the graphics application terminates, the +hardware screensave/powersave might kick in depending +on your monitors configuration. Again, your hardware +might not enjoy being treated like this. You should +use +<code> +setenv SST_DUALSCREEN 1 +</code> +to force continued video output in this setup. + +<sect1>Installing the &Glide; distribution +<p> +The &Glide; driver and library are provided as a single +compressed archive. Use <tt>tar</tt> and <tt>gzip</tt> +to unpack, and follow the instructions in the +README and INSTALL accompanying the distribution. +Read the install script and run it. Installation puts +everything in /usr/local/glide/include,lib,bin and sets +the ld.conf to look there. Where it installs and setting +ld.conf are independent actions. If you skip the ld.conf +step then you need the LD_LIBRARY_PATH. +<p> +You will need to install the header files in a location +available at compile time, if you want to compile your own +graphics applications. If you do not want to use the +installation as above (i.e. you insist on a different +location), make sure that any application could access +the shared libary at runtime, or you will get a response +like +<tt>can't load library 'libglide.so'</tt>. + + + +<sect2>Using the detect program +<p> +There is a <tt>bin/detect</tt> program in the distribution +(the source is not available). You have to run it as root, +and you will get something like +<code> +slot vendorId devId baseAddr0 command description +---- -------- ------ ---------- ------- ----------- + 00 0x8086 0x122d 0x00000000 0x0006 Intel:430FX (Triton) + 07 0x8086 0x122e 0x00000000 0x0007 Intel:ISA bridge + 09 0x121a 0x0001 0xfb000008 0x0002 3Dfx:video multimedia adapter + 10 0x1000 0x0001 0x0000e401 0x0007 ???:SCSI bus controller + 11 0x9004 0x8178 0x0000e001 0x0017 Adaptec:SCSI bus controller + 12 0x5333 0x88f0 0xf4000000 0x0083 S3:VGA-compatible display co +</code> +as a result. If you do not have root privileges, the program will +bail out with +<code> +Permission denied: Failed to change I/O privilege. Are you root? +</code> +output might come handy for a bug report as well. + + + +<sect2>Using the test programs +<p> +Within the &Glide; distribution, you will find a folder with +test programs. Note that these test programs are under +&c3Dfx; copyright, and are legally available for use only +if you have purchased a board with a &c3Dfx; chipset. See +the LICENSE file in the distribution, or +their web site + <htmlurl + url="http://www.3dfx.com/" + name="www.3dfx.com"> for details. +<p> +It is recommend to compile and link the test programs even +if there happen to be binaries in the distribution. Note +that some of the programs will requires some files +like <tt>alpha.3df</tt> from the distribution to be available +in the same folder. +All test programs use the 640x480 screen resolution. Some +will request a veriety of single character inputs, others +will just state <tt>Press A Key To Begin Test</tt>. Beware +of loss of input scope if running X11 on the same screen +at the same time. +<p> +See the README.test for a list of programs, and other details. + + + + + +<sect>Answers To Frequently Asked Questions +<p> +The following section answers some of the questions that +(will) have been asked on the Usenet news groups and mailing +lists. The FAQ has been subdivided into several parts for +convenience, namely +<itemize> +<item>FAQ: Requirements? +<item>FAQ: &VooDoo;? &c3Dfx;? +<item>FAQ: &Glide;? +<item>FAQ: &Glide; and SVGA? +<item>FAQ: &Glide; and XFree86? +<item>FAQ: &Glide; versus OpenGL/Mesa? +<item>FAQ: But Quake? +<item>FAQ: Troubleshooting? +</itemize> +Each section lists several questions and answers, which +will hopefully address most problems. + + +<sect>FAQ: Requirements? + +<sect1>What are the system requirements? +<p> +A Linux PC, PCI 2.1 compliant, a monitor capable +of 640x480, and a 3D accelerator board based on +the &c3Dfx; &VooDoo;. It will work on a P5 or P6, +with or without MMX. The current version does not +use MMX, but it has some optimized code paths for P6. +<p> +At one point, some &c3Dfx; statements seemed to +imply that using Linux &Glide; required using a +RedHat distribution. Note that while +Linux &Glide; has originally been ported in a +RedHat 4.1 environment, it has been used and +tested with many other Linux distributions, +including homebrew, Slackware, and Debian 1.3.1. + +<sect1>Does it work with Linux-Alpha? +<p> +There is currently no Linux &Glide; distribution available +for any platform besides i586. As the &Glide; sources are +not available for distribution, you will have to +wait for the binary. Quantum3D has DEC Alpha support +announced for 2H97. Please contact Daryll Strauss +if you are interested in supporting this. +<p> +There is also the issue of porting the the assembly +modules. While there are alternative C paths in the +code, the assembly module in &Glide; (essentially +triangle setup) offered significant performance gains +depending on the P5 CPU used. + + +<sect1>Which &c3Dfx; chipsets are supported? +<p> +Currently, the &c3Dfx; &VooDoo; chipset is supported +under Linux. The &VooRush; chipset is not yet supported. + +<sect1>Is the &VooRush; supported? +<p> +The current port of &Glide; to Linux does not support +the &VooRush;. An update is in the works. +<p> +The problem is that at one point the &VooRush; driver +code in &Glide; depended on Direct Draw. There was +an SST96 based DOS portion in the library that could +theoretically be used for Linux, as soon as all +portions residing in the 2D/Direct Draw/D3D combo +driver are replaced. +<p> +Thus &VooRush; based boards like the +<em>Hercules Stingray 128/3D</em> +or <em>Intergraph Intense Rush</em> are not supported +yet. + + +<sect1>Which boards are supported? +<p> +There are no officially supported boards, as &c3Dfx; does +not sell any boards. This section does not attempt to +list all boards, it will just give an overview, and +will list only boards that have been found to cause +trouble. +<p> +It is important to recognize that Linux support for a given +board does not only require a driver for the 3D accelerator +component. If a board features its own VGA core as well, +support by either Linux SVGA or XFree86 is required as well +(see section about &VooRush; chipset). +Currently, an add-on solution is recommended, as it allows +you to choose a regular graphics board well supported for +Linux. There are other aspects discussed below. +<p> +All Quantum3D Obsidian boards, independend of texture +memory, frame buffer memory, number of Pixelfx and +Texelfx units, and SLI should work. Same for all other + &VooDoo; based boards, like Orchid Righteous 3D, Canopus +Pure 3D, Flash 3D, and Diamond Monster 3D. +&VooRush; based boards are not yet supported. +<p> +Boards that are not based on &c3Dfx; chipsets (e.g. manufactured +by S3, Matrox, 3Dlabs, Videologic) do <em>not</em> work with the &c3Dfx; +drivers and are beyond the scope of this document. + + + +<sect1>How do boards differ? +<p> +As the board manufacturers are using the same chipset, +any differences are due to board design. Examples are +quality of the pass-through cable and connectors +(reportedly, Orchid provided better quality than +Diamond), availability of a TV-compliant video +signal output (Canopus Pure 3D), and, most notably, +memory size on board. +<p> +Most common were boards for games +with 2MB texture cache and 2 MB framebuffer memory, +however, the Canopus Pure3D comes with a maximal +4 MB texture cache, which is an advantage e.g. +with games using dynamically changed textures, +and/or illumation textures (Quake, most notably). +The memory architecture of a typical &VooDoo; +board is described below, in a separate section. +<p> +Quantum 3D offers the widest selection of &c3Dfx;-based +boards, and is probably the place to go if you are +looking for a high end &VooDoo; based board configuration. +Quantum 3D is addressing the visual simulation market, +while most of the other vendors are only targetting the +consumer-level PC-game market. + + +<sect1>What about AGP? +<p> +There is no &VooDoo; or &VooRush; AGP board that I am +aware of. I am not aware of AGP support under Linux, +and I do not know whether upcmong AGP boards using +&c3Dfx; technology might possibly be supported with +Linux. + + + +<sect>FAQ: &VooDoo;? &c3Dfx;? + +<sect1>Who is &c3Dfx;? +<p> +&c3Dfx is a San Jose based manufacturer of 3D graphics +accelerator hardware for arcade games, game consoles, +and PC boards. +Their official website is +<htmlurl + url="http://www.3dfx.com/" + name="www.3dfx.com">. &c3Dfx; does not sell any boards, +but other companies do, e.g. Quantum3D. + + +<sect1>Who is Quantum3D? +<p> +Quantum3D started as a &c3Dfx; spin-off, manufacturing +high end accelerator boards based on &c3Dfx; chip +technology for consumer and business market, and +supplying arcade game technology. See +their home page at +<htmlurl + url="http://www.quantum3d.com/" + name="www.quantum3d.com"> +for additional information. For general inquiries +regarding Quantum3D, +please send mail to +<htmlurl + url="mailto:info@quantum3d" + name="info@quantum3d">. + + + +<sect1>What is the &VooDoo;? +<p> +The &VooDoo; is a chipset manufactured by &c3Dfx;. It +is used in hardware acceleration boards for the PC. +See the HOWTO section on supported hardware. + +<sect1>What is the &VooRush;? +<p> +The &VooRush; is a derivate of the &VooDoo; that +has an interface to cooperate with a 2D VGA +video accelerator, effectively supporting +accelerated graphics in windows. This combo +is currently not supported with Linux. + +<sect1>What is the &VooD2;? +<p> +The &VooD2; is the successor of the &VooDoo; chipset, +featuring several improvements. It is announced +for late March 1998, and annoucements of &VooD2; +based boards have been published e.g. by Quantum 3D, +by Creative Labs, Orchid Technologies, and +Diamond Multimedia. +<p> +The &VooD2; is supposed to be backwards compatible. +However, a new version of &Glide; will have to be +ported to Linux. + + +<sect1>What is VGA pass-though? +<p> +The &VooDoo; (but not the &VooRush;) boards are +add-on boards, meant to be used with a regular +2D VGA video accelerator board. In short, the +video output of your regular VGA board is used +as input for the &VooDoo; based add-on board, +which by default passes it through to the display +also connected to the &VooDoo; board. If the +&VooDoo; is used (e.g. by a game), it will +disconnect the VGA input signal, switch the +display to a 640x480 fullscreen mode with the +refresh rate configured by SST variables and +the application/driver, and generate the video +signal itself. The VGA doesn't need to be aware +of this, and won't be. +<p> +This setup has several advantages: free choice +of 2D VGA board, which is an issue with Linux, +as XFree86 drivers aren't available for all +chipsets and revisions, and a cost effective +migration path to accelerated 3D graphics. It +also has several disadvantages: an application +using the &VooDoo; might not re-enable video +output when crashing, and regular VGA video +signal deteoriates in the the pass-through +process. + +<sect1>What is &Texelfx; or TMU? +<p> +&VooDoo; chipsets have two units. The first one interfaces +the texture memory on the board, does the texture mapping, +and ultimately generates the input for the second unit +that interfaces the framebuffer. This one is called +&Texelfx;, aka Texture Management Unit, aka TMU. The neat +thing about this is that a board can use two &Texelfx; +instead of only one, like some of +the Quantum3D Obsidian boards did, effectively doubling the +processing power in some cases, depending on the application. +<p> +As each &Texelfx; can address 4MB texture memory, a dual +&Texelfx; setup has an effective texture cache of up to 8MB. +This can be true even if only one &Texelfx; is actually +needed by a particular application, as textures can be +distributed to both &Texelfx;, which are used depending +on the requested texture. Both &Texelfx; are used together +to perform certain operations as trilinear filtering and +illumination texture/lightmap passes (e.g. in glQuake) +in a single pass instead of the two passes that are +required with only one &Texelfx;. To actually exploit the +theoretically available speedup and cache size increase, +a &Glide; application has to use both &Texelfx; properly. +<p> +The two &Texelfx; can not be used separately to +each draw a textured triangle at the same time. A triangle +is always drawn using whatever the current setup is, +which can be to use both &Texelfx; for a single pass +operation combining two textures, or one &Texelfx; +for only a single texture. Each &Texelfx; can only +access its own memory. + + +<sect1>What is a &Pixelfx; unit? +<p> +&VooDoo; chipsets have two units. The second one interfaces +the framebuffer and ultimately generates the depth buffer +and pixel color updates. This one is called &Pixelfx;. The +neat thing here is that two &Pixelfx; units can cooperate +in SLI mode, like with some of the Quantum3D Obsidian boards, +effectively doubling the frame rate. + + +<sect1>What is SLI mode? +<p> +SLI means "Scanline Interleave". In this mode, two &Pixelfx; +are connected and render in alternate turns, one handling +odd, the other handling even scanlines of the actual output. +Inthis mode, each &Pixelfx; stores only half of the image +and half of the depth buffer data in its own local +framebuffer, effectively doubling the number of pixels. +<p> +The &Pixelfx; in question can be on the same board, +or on two boards properly connected. Some Quantum3D +Obsidian boards support SLI with &VooDoo;. +<p> +As two cards can decode the same PCI addresses and receive +the same data, there is not necessarily additional bus +bandwidth required by SLI. On the other hand, texture +data will have to be replicated on both boards, thus +the amount of texture memory effectively stays the same. + + +<sect1>Is there a single board SLI setup? +<p> +There are now two types of Quantum3D SLI boards. +The intial setup used two boards, two PCI slots, +and an interconnect (e.g. the Obsidian 100-4440). +The later revision which performs identically is +contained on one full-length PCI board (e.g. +Obsidian 100-4440SB). Thus a single board SLI +solution is possible, and has been done. + + +<sect1>How much memory? How many buffers? +<p> +The most essential difference between different boards +using the &VooDoo; chipset is the amount and +organization of memory. Quantum3D used a three digit +scheme to descibe boards. Here is a slightly modifed +one (anticipating &VooD2;). Note that if you use +more than one Texelfx, they need the same amount of +texture cache memory each, and if you combine two +Pixelfx, each needs the same amount of frame buffer +memory. +<code> + "SLI / Pixelfx / Texelfx1 / Texelfx2 " +</code> +It means that a common 2MB+2MB board would be a +<tt>1/2/2/0</tt> solution, with the minimally +required total 4Mb of memory. A Canopus Pure 3D +would be <tt>1/2/4/0</tt>, or 6MB. An Obsidian-2220 +board with two Texelfx would be <tt>1/2/2/2</tt>, +and an Obsidian SLI-2440 board would be <tt>2/2/4/4</tt>. +A fully featured dual board solution (2 Pixelfx, each +with 2 Texelfx and 4MB frame buffer, each Texelfx 4 MB +texture cache) would be <tt>2/4/4/4</tt>, and the +total amount of memory would be +<tt>SLI*(Pixelfx+Texelfx1+Texelfx2)</tt>, or 24 MB. +<p> +So there. + +<sect1>Does the &VooDoo; do 24 or 32 bit color? +<p> +No. The &VooDoo; architecture uses 16bpp internally. +This is true for &VooDoo;, &VooRush; and &VooD2; +alike. Quantum3D claims to implement 22-bpp effective color depth +with an enhanced 16-bpp frame buffer, though. + +<sect1>Does the &VooDoo; store 24 or 32 bit z-buffer per pixel? +<p> +No. The &VooDoo; architecture uses 16bpp internally +for the depth buffer, too. This again is true for &VooDoo;, +&VooRush; and &VooD2; alike. Again, Quantum3D claims +that using the floating point 16-bits per pixel (bpp) depth +buffering provides 22-bpp effective Z-buffer precision. + +<sect1>What resolutions does the &VooDoo; support? +<p> +The &VooDoo; chipset supports up to 4 MB frame buffer +memory. Presuming double buffering and a depth buffer, +a 2MB framebuffer will support a resolution of 640x480. +With 4 MB frame buffer, 800x600 is possible. +<p> +Unfortunately 960x720 is not supported. The &VooDoo; +chipset requires that the amount of memory for a particular +resolution must be such that the vertical and horizontal +resolutions must be evenly divisible by 32. The video +refresh controller, though can output any particular +resolution, but the "virtual" size required for the memory +footprint must be in dimensions evenly divisible by 32. +So, 960x720 actually requires 960x736 amount of memory, +and 960x736x2x3 = 4.04MBytes. +<p> +However, using two boards with SLI, or a dual &Pixelfx; +SLI board means that each framebuffer will only have +to store half of the image. Thus 2 times 4 MB in SLI +mode are good up to 1024x768, which is the maximum +because of the overall hardware design. You will be +able to do 1024x768 tripled buffered with Z, but you +will not be able to do e.g. 1280x960 with double +buffering. +<p> +Note that triple buffering (no VSync synchonization +required by the application), stereo buffering (for +interfacing LCD shutters) and other more demanding +setups will severely decrease the available resolution. + + +<sect1>What texture sizes are supported? +<p> +The maximum texture size for the &VooDoo; chipset +is 256x256, and you have to use powers of two. Note +that for really small textures (e.g. 16x16) you +are better off merging them into a large texture, +and adjusting your effective texture coordinates +appropriately. + +<sect1>Does the &VooDoo; support paletted textures? +<p> +The &VooDoo; hardware and &Glide; support the palette +extension to &OGL;. The most recent version of +&Mesa; does support the +<tt>GL_EXT_paletted_texture</tt> +and +<tt>GL_EXT_shared_texture_palette</tt> extensions. + + +<sect1>What about overclocking? +<p> +If you want to put aside considerations about warranty +and overheating, and want to do overclocking to boost +up performance even further, there is related info out +on the web. The basic mechanism is to use +&Glide; environment variables to adjust the clock. +<p> +Note that the actual recommended clock is board +dependend. While the default clock speed is 50 Mhz, +the Diamond Monster 3D property sheet lets you set up +a clock of 57 MHz. It all comes down to the design of +a specific board, and which components are used with +the &VooDoo; chipset - most notably access speed of +the RAM in question. If you exceed the limits of your +hardware, rendering artifacts will occur to say the +least. Reportedly, 57 MHz usually works, while 60 MHz +or more is already pushing it. +<p> +Increasing the clock frequency also means increasing +the waste heat disposed in the chips, in a nonlinear +dependency (10% increase in frequency means a lot +larger increase in heating). In consequence, for permanent +overclocking you might want to educate yourself about +ways to add cooling fans to the board in a way that does +not affect warranty. A very recommendable source is +the "3Dfx Voodoo Heat Report" by Eric van Ballegoie, +available on the web. + + +<sect1>Where could I get additional info on &VooDoo;? +<p> +There is a FAQ by &c3Dfx;, which should be available +at their +<htmlurl + url="http://www.3dfx.com/voodoo/faq.html" + name="web site">. +You will find retail information +at the following locations: +<htmlurl + url="http://www.3dfx.com/voodoo/sale/" + name="www.3dfx.com"> +and +<htmlurl + url="http://www.quantum3d.com/" + name="www.quantum3d.com">. +<p> +Inofficial sites that have good info +are "Voodoo Extreme" at +<htmlurl + url="http://www.ve3d.com/" + name="www.ve3d.com">, and +"Operation 3Dfx" +at +<htmlurl + url="http://www.ve3d.com/" + name="www.ve3d.com">. + + + +<sect>FAQ: &Glide;? &TexUs;? + +<sect1>What is &Glide; anyway? +<p> +&Glide; is a proprietary API plus drivers to access +3D graphics accelerator hardware based on chipsets +manufactured by &c3Dfx;. &Glide; has been developed +and implemented for DOS, Windows, and Macintosh, and +has been ported to Linux by Daryll Strauss. + +<sect1>What is &TexUs;? +<p> +In the distribution is a <tt>libtexus.so</tt>, which +is the &c3Dfx; Interactive Texture Utility Software. +It is an image processing libary and utility program +for preparing images for use with the &c3Dfx; +Interactive &Glide; library. Features of &TexUs; include +file format conversion, MIPmap creation, and support for +&c3Dfx; Interactive Narrow Channel Compression +textures. +<p> +The &TexUs; utility program <tt>texus</tt> +reads images in several popular formats (TGA, PPM, +RGT), generates MIPmaps, and writes the +images as &c3Dfx; Interactive textures files +(see e.g. alpha.3df, as found in the distribution) +or as an image file for inspection. For details +on the parameters for <tt>texus</tt>, and the +API, see the &TexUs; documentation. + + +<sect1>Is &Glide; freeware? +<p> +Nope. &Glide; is neither GPL'ed nor subject to any other +public license. See LICENSE in the distribution for any +details. Effectively, by downloading and using it, you +agree to the End User License Agreement (EULA) on the +&c3Dfx; web site. &Glide; is provided as binary only, +and you should +neither use nor distribute any files but the ones released +to the public, if you have not signed an NDA. The &Glide; +distribution including the test program sources are +copyrighted by &c3Dfx;. +<p> +The same is true for all the sources in the &Glide; +distribution. In the words of &c3Dfx;: These are not public +domain, but they can be freely distributed to +owners of 3Dfx products only. No card, No code! + +<sect1>Where do I get &Glide;? +<p> +The entire &c3Dfx; SDK is available for download off their +public web-site located at +<htmlurl + url="http://www.3dfx.com/software/download_glide.html" + name="www.3dfx.com/software/download_glide.html">. Anything +else &c3Dfx; publicly released by &c3Dfx; is nearby on +their website, too. +<p> +There is also an FTP site, +<htmlurl + url="ftp://ftp.3dfx.com/" + name="ftp.3dfx.com">. The FTP has a longer timeout, and some +of the larger files have been broken into 3 files +(approx. 3MB each). + + +<sect1>Is the &Glide; source available? +<p> +Nope. The &Glide; source is made available only based +on a special agreement and NDA with &c3Dfx;. + +<sect1>Is Linux &Glide; supported? +<p> +Currently, Linux &Glide; is unsupported. Basically, +it is provided under the same disclaimers +as the 3Dfx GL DLL (see below). +<p> +However, &c3Dfx; definitely wants to provide as much +support as possible, and is in the process of +setting up some prerequisites. For the time being, +you will have to rely on the &c3Dfx; newsgroup (see +below). +<p> +In addition, the Quantum3D web page claims that +Linux support (for Obsidian) is planned for both Intel +and AXP architecture systems in 2H97. + +<sect1>Where could I post &Glide; questions? +<p> +There are newsgroups currently available only on +the NNTP server <htmlurl + url="news://news.3dfx.com/" + name="news.3dfx.com"> run by 3Dfx. +This USENET groups are dedicated to +&c3Dfx; and &Glide; in general, and will mainly provide +assistance for DOS, Win95, and NT. The current +list includes: +<code> +3dfx.events +3dfx.games.glquake +3dfx.glide +3dfx.glide.linux +3dfx.products +3dfx.test +</code> +and the <tt>3dfx.oem.products.*</tt> group for +specific boards, eg. <tt>3dfx.oem.products.quantum3d.obsidian</tt>. +Please use +<htmlurl + url="news://news.3dfx.com/3dfx.glide.linux" + name="news.3dfx.com/3dfx.glide.linux"> for all +Lnux &Glide; related questions. +<p> +A mailing list dedicated to Linux &Glide; is in preparation +for 1Q98. Send mail to +<htmlurl + url="mailto:majordomo@gamers.org" + name="majordomo@gamers.org">, no subject, +body of the message <tt>info linux-3dfx</tt> to get +information about the posting guidelines, the +hypermail archive and how +to subscribe to the list or the digest. + + +<sect1>Where to send bug reports? +<p> +Currently, you should rely on the newsgroup (see above), +that is +<htmlurl + url="news://news.3dfx.com/3dfx.glide.linux" + name="news.3dfx.com/3dfx.glide.linux">. +There is no official support e-mail set up yet. +For questions not specific to Linux Glide, make sure +to use the other newsgroups. + +<sect1>Who is maintaining it? +<p> +&c3Dfx; will appoint an official maintainer soon. +Currently, inofficial maintainer of the Linux +&Glide; port is Daryll Strauss. Please post +bug reports in the newsgroup (above). If you +are confident that you found a bug not previously +reported, please mail to Daryll at +<htmlurl + url="mailto:daryll@harlot.rb.ca.us" + name="daryll@harlot.rb.ca.us"> + +<sect1>How can I contribute to Linux &Glide;? +<p> +You could submit precise bug reports. Providing sample +programs to be included in the distribution is another +possibility. A major contribution would be adding +code to the &Glide; based &VooMesa; driver source. +See section on &VooMesa; below. + + +<sect1>Do I have to use &Glide;? +<p> +Yes. As of now, there is no other &VooDoo; driver available +for Linux. At the lowest level, &Glide; is the only interface +that talks directly to the hardware. However, you +can write &OGL; code without knowing anything about &Glide;, +and use &Mesa; with the &Glide; based &VooMesa; driver. +It helps to be aware of the involvement of &Glide; for +recognizing driver limitations and bugs, though. +<!-- p> +For Win32 there is also OpenGVS, a cross platform high level +graphics API (located somewhere between the level of +&OGL; and IRIS Performer or OpenInventor). Quantum 3D is the +sole distributor of OpenGVS, contact is +John Archdeacon +<htmlurl + url="mailto:John Archdeacon <jarch@gemtech.com>" + name="jarch@gemtech.com"> --> + + +<sect1>Should I program using the Glide API? +<p> +That depends on the application you are heading for. +&Glide; is a proprietary API that is partly similar +to &OGL; or &Mesa;, partly contains features +only available as EXTensions to some &OGL; +implementations, and partly contains features not +available anywhere but within &Glide;. +<p> +If you want to use the &OGL; API, you will need +&Mesa; (see below). +&Mesa;, namely the &VooMesa; driver, offers an +API resembling the well documented and widely +used OpenGL API. However, the &VooMesa; driver +is in early alpha, and you will have to accept +performance losses and lack of support for some +features. +<p> +In summary, the decision is up to you - if you +are heading for maximum performance while +accepting potential problems with porting to +non-&c3Dfx; hardware, &Glide; is not a bad +choice. If you care about maintenance, &OGL; +might be the best bet in the long run. + + +<sect1>What is the &Glide; current version? +<p> +The current version of Linux &Glide; is &GlVer;. +The next version will probably be identical to +the current version for DOS/Windows, which is 2.4.3, +which comes in two distributions. Right now, various +parts of &Glide; are different for &VooRush; (VR) +and &VooDoo; (VG) boards. Thus you have to pick up +separate distributions (under Windows) for VR and VG. +The same will be true for Linux. There will possibly +be another chunk of code and another distribution for +&VooD2; (V2) boards. +<p> +There is also a &Glide; 3.0 in preparation that +will extend the API for use of triangle fans +and triangle strips, and provide better state +change optimization. Support for fans and strips +will in some situations significantly reduce the +amount of data sent ber triangle, and the +&Mesa; driver will benefit from this, as +the &OGL; API has separate modes for this. For +a detailed explanation on this see e.g. the +&OGL; documentation. + + +<sect1>Does it support multiple &Texelfx; already? +<p> +Multiple &Texelfx;/TMU's can be used for single pass +trilinear mipmapping for improvement image +quality without performance penalty in current +Linux &Glide; already. You will need a board +with two &Texelfx; (that is, one of the appropriate +Quantum3D Obsidian boards). The application needs +to specify the use of both &Texelfx; accordingly, +it does not happen automatically. +<p> +Note that because most applications are implemented for +consumer boards with a single &Texelfx;, they might not +query the presence of a second &Texelfx;, and thus not +use it. This is not a flaw of &Glide; but of the +application. + + + +<sect1>Is Linux &Glide; identical to DOS/Windows &Glide;? +<p> +The publicly available version of Linux &Glide; should +be identical to the respective DOS/Windows versions. +Delays in releasing the Linux port of newer DOS/Windows +releases are possible. + +<sect1>Where to I get information on &Glide;? +<p> +There is exhaustive information available from +&c3Dfx;. You could download it from their home +page at +<htmlurl + url="http://www.3dfx.com/software/download_glide.html" + name="www.3dfx.com/software/download_glide.html">. +These are for free, presuming you bought a &c3Dfx; +hardware based board. Please read the licensing regulations. +<p> +Basically, you should look for some of the following: +<itemize> +<item><em>Glide Release Notes</em> +<item><em>Glide Programming Guide</em> +<item><em>Glide Reference Manual</em> +<item><em>Glide Porting Guide</em> +<item><em>TexUs Texture Utility Software</em> +<item><em>ATB Release Notes</em> +<item><em>Installing and Using the Obsidian</em> +</itemize> +These are available as Microsoft Word documents, and +part of the Windows Glide distribution, i.e. +the self-extracting archive file. Postscript copies +for separate download should be available at +<htmlurl +url="http://www.3dfx.com/software/download_glide.html" +name="www.3dfx.com"> as well. Note that the release +numbers are not always in sync with those of &Glide;. + + +<sect1>Where to get some &Glide; demos? +<p> +You will find demo sources for &Glide; within the +distribution (test programs), and on the &c3Dfx; home +page. The problem with the latter is that some require +ATB. To port these demos to Linux, the event handling +has to be completely rewritten. +<p> +In addition, you might find useful some of the &OGL; +demo sources accompanying Mesa and GLUT. While +the &Glide; API is different from the &OGL; API, +they target the same hardware rendering pipeline. + + +<sect1>What is ATB? +<p> +Some of the &c3Dfx; demo programs for &Glide; depend +not only on &Glide; but also on &c3Dfx;'s proprietary Arcade +Toolbox (ATB), which is available for DOS and Win32, +but has not been ported for Linux. If you are a devleoper, +the sources are available within the Total Immersion +program, so porting ATB to Linux would be possible. +<p> + +<sect>FAQ: &Glide; and XFree86? +<p> +<sect1>Does it run with XFree86? +<p> +Basically, the &VooDoo; hardware does not care about X. The +X server will not even notice that the video signal generated +by the VGA hardware does not reach the display in single screen +configurations. If your application is not written X aware, +&Glide; switching to full screen mode might cause problems +(see troubleshooting section). If you do not want the overhead +of writing an X11-aware application, you might want to use +SVGA console mode instead. +<p> +So yes, it does run with XFree86, but no, it is not cooperating +if you don't write your application accordingly. You can use +the &Mesa; "window hack", which will be significantly slower +than fullscreen, but still a lot faster than software rendering +(see section below). + + +<sect1>Does it only run full screen? +<p> +See above. The &VooDoo; hardware is not window environment +aware, neither is Linux &Glide;. Again, the experimental +&Mesa; "window hack" covered below will allow for pasting +the &VooDoo; board framebuffer's content into an X11 window. + + +<sect1>What is the problem with AT3D/&VooRush; boards? +<p> +There is an inherent problem when using +&VooRush; boards with Linux: Basically, these +boards are meant to be VGA 2D/3D accelerator +boards, either as a single board solution, +or with a &VooRush; based daughterboard used +transparently. The VGA component tied to the +&VooRush; is a Alliance Semiconductor's +ProMotion-AT3D multimedia accelerator. +To use this e.g. with XFree86 at all, you need +a driver for the AT3D chipset. +<p> +There is a mailing list on this, and a web site +with FAQ at +<htmlurl + url="http://www.frozenwave.com/linux-stingray128" + name="www.frozenwave.com/linux-stingray128">. +Look there for most current info. +There is a SuSE maintained driver at +<htmlurl + url="ftp://ftp.suse.com/suse_update/special/xat3d.tgz" + name="ftp.suse.com/suse_update/special/xat3d.tgz">. +Reportedly, the XFree86 SVGA server also +works, supporting 8, 16 and 32 bpp. +Official support will probably be in XFree86 4.0. +XFree86 decided to prepare an intermediate XFree86 3.3.2 +release as well, which might already address the issues. +<p> +The +following <tt>XF86Config</tt> settings reportedly work. +<code> +# device section settings +Chipset "AT24" +Videoram 4032 + +# videomodes tested by Oliver Schaertel +# 25.18 28.32 for 640 x 480 (70hz) +# 61.60 for 1024 x 786 (60hz) +# 120 for 1280 x 1024 (66hz) +</code> +In summary, there is nothing prohibiting this except +for the fact that the drivers in XFree86 are not yet +finished. +<p> +If you want a more technical explanation: &VooRush; support +requires X server changes to support grabbing a buffer +area in the video memory on the AT3D board, as the &VooRush; +based boards need to store their back buffer and z buffer +there. This memory allocation and locking requirement is not +a &c3Dfx; specific problem, it is also needed e.g. for +support of TV capture cards, and is thus under active +development for XFree86. This means changes at the +device dependend X level (thus XAA), which are currently +implemented as an extension to XFree86 DGA (Direct Graphics +Access, an X11 extension proposal implemented in different ways +by Sun and XFree86, that is not part of the final X11R6.1 +standard and thus not portable). It might be part of an +XFree86 GLX implementation later on. The currently distributed +X servers assume they have full control of the framebuffer, +and use anything that is not used by the visual region of the +framebuffer as pixmap cache, e.g. for caching fonts. + + +<sect1>What about GLX for XFree86? +<p> +There are a couple of problems. +<p> +The currently supported &VooDoo; hardware and the available +revision of Linux &Glide; are full screen only, and not set up +to share a framebuffer with a window environment. Thus GLX +or other integration with X11 is not yet possible. +<p> +The &VooRush; might be capable of cooperating with XFree86 +(that is, an SVGA compliant board will work with the +XFree86 SVGA server), +but it is not yet supported by Linux &Glide;, nor do +S3 or other XFree86 servers support these boards yet. +<p> +In addition, GLX is tied to &OGL; or, in the Linux case, to &Mesa;. +The XFree86 team is currently working on integrating Mesa with +their X Server. GLX is in beta, XFree86 3.3 has the hooks for GLX. +See Steve Parker's GLX pages at +<htmlurl + url="http://www.cs.utah.edu/~sparker/xfree86-3d/" + name="www.cs.utah.edu/~sparker/xfree86-3d/"> +for the most recent information. +Moreover, there is a joint effort by XFree86 and +SuSe, which includes a GLX, see +<htmlurl + url="http://www.suse.de/~sim/" + name="www.suse.de/~sim/">. +Currently, &Mesa; still uses its GLX emulation with Linux. + + +<sect1>&Glide; and commerical X Servers? +<p> +I have not received any mail regarding use +of &Glide; and/or Mesa with commercial X Servers. +I would be interested to get confirmation on this, +especially on Mesa and &Glide; with a commercial +X Server that has GLX support. + + +<sect1>&Glide; and SVGA? +<p> +You should have no problems running &Glide; based applications +either single or dual screen using VGA modes. It might be a good +idea to set up the 640x480 resolution in the SVGA modes, too, +if you are using a single screen setup. + +<sect1>&Glide and GGI? +<p> +A GGI driver for &Glide; is under development by Jon +M. Taylor, but has not officially been released and was put +on hold till completion of GGI 0.0.9. For information about +GGI see +<htmlurl + url="http://synergy.caltech.edu/~ggi/" + name="synergy.caltech.edu/~ggi/">. +If you are adventurous, +you might find the combination of XGGI (a GGI based +X Server for XFree86) and GGI for &Glide; an interesting +prospect. There is also a GGI driver interfacing the +&OGL; API; tested with unaccelerated Mesa. Essentially, +this means X11R6 running on a &VooDoo;, using +either Mesa or &Glide; directly. + + + +<sect>FAQ: &OGL;/&Mesa;? + +<sect1>What is &OGL;? +<p> +&OGL; is an immediate mode graphics programming API +originally developed by SGI based on their previous +proprietary Iris GL, and became in industry standard +several years ago. It is defined and maintained by +the Architectural Revision Board (ARB), an organization +that includes members as SGI, IBM, and DEC, and Microsoft. +<p> +&OGL; provides a complete feature set for 2D and +3D graphics operations in a pipelined hardware +accelerated architecture for triangle and polygon +rendering. In a broader sense, &OGL; is a powerful +and generic toolset for hardware assisted computer +graphics. + + +<sect1>Where to get additional information on OpenGL? +<p> +The official site for &OGL; maintained by the members +of the ARB, is +<htmlurl + url="http://www.opengl.org/" + name="www.opengl.org">, +<p> +A most recommended site is Mark Kilgard's Gateway to &OGL; +Info at +<htmlurl + url="http://reality.sgi.com/mjk_asd/opengl-links.html" + name="reality.sgi.com/mjk_asd/opengl-links.html">: +it provides pointers to book, online manual pages, GLUT, +GLE, Mesa, ports to several OS, tons of demos and tools. +<p> +If you are interested in game programming using &OGL;, +there is the <tt>OpenGL-GameDev-L@fatcity.com</tt> at +<tt>Listserv@fatcity.com</tt>. Be warned, this is +a high traffic list with very technical content, and +you will probably prefer to use <tt>procmail</tt> to +handle the 100 messages per day coming in. You cut +down bandwidth using the + <tt>SET OpenGL-GameDev-L DIGEST</tt> +command. It is also +not appropriate if you are looking for introductions. +The archive is handled by the ListServ software, use +the + <tt>INDEX OpenGL-GameDev-L</tt> +and + <tt>GET OpenGL-GameDev-L "filename"</tt> +commands to get a preview before subscribing. + + + +<sect1>Is Glide an &OGL; implementation? +<p> +No, &Glide; is a proprietary &c3Dfx; API which several features +specific to the &VooDoo; and &VooRush;. A &c3Dfx; OpenGL is +in preparation (see below). Several Glide features would require +EXTensions to OpenGL, some of which already found in other +implementations (e.g. paletted textures). +<p> +The closest thing to a hardware accelerated Linux &OGL; +you could currently get is Brian Paul's &Mesa; +along with David Bucciarelli's &VooMesa; driver (see below). + + +<sect1>Is there an &OGL; driver from &c3Dfx;? +<p> +Both the &c3Dfx; website and the Quantum3D website +announced &OGL; for &VooDoo; to be available 4Q97. +The driver is currently in Beta, and accessible only +to registered deverloper's under written Beta test +agreement. +<p> +A linux port has not been announced yet. + + +<sect1>Is there a commercial &OGL; for Linux and &c3Dfx;? +<p> +I am not aware of any third party commercial OpenGL +that supports the &VooDoo;. Last time I paid attention, +neither MetroX nor XInside OpenGL did. + + +<sect1>What is Mesa? +<p> +Mesa is a free implementation of the &OGL; API, designed +and written by Brian Paul, with contributions from many +others. Its performance is competitive, and while it +is not officially certified, it is an almost fully +compliant &OGL; implementation conforming to the ARB +specifications - more complete than some commercial +products out, actually. + + +<sect1>Does Mesa work with &c3Dfx;? +<p> +The latest &Mesa; MesaVer; release works with +Linux &Glide; &GlVer;. In fact, support was included +in earlier versions, however, this driver is still under +development, so be prepared for bugs and less than optimal +performance. It is steadily improving, though, and bugs +are usually fixed very fast. +<p> +You will need to get the Mesa library archive +from the +<htmlurl + url="ftp://iris.ssec.wisc.edu/" + name="iris.ssec.wisc.edu FTP site">. +It is recommended to subscribe to the mailing list +as well, especially when trying to track down bugs, +hardware, or driver limitations. Make sure to get +the most recent distribution. A Mesa-3.0 is in +preparation. + + +<sect1>How portable is &Mesa; with &Glide;? +<p> +It is available for Linux and Win32, and any application +based on Mesa will only have the usual system specific +code, which should usually mean XWindows vs. Windows, +or GLX vs. WGL. If you use e.g. GLUT or Qt, you should +get away with any system specifics at all for virtually +most +applications. There are only a few issues (like sampling +relative mouse movement) that are not adressed by the +available portable GUI toolkits. +<p> +&Mesa;/&Glide; is also available for DOS. The port +which is 32bit DOS is maintained by Charlie Wallace +and kept up to date with the main Mesa base. See +<htmlurl + url="http://www.geocities.com/~charlie_x/" + name="www.geocities.com/~charlie_x/">.for the +most current releases. + + +<sect1>Where to get info on &Mesa;? +<p> +The &Mesa; home page is at +<htmlurl + url="http://www.ssec.wisc.edu/~brianp/Mesa.html" + name="www.ssec.wisc.edu/~brianp/Mesa.html">. +There is an archive of the Mesa mailing list. +at +<htmlurl + url="http://www.iqm.unicamp.br/mesa/" + name="www.iqm.unicamp.br/mesa/">. This list is +not specific to &c3Dfx; and &Glide;, but if +you are interested in using &c3Dfx; hardware +to accelerate &Mesa;, it is a good place to +start. + +<sect1>Where to get information on &VooMesa;? +<p> +For latest information on the &VooMesa; driver +maintained by David Bucciarelli +<htmlurl + url="mailto:tech.hmw@plus.it" + name="tech.hmw@plus.it"> +see the home page at +<htmlurl + url="http://www-hmw.caribel.pisa.it/fxmesa/index.shtml" + name="www-hmw.caribel.pisa.it/fxmesa/">. + + + +<sect1>Does Mesa support multitexturing? +<p> +Not yet (as of &Mesa; &MesaVer;), but it is on the list. +In &Mesa; you will probably have to use the &OGL; +<tt>EXT_multitexture</tt> extension once it is +available. There is no final specification for +multitextures in &OGL;, which is supposed to be +part of the upcoming &OGL; 1.2 revision. There might +be a &Glide; driver specific implementation of +the extension in upcoming Mesa releases, but as +long as only certain Quantum3D Obsidian boards come +with multiple TMU's, it is not a top priority. This +will surely change once &VooD2; based boards are in +widespread use. + + + + +<sect1>Does Mesa support single pass trilinear mipmapping? +<p> +Multiple TMU's should be used for single pass +trilinear mipmapping for improvement image +quality without performance penalty in current +Linux &Glide; already. Mesa support is not +yet done (as of &Mesa; &MesaVer;), but is in +preparation. + + + +<sect1>What is the Mesa "Window Hack"? +<p> +The most recent revisions of Mesa contain an experimental +feature for Linux XFree86. Basically, the GLX emulation +used by Mesa copies the contents of the &VooDoo; board's +most recently finished framebuffer content into video +memory on each <tt>glXSwapBuffers</tt> call. This feature +is also available with Mesa for Windows. +<p> +This obviously puts some drain on the PCI, doubled by +the fact that this uses X11 MIT SHM, not XFree86 DGA +to access the video memory. The same approach could +theoretically be used with e.g. SVGA. The major benefit +is that you could use a &VooDoo; board for accelerated +rendering into a window, and that you don't have to +use the VGA passthrough mode (video output +of the VGA board deteoriates in passing through, +which is very visible with high end monitors like +e.g. EIZO F784-T). +<p> +Note that this experimental feature is <em>NOT</em> +&VooRush; support by any means. It applies only +to the &VooDoo; based boards. Moreover, you need to +use a modified GLUT, as interfacing the window +management system and handling the events appropriately +has to be done by the application, it is not handled +in the driver. +<p> +Make really sure that you have enabled the +following environment variables: +<code> +export SST_VGA_PASS=1 # to stop video signal switching +export SST_NOSHUTDOWN=1 # to stop video signal switching +export MESA_GLX_FX="window" # to initiate Mesa window mode +</code> +If you manage to forget one of the SST variables, your +VGA board will be shut off, and you will loose the +display (but not the actual X). It is pretty hard to +get that back being effectively blind. +<p> +Finally, note that the libMesaGL.a (or .so) library can contain +multiple client interfaces. I.e. the GLX, OSMesa, and fxMesa +(and even SVGAMesa) interfaces call all be compiled into the +same libMesaGL.a. The client program can use any of them freely, +even simultaneously if it's careful. + + + + +<sect1>How about GLUT? +<p> +Mark Kilgard's GLUT distribution is a very good place to +get sample applications plus a lot of useful utilities. +You will find it at +<htmlurl + url="http://reality.sgi.com/mjk_asd/glut3/glut3.html" + name="reality.sgi.com/mjk_asd/glut3/">, +and you should get it anyway. The current release is +GLUT 3.6, and discussion on a GLUT 3.7 (aka GameGLUT) +has begun. Note that Mark Kilgard has left SGI recently, +so the archive might move some time this year - for the +time being it will be kept at SGI. +<p> +There is also a GLUT mailing list, +<tt>glut@perp.com</tt>. Send mail to +<htmlurl + url="mailto:Majordomo@perp.com" + name="majordomo@perp.com">, +with the (on of the) following +in the body of your email message: +<code> + help + info glut + subscribe glut + end +</code> +<p> +As GLUT handles double buffers, windows, events, +and other operations closely tied to hardware and operating +system, using GLUT with &VooDoo; requires support, which +is currently in development within GLX for Mesa. It +already works for most cases. + + +<sect>FAQ: But Quake? + +<sect1>What about that &c3Dfx; GL driver for Quake? +<p> +The &c3Dfx; Quake GL, aka mini-driver, aka miniport, +aka Game GL, aka &c3Dfx; GL alpha, implemented only a +Quake-specific subset of OpenGL (see +<htmlurl +url="http://www.cs.unc.edu/~martin/3dfx.html" +name="http://www.cs.unc.edu/~martin/3dfx.html"> for +an inofficial list of supported code paths). It is +not supported, and not updated anymore. +It was a Win32 DLL (<tt>opengl32.dll</tt>) released +by &c3Dfx; and was available for Windows only. This +DLL is not, and will not be ported to Linux. + +<sect1>Is there a &c3Dfx; based glQuake for Linux? +<p> +Yes. A Quake linuxquake v0.97 binary has been released +based on Mesa with Glide. The Quake2 q2test binary +for Linux and &VooDoo; has been made available as well. +A full Quake2 for Linux was released in January 1998, +with linuxquake2-3.10. Dave "Zoid" Kirsch is the +official maintainer of all Linux ports of Quake, +Quakeworld, and Quake2, including all the recent +&Mesa; based ports. Note that all Linux ports, including +the &Mesa; based ones, are not officially supported by +id Software. +<p> +See +<htmlurl +url="ftp://ftp.idsoftware.com/idstuff/quake/unix/" +name="ftp.idsoftware.com/idstuff/quake/unix/"> for +the latest releases. + +<sect1>Does glQuake run in an XFree86 window? +<p> +A revision of &Mesa; and the &Mesa;-based Linux glQuake +is in preparation. &Mesa; already does support this +by GLX, but Linux glQuake does not use GLX. + + +<sect1>Known Linux Quake problems? +<p> +Here is an excerpt, as of January 7th, 1998. I omitted +most stuff not specific to &3Dfx; hardware. +<itemize> +<item> + You really should run Quake2 as root when using the SVGALib and/or GL + renders. You don't have to run as root for the X11 refresh, but the modes + on the mouse and sound devices must be read/writable by whatever user you + run it as. Dedicated server requires no special permissions. +<item> + X11 has some garbage on the screen when 'loading'. This is normal in 16bit + color mode. X11 doesn't work in 24bit (TrueColor). It would be very slow + in any case. +<item> + Some people are experiencing crashes with the GL renderer. Make sure you + install the libMesa that comes with Quake2! Older versions of libMesa don't + work properly. +<item> + If you are experience video 'lag' in the GL renderer (the frame rate feels + like it's lagging behind your mouse movement) type "gl_finish 1" in the + console. This forces update on a per frame basis. +<item> + When running the GL renderer, make sure you have killed selection and/or + gpm or the mouse won't work as they won't "release" it while Quake2 is + running in GL mode. +</itemize> + +<sect1>Know Linux Quake security problems? +<p> +As Dave Kirsch posted on January 28th, 1998: an exploit +for Quake2 under Linux has been published. Quake2 is using +shared libraries. While the READMRE so far does not +specifically mention it, note that Quake2 should not be +<tt>setuid</tt>. +<p> +If you want to use the <tt>ref_soft</tt> and <tt>ref_gl</tt> +renderers, you should run Quake2 as root. Do not make the +binary setuid. You can only run both those renderers at +the console only, so being root is not that much of an issue. +<p> +The X11 render does not need any root permissions +(if <tt>/dev/dsp</tt> is writable by others for sound). +The dedicated server mode does not need to be root either, +obviously. +<p> +Problems such as root requirements for games has been sort +of a sore spot in Linux for a number of years now. This is +one of the goals that e.g. GGI is targetting to fix. +A <tt>ref_ggi</tt> might be supported in the near future. + +<sect1>Does LinuxQuake use multitexturing? +<p> +To my understadnding, glQuake will use a multitexture +EXTension if the &OGL; driver in question offers it. +The current Mesa implementation and the &Glide; driver +for Linux do not yet support this extension, so for the +time being the answer is no. See section on Mesa and +multitexturing for details. + + +<sect1>Where can I get current information on Linux glQuake? +<p> +Try some of these sites: the "The Linux Quake Resource" at +<htmlurl +url="http://linuxquake.telefragged.com/" +name="linuxquake.telefragged.com">, or +the "Linux Quake Page" at +<htmlurl +url="http://www.planetquake.com/threewave/linux/" +name="www.planetquake.com/threewave/linux/">. +Alternatively, you could look for Linux Quake sites +in the "SlipgateCentral" database at +<htmlurl +url="http://www.slipgatecentral.com/" +name="www.slipgatecentral.com">. + + + +<sect>FAQ: Troubleshooting? + +<sect1>Has this hardware been tested? +<p> +See hardware requirements list above. I currently do not +maintain a conclusive list of vendors and boards, as no +particular board specific problems have been verified. +Currently, only &c3Dfx; and Quantum3D provide boards +for testing to the developers, so Quantum3D consumer +boards are a safe bet. Every other &VooDoo; based board +should work, too. I have reports regarding the +Orchid Righteous 3D, Guillemot Maxi 3D Gamer, and +Diamond Monster 3D. +<p> +If you are a board manufacturer who wants to make +sure his &VooDoo;, &VooRush; or &VooD2; boards work +with upcoming releases of Linux, Xfree86, Linux &Glide; +and/or Mesa, please contact me, and I will happily forward +your request to the persons maintaining the drivers in +question. If you are interested in support for Linux &Glide; +on other then the PC platfrom, e.g. DEC Alpha, please +contact the maintainer of Linux &Glide; Daryll Strauss, at +<htmlurl + url="mailto:daryll@harlot.rb.ca.us" + name="daryll@harlot.rb.ca.us"> + + +<sect1>Failed to change I/O privilege? +<p> +You need to be root, or <tt>setuid</tt> your +application to run a &Glide; based application. +For DMA, the driver accesses <tt>/dev/mem</tt>, +which is not writeable for anybody but root, +with good reasons. See the README in the +&Glide; distribution for Linux. + + +<sect1>Does it work without root privilege? +<p> +There are compelling case where the setuid requirement is a +problem, obviously. There are currently solutions in +preparation, which require changes to the library internals +itself. + + +<sect1>Displayed images looks awful (single screen)? +<p> +If you are using the analog pass through configuration, +the common SVGA or X11 display might look pretty bad. +You could try to get a better connector cable than +the one provided with the accelerator board (the +ones delivered with the Diamond Monster 3D are +reportedly worse then the one accompanying the +Orchid Righteous 3D), but up to a degree there will +inevitably be signal loss with an additional +transmission added. +<p> +If the 640x480 full screen image created by the +accelerator board does look awful, this might indicate +a real hardware problem. You will have to contact +the board manufacturer, not &c3Dfx; for details, as +the quality of the video signal has nothing to do +with the accelerator - the board manufacturer chooses +the RAMDAC, output drivers, and other components +responsible. + + +<sect1>The last frame is still there (single or dual screen)? +<p> +You terminated your application with Ctrl-C, or it +did not exit normally. The accelerator board will +dutifully provide the current content of the +framebuffer as a video signal unless told otherwise. + + +<sect1>Powersave kicks in (dual screen)? +<p> +When you application terminates in dual screen setups, +the accelerator board does not provide video output +any longer. Thus powersave kicks each time. To avoid +this, use +<code> +setenv SST_DUALSCREEN 1 +</code> + + +<sect1>My machine seem to lock (X11, single screen)? +<p> +If you are running X when calling a &Glide; +application, you probably moved the mouse out +of the window, and the keyboard inputs do +not reach the application anymore. +<p> +If you application is supposed to run concurrently +with X11, it is recommend to expose a full screen +window, or use the <tt>XGrabPointer</tt> and +<tt>XGrabServer</tt> +functions to redirect all inputs to the application +while the X server cannot access the display. Note +that grabbing all input with <tt>XGrabPointer</tt> and +<tt>XGrabServer</tt> does not qualify as well-behaved +application, and that your program might block the +entire system. +<p> +If you experience this problem without running X, +be sure that there is no hardware conflict (see below). + +<sect1>My machine locks (single or dual screen)? +<p> +If the system definitely does not respond to any inputs +(you are running two displays and know about the loss +of focus), you might experience a more or less +subtle hardware conflict. +See installation troubleshooting section for details. +<p> +If there is no obvious address conflict, there might +still be other problems (below). If you are writing your +own code the most common reason for locking is that you +didn't snap your vertices. See the section on snapping +in the &Glide; documentation. + +<sect1>My machine locks (used with S3 VGA board)? +<p> +It is possible you have a problem with memory +region overlap specific to S3. There is some +info and a patch to the so-called S3 problem +in the &c3Dfx; web site, but these apply to Windows +only. To my understanding, the cause of the problem +is that some S3 boards (older revisions of Diamond +Stealth S3 968) reserve more memory space than +actually used, thus the &VooDoo; has to be mapped +to a different location. However, this has not +been reported as a problem with Linux, and might +be Windows-specific. + + +<sect1>No address conflict, but locks anyway? +<p> +If you happen to use a motherboard with non-standard +or incomplete PCI support, you could try to +shuffle the boards a bit. I am running an ASUS +TP4XE that has that non-standard modified "Media Slot", +i.e. PCI slot4 with additional connector for +ASUS-manufactured SCSI/Sound combo boards, +and I experienced severe problems while running a +Diamond Monster 3D in that slot. The system operates +flawlessly since I put the board in one of the +regular slots. + + +<sect1>Mesa runs, but does not access the board? +<p> +Be sure that you recompiled all the libraries (including +the toolkits the demo programs use - remember that +GLUT does not yet support &VooDoo;), and that you +removed the older libraries, run <tt>ldconfig</tt>, +and/or set your <tt>LD_LIBRARY_PATH</tt> properly. +&Mesa; supports several drivers in parallel (you could +use X11 SHM, off screen rendering, and &VooMesa; at +the same time), and you might have to create and +switch contexts explicitely (see <tt>MakeCurrent</tt> +function) if the &VooDoo; isn't chosen by default. + + +<sect1>Resetting dual board SLI? +<p> +If a Quantum 3D Obsidian board using in an SLI setup +exits abruptly (i.e., the application crashes, or is +aborted by user), the boards are left in an undefined +state. With the dual-board set, you can run a +program called <tt>resetsli</tt> to reset them. Until +you run the <tt>resetsli</tt> program, you will not +be able to re-initialize the Obsidian board. + + +<sect1>Resetting single board SLI? +<p> +The <tt>resetsli</tt> program mentioned above does not +yet work with a single board Obsidian SLI (e.g. the +Obsidian 100-4440SB). You will have to reboot your +system by reset in order to reset the board. + + +</article> + + + + +<!-- ================================================= --> +<!-- end of Linux3Dfx.sgml --> +<!-- + Local Variables: + mode: sgml + End: --> +<!-- ================================================= --> diff --git a/LDP/retired/BTI-PPP.sgml b/LDP/retired/BTI-PPP.sgml new file mode 100644 index 00000000..69e5ee08 --- /dev/null +++ b/LDP/retired/BTI-PPP.sgml @@ -0,0 +1,882 @@ +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> +<article> + +<artheader> + <title>BTinternet pppd mini-HOWTO + + + Matt + Wright + + Matt Wright Consulting +
+ matt@consultmatt.co.uk +
+
+
+ + + Greg + Ferguson + Converted the mini-HOWTO from HTML to Docbook 3.1 (SGML). + + + 2002-03-26 + + + + v0.29 + 2002-03-26 + mww + + Added a small bit of first-hand tech support about + cross-talk. Thanks goto Bill Staehle once again for typing, + technical and grammar points. + + + + v0.28 + 2002-01-17 + mww + + New information about PPPoATM involving kernels and + distibutions. + + + + v0.27 + 2001-12-20 + mww + + Minor technical problems highlighted by Robert Smith. + + + + v0.26 + 2001-11-21 + mww + + Added a point about the Kernel HOWTO. + + + + v0.25 + 2001-11-17 + mww + + Added a troubleshooting answer about "_mmx_memcpy". Other minor updates as well. + + + + v0.24 + 2001-11-09 + mww + + Technical detail with the chatscript timeout (and found a spelling mistake or two!). Thanks again to Bill Staehle. + + + + v0.23 + 2001-11-07 + mww + + Changed the Chatscript dialing method, thanks go to TonyC from btinternet.linux newsgroup. + + + + v0.22 + 2001-11-06 + mww + + Changed a couple more little botches. Thanks again go to Bill Staehle. + + + + v0.21 + 2001-11-03 + mww + + Changed discrepancies reported by Bill Staehle. + + + + v0.20 + 2001-11-01 + mww + + Added Alcatel Speedtouch Information. + + + + v0.19 + 2001-10-31 + mww + + Initial public release. + + + + + + + This document describes how to setup a modem pppd link to + Btinternet in the UK. + + + + + + +Introduction + +This HOWTO exists because a mate of mine needed to easily set up an +Internet connection to BTinternet and here is a quick and concise way +to get a running PPPd to Btinternet. This HOWTO also briefly covers +Howto setup basic IP Masquerading to allow connection sharing. + + + +Copyright and License + +This document is Copyright 2001 by Matt Wright. Permission is granted +to copy, distribute and/or modify this document under the terms of +the GNU Free Documentation License, Version 1.1 or any later version +published by the Free Software Foundation; with no Invariant +Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A +copy of the license is available at +http://www.gnu.org/copyleft/fdl.html + + +Send feedback to +matt@consultmatt.co.uk. + + + + + +Mailing Lists + +Please note: There is a mailing list available for this howto. If you wish to join please email majordomo@consultmatt.co.uk with the body: + +subscribe bti-howto + +This will then be followed up by the mailing list bot and subsequent emails should arrive confirming your request. The list is intended to be for annoucing changes to this HOWTO and also to dicuss the finer points of getting pppd to work on BTinternet. + + + + +About the author + + My name is Matt Wright. I'm 16 year-old student in Blackburn, +Lancashire. I'm a freelance Linux consultant. I am the proud owner of +a Duron 950Mhz (all I could easily afford) with 256MB SDRAM, Voodoo 4 +Video Card, ATI All-in-Wonder Pro Video Card. I also have a 266Mhz Cyrix +that runs my USB ADSL connection, of which if you are reading this from +http://www.consultmatt.co.uk +you will be using. + + +You can find me at www.consultmatt.co.uk. Or at matt@consultmatt.co.uk. + + + + +Acknowledgements +A major thanks of gratitude to the guys at Linuxdoc in particular Greg Ferguson and David Merrill for help with getting this into trusty SGML. Also to Rob Smith the guy behind me writing this :) (As he couldn't sort his own Linux box out :P). A great vote of thanks to Bill Staehle for his input in ironing out some major flaws. Also a thank you goes to TonyC at btinternet.linux and the rest of that newsgroup for originally getting me on my feet with BTi. Finally and most importantly my thanks goto my Lord and Saviour Jesus Christ, without whom I'd be lost. + + + + + + +Requirements + +The following is needed to use this HOWTO: + + + + A working modem, external or internal hardware modems are the easiest to get working, see Modem-HOWTO. If you have a WinModem then see Winmodems and Linux HOWTO + + An account with Btinternet, this HOWTO covers + BTi Surftime and Anytime + + Some basic understanding of the Linux OS and + its layout + + + + + +Surftime + + +PPPd Setup + + Right, to start off you will need a working installation of +PPPd, I know from experience that Mandrake 8.0 that sometime is +doesn't install pppd so check its installed first. Once it is it +usually resides in /usr/sbin/pppd check that any +users you want to access it have setuid access. + +Note: Setuid allows pppd to run as-if root allowing non-superusers to run pppd without less problems. To do this use the command chmod 4750 /usr/sbin/pppd. Beware: Some distributions have a watchdog program that will change the pppd permissions back to normal. I have not tested this but on RedHat derived systems with Linuxconf installed then removing the /usr/lib/linuxconf/redhat/perm/ppp should stop this happening. + + + + +Chatscript (Dialup) + + The Chatscript is a text file, usually residing in +/etc/ppp that contains the commands passed to +the modem to make it dial to BTi. If you want to compare this to DUN +in Windows then this is the phone number and init commands. + + Below is the chatscript used to dial BTi, I've now opted for putting the \T metacharacter in the script. The means when we run chat, inside the pppd command, we can use a -T parameter and supply the needed telephone number. + + + + "" "ATZ" + + # The next two lines should be left commented out until + # the script works. + + # "OK" "ATL0" + # "OK" "ATM0" + + SAY "Dialing modem...\n" + "OK" "ATDT \T" + ABORT BUSY + ABORT "NO CARRIER" + TIMEOUT 60 + CONNECT \c + + + + This script will dial BTi providing you put in the \T so we can added the telephone number later. I suggest saving the chatscript as something like /etc/ppp/chatscript Once you've saved it we can move onto setting up BTi's CHAP authentication. + + + + + +Authentication + + With PPP dialup's the most widely used authentication method, +apparently, is PAP (Password Authentication Protocol). However, just +to be a pain in the backside BTi use CHAP (Challenge Handshake +Authentication Protocol). To be fair CHAP is a more secure authentication method than PAP but it's still a pain. Now PPPd does support this but not through +nice easy to use Linuxconf dialogs. + +In the +/etc/ppp directory should be a +chap-secrets that looks roughly like this when +first installed: + + + + # Secrets for authentication using CHAP + # client server secret IP addresses + + + + We can safely ignore the IP Address column but the others me +must worry about. So fill in the gaps like this: + + + + # Secrets for authentication using CHAP + # client server secret IP addresses + "bloggs@btinternet.com" * "mypasswordhere" + + + + These two extra lines will try and authenticate ANY outgoing +PPP connection that responds using CHAP using your BTi details. It +goes without saying that you replace +bloggs@btinternet.com and +mypasswordhere with your details. Also, the second line is not strictly needed but I've found it helps sometimes. + +Note: If you're not using BTi at this point you can usually get away with having identical chap-secrets and pap-secrets. If you the same kind of pattern as above it should work. + +I suggest that you do a "chmod 600 /etc/ppp/*secrets". It was pointed out to me that it stops pppd shouting about security. + + + + + +Setting your global options + + In your /etc/ppp directory there is a +file called options. If your open it with your +favourite text editor you should see: + + + + lock + + + + And thats it, now we need to add some more settings in here so +make it look like: + + + + lock + usepeerdns + defaultroute + noipdefault + noauth + asyncmap 0 + crtscts + modem + 115200 + + + + Don't worry what they do, if you're interested look at the man +page for pppd. As a passing note if you would like PPPd to redial +dropped connections then add persist to the end +of your options file. + + + + +Testing your link + + Now you've created your Chatscript there are only two steps +left till you should be on the Internet. First is getting a working +link and second is creating a couple of easy dialup scripts to help +you. + + +To test your link try this command: + + + +pppd ttyS0 connect '/usr/sbin/chat -v -TPHONE_NUM_HERE -f /etc/ppp/chatscript' updetach debug name bloggs@btinternet.com + + Now obviosuly if your testing at Daytiem rate add the Daytiem number where instead of PHONE_NUM_HERE and similar with Surftime. + This will tell PPPd to dial the modem on ttyS0 (COM1) using the chatscript. The tells PPPd to only fork away to the commandline after the connection is established and the will show all authentication commands onscreen (providing updetach it set) while it trys to connect. + + If that connected then move onto the next section and we can +make a set of scripts to allow easy dialing. + + + + +Dialing scripts + + Here I'll just set out a set of scripts that will let your +dial BTi from a command line easily. The following should be +self-explanatory, the italic filename is the filename to put the data +into and the proceeding text the file contents: + +/etc/ppp/peers/bt-surf + + + + ttyS0 connect '/usr/sbin/chat -v -TSURFTIME_NUMBER_HERE -f /etc/ppp/chatscript' + updetach name bloggs@btinternet.com + + + +/etc/ppp/peers/bt-day + + + + ttyS0 connect '/usr/sbin/chat -v -TDAYTIME_NUMBER HERE -f /etc/ppp/chatscript' + updetach name bloggs@btinternet.com + + + + Change any of the filenames to suit what you called them and +the username. Do the same with this: + +/usr/bin/internet + + + + #!/bin/bash + # a script to dial BTi + case "$1" in + daytime) + /usr/sbin/pppd call bt-day + ;; + surftime) + /usr/sbin/pppd call bt-surf + ;; + off) + killall pppd + ;; + esac + + + + Once you've done that run this command at the command prompt: + + +chmod a+x /usr/bin/internet + + Now you've done, simply type +internet daytime/surftime/off and it +will connect you to the internet. + + + + + +BTi Anytime + + I'm sorry, for all you Anytime customers its really hard! +NOT! Read all the instructions for Surftime above. They all apply in +most places, the only things to watch out for is you obviously don't +need any of the Surftime/daytime distinctions. So only have one +peers file (using the correct phoen number) and one dialup option in your /usr/bin/internet file. (eg. dial and off) + + + + +BTOpenworld Home 500 (Alcatel Speedtouch USB) + + +About this section + + There is rather a large amount of credit due here, to +Chris Jones for writing the +Alcatel +Speedtouch USB ASDL Modem mini-HOWTO that is now part of the +DSL HOWTO. +This helped me a great deal when trying to get my Speedtouch to work. + + + +Warning + +At home I use Linux Mandrake, although the version of the kernel I had was patched with the ATM kernel source I did end up patching a different kernel source to get it working. Please, please inspect your kernel source to see if you have the PPPoATM source patched against your kernel. To do this go into you kernel source directory, usually /usr/src/linux and do a make menuconfig. In the Network Device Support section check for: + + + Network device support->PPP over ATM + + +If it does exist then make sure it is present it you current kernel and you can skim-read the "Patching you kernel" section to make sure you have the correc toptions compiled in and then carry on. + +This was just a minor warning as I orginially had a kernel patched with PPPoATM and without realising managed to trash my kernel tree by trying to force the patch onto it. + + + + +Distribution Specific Information + +I have had reports about different distros that have varying +PPPoATM support already builtin to the kernel: + + + Mandrake 8.0: The default 2.4.3 kernel already has the + PPPoATM patch applied, I cannot remember if it compiled in but ignore + steps refering the "Patching the Kernel" below. PS: You still need to + configure the kernel. + Mandrake 8.1: Mandrake 8.1 supports the Speedtouch + automatically, I have no had first hand experience but from what I can + gather you simply have to download the Alcatel binaries and then use + DrakNet to sort it out. + Debian: I have had reports that the standard Debian + installtion does not include libpam, this must be installed for the + PPPoATM plugin modules to work. + + +NOTE: From roughly kernel 2.4.16 the PPPoATM patch is included in +Linus' main source tree. Therefore you can miss out patching the kernel +and just configure it. + + + +Requirements + + To get your Speedtouch USB working in Linux you have a fairly +heavyweight task ahead of you, but hey, if I could do it so can you! +This is what you'll need to get it working: + + + You must have the kernel source installed and + know the procedure for installing and compiling a new kernel. + If this is a problem then read the Kernel HOWTO. + + You must be running one of the following + Kernels: 2.3.39, 2.4.0-test4, 2.4.1-pre7, 2.4.7, 2.4.8-pre5. + This is because the PPPoATM patch for the kernel exists patched + against specific kernels, some may work with similar kernel + versions but I cannot vouch for that + + You, obviously, need a USB controller of some + description with at least one free plug. It also must be Linux + compatible, nowadays this is most USB controllers that are + UHCI/OHCI based. If you don't have one your local supplier + would probably have a PCI USB Controller. + + A heap-load of confidence with meddling with + your config. eg: kernel recompiling, program + installation... + + + + +Software Downloads + + To get the Speedtouch working under Linux you will need some +software and kernel patches found below: + + + The kernel patch for your kernel. They can be found at http://www.kernel.org/pub/linux/kernel/people/axboe/PPPoATM/. Please note not all the kernels have patches. + + The latest SpeedTouch driver from http://sourceforge.net/project/showfiles.php?group_id=3581 + + The latest SARlib library from http://sourceforge.net/project/showfiles.php?group_id=22221 + + The Alcatel speed management software. You can get it from http://www.alcatel.com/consumer/dsl/dvrreg_lx.htm. I can't distribute this because of Alcatel's licensing scheme so get it from them. + + Some description of PPPoATM aware PPPd binary: + + Red Hat 7 RPM (glibc 2.2): http://sourceforge.net/project/showfiles.php?group_id=23818 + Debian (.deb): http://sourceforge.net/project/showfiles.php?group_id=23818 + Tarball: http://sourceforge.net/project/showfiles.php?group_id=23818 + + + + The Linux Hotplug software from http://linux-hotplug.sourceforge.net. Get it installed as per their instructions. It seemed simple enough so I won't cover it here + + + + +Patching your kernel + + Once you have the PPPoATM kernel patch (this assumes you use +the patch against kernel 2.4.7) you need to make sure you have a +working 2.4.7 kernel tree, next unzip the PPPoATM patch by doing: + + +NOTE: From rougly kernel 2.4.16 (I haven't tested to see hwo far +back it goes) the PPPoATM patch is included in Linus' main kernel tree, +therefore you may skip the patching below and resume ready to configure +the kernel. + +gzip -d pppoatm-2.zip + + Next we will need to test-patch the kernel using the following +commands: + +patch -p1 -s -E --dry-run < /point/to/pppoatm-2 + + If that ran without failure then patch the kernel by removing +the as such: + +patch -p1 -s -E < /point/to/pppoatm-2 + + That should have patched the kernel good-and-proper so we can +go ahead and configure it, make sure the following options are +selected along with your personal build options: + + + Code maturity levels->Prompt for development and/or incomplete code/drivers + Networking options->Asynchronous Transfer Mode (ATM) + Network device support->PPP (point-to-point protocol) support + Network device support->PPP support for async serial ports + Network device support->PPP Deflate compression + Network device support->PPP BSD-Compress compression + Network device support->PPP over ATM + USB support->Support for USB + USB support->Preliminary USB device filesystem + You have to make a choice here, if your USB controller is + UHCI based then select: + USB support->UHCI (Intel, PIIX4, VIA, ...) support + Alternatively choose: + USB Support->OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support + + + You could select any of these as modules or compiled-in but as +I followed Chris Jones' HOWTO I compiled the all but UHCI/OHCI as +compiled-in code. Save the kernel config and compile the kernel and +modules as you normally do. + + + +Kernel Drivers and Software + + Now that the kernel will support using PPPoATM we can start +compiling the bits to run the modem. Well start with the Kernel mode +driver; first decompress the SARlib sources to a build directory. +(Personally I build all my non-kernel sources +in ~/sources) and do a +make on it. There is no need to do +a make install with this library. + + Next return to your source root and decompress your Speedtouch +drivers (from Sourceforge not Alcatel!), go in there and do a +make, and then a make install. + + Note: If you get an "Error +1" then check the Makefile for a line starting + and check it points to the right directory, the +one where you just compiled SARlib. + + Next install the Hotplug software and make sure it works. Once +you've done that decompress Alcatel's binary management software and +do a make on that. Then do a make +install, the clever bit here is their installation +registers the Speedtouch kernel driver and their binary to be run +when the USB device is "hotplugged" (or coldplugged) into the system. +Kiss goodbye to the hours of trying to writing modules +loading scripts that always fail. + + Next install the new PPPoATM aware PPPd program, I had no luck +getting it compile from source on my machine so I used the RPM. Sorry +you're on your own there! + + + +PPPd Configuration + + Warning: The action will +remove all the default settings for any previous PPPd connection. +(Not that you want them now you've got shiny new ADSL ;P) + + In the /etc/ppp directory there is a file called +options in that file put the following: + + + + lock + defaultroute + noipdefault + noauth + passive + asyncmap 0 + name bloggs@hg5.btinternet.com + user bloggs@hg5.btinternet.com + plugin /usr/lib/pppd/plugins/pppoatm.so + 0.38 + + + + Make sure of the following things: + + + That you replace both name + and user variables with your + username. + + That you get the correct VPI/VCI ATM pair, + these are in the windows information software, from BTi my + VPI:0 and VCI:38 so I use . Make sure + you get this right or it will not + work. + + + Next in your /etc/ppp/chap-secrets put: + + + + + # Secrets for authentication using CHAP + # client server secret IP addresses + "bloggs@hg5.btinternet.com" * "mypasswordhere" + + + + + +Testing your link + + Next thing to do is get the link up and test it. If you've got +a nice distro like Mandrake you should find it will auto-init your +USB drivers and filesystem, if not then the following can be used: + + +/sbin/modprobe usb-uhci +mount none /proc/bus/usb -tusbdevfs + + Next load the Speedtouch driver by doing: +/sbin/modprobe speedtch. Next use the speedmgmt +program to get the modem init'ed: /usr/sbin/mgmt. +After a while of the lights flashing on the modem the main console +(and/or the syslog) should report: + + + + Speedmgmt[2074]: Modem initialised at 576 kbit/s downstream and 288 kbit/s upstream + + + + Once the modem has been init'ed now make sure the PPPoATM +module is loaded by doing: + +modprobe pppoatm + + Now start the PPP link by typing pppd You +should see something similar to this: + + + + Oct 28 14:01:25 ds9 pppd: PPPoATM plugin_init + Oct 28 14:01:25 ds9 pppd: PPPoATM setdevname_pppoatm + Oct 28 14:01:25 ds9 pppd: PPPoATM setdevname_pppoatm - SUCCESS + Oct 28 14:01:26 ds9 pppd: Using interface ppp0 + Oct 28 14:01:26 ds9 pppd: Connect: ppp0 <--> 0.38 + Oct 28 14:01:28 ds9 pppd: local IP address 255.255.255.255 + Oct 28 14:01:28 ds9 pppd: remote IP address 255.255.255.255 + Oct 28 14:01:28 ds9 pppd: primary DNS address 213.120.62.100 + + + + Once that's done you're in luck, now just configure the pppd +to autodial at startup (beyond the scope of this HOWTO, sorry!). +Hopefully HotPlug will get your device up and going before pppd needs +it! :). + + + + + + +Simple IP Masquerading + + To allow sharing of your internet conenction you can eitehr +use a proxy server or IP Masquerading. I'll cover IP Masquerding as +it's simple to set up on the other client machines. I use a 2.4.x +generation kernel and in effect I use IPTables. If you use a 2.2.x or +2.0.x kernel then you need the +IP +Masquerading HOWTO. + + This part of the HOWTO assumes that your Netfilter software is +modularised, if it isnt then no big deal, either ignore the + lines or recompile your kernel. + + + Simple now, just run the commands: + +modprobe iptable_nat +iptables -t nat -F POSTROUTING +iptables -t nat -A POSTROUTING -o ppp0 -s 10.0.0.0/16 -j MASQUERADE +echo 1 > /proc/sys/net/ipv4/ip_forward +Note: The space between 1 and > is vital. It seems not to activate the IP Forwarding if the space is not there. + + Change the and/or the + for your relevant network settings and +put that file either before the in the +internet file or somewhere in your startup. + + + + + +Troubleshooting + + +Help! Lynx gives unable to access document + +Problem: +Lynx is unable to access document or ping gives "No +route to host" but the link is stable! + + Solution: Have a look at +the output of route -n you should see a +refenence specifing a gateway of either your Remote PPP IP +and using the adapter/dev of ppp0. If not here is how to fix it. In +your /etc/ppp/ip-up file above + on the last line type: + + + + route del default + route add default gw $4 $1 + + + + Save the file and redial. The problem should be solved. + + + + +My kernel < 2.4.2 crashes using the Alcatel driver + +Problem: +Your kernel below 2.4.2 crashes using the Alcatel driver. + + + Solution: +You're probably using a kernel compiled with SMP support either don't +use SMP or try here: +http://sourceforge.net/project/showfiles.php?group_id=23818 + + + + +PPPd crashes when it loads the PPPoATM module + +Problem: +When PPPd attempts to access the ATM device it crashes. + + + Solution: The kernel was +probably compiled on a different type of processor. I tried to get +the kernel compiled quicker by compiling the kernel on my 950Mhz +Duron, even with the processor type to suit the target 266Mhz Cyrix +the ATM module crashes. So dont take short cuts and compile on the +target processor. + + + +insmod speedtch.o gives: "Unresolved symbol: _mmx_memcpy" +Problem: +When you have compiled the Speedtouch Kernel driver (speedtch.o) trying to insmod/modprobe returns: "Unresolved symbol: _mmx_memcpy" or similar. + + +Solution: +Right, I haven't got a concrete answer here but I couldn't find it anywhere on the internet so here goes. I found this error come up when I recompiled my kernel once. It did it the first time but I forgot how to fix it. A combination of things fixed it for me: + + + Configured the kernel module support to ignore kernel version checking + Recompiled SARlib (this is what ultimately fixed it) before recompiling speedtch.o + Recompiled speedtch.o and reinstalled. Et voila! + + +As I said I can't be sure about this one but it worked for me. + + + + + +There are strange noises on the telephone line when I pick up the +phone. + +Problem: +When you pick up the phone there are strange noises present, more over +the use of the phone line causes the internet to disconnect. + +Solution: +You seem to have something which I think is called cross-talk. The +ADSL modem works by sending data down the unused frequencies of your +copper phone line. If the hardware is set up so the ADSL and phone +ranges overlap the two can "hear" each other. The best advice is to +Ring BTO Customer Support and they should be able to help. + + + + + + + +Further Reading + + +For further reading on related topics see this list: + + + + The PPP-HOWTO + The IP Masquerading HOWTO + The DSL HOWTO + The Modem-HOWTO. + The Winmodems and Linux HOWTO + + + +
diff --git a/LDP/retired/Bangla-PDF-HOWTO.xml b/LDP/retired/Bangla-PDF-HOWTO.xml new file mode 100644 index 00000000..e2265ea2 --- /dev/null +++ b/LDP/retired/Bangla-PDF-HOWTO.xml @@ -0,0 +1,1426 @@ + + + +
+ + Bangla PDF HOWTO + + + Progga + +
abulfazl AT juniv.edu
+
+
+ + 2003-01-30 + + + + 1.1 + 2003-04-14 + Pro + PDF from Unicode, Caution about Bijoy + + + + 1.0 + 2003-01-30 + Pro + Initial Release on Planet Earth, reviewed by LDP + + + + + This text mainly describes the PDF creation process using + KWord with the Bijoy2000 + fonts and Bijoy keyboard, for working in the Bangla language. Some information + on PDF creation from Unicode encoded Bangla text files is also provided. + +
+ + + Introduction + + PDF files, known for being viewable on most platforms, are a popular medium for distributing Bangla files over the Internet. Another use of PDF and +Postscript files in the UNIX world is for printing. While PDF files can be created with various applications, this text is an attempt to describe the process of PDF creation using the free software KWord and ttf2pt1. The fonts used in this process are the Bijoy fonts included in the Bijoy2000 +package. The keyboard layout for typing in Bangla is also Bijoy (the +typing method of ligatures or compound characters is slightly different +from the original one). + + + Copyright & License +
+ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, version 1.1 or any later version published by the Free Software Foundation; with no Invariant sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is located at http://www.gnu.org/licences/fdl.html. +
+ +
+ Bijoy fonts (c) Mustafa Jabbar, Ananda Computers, 8/6 Segun Bagicha, Dhaka-1000, Bangladesh. +
+
+ + + Minimum Requirements + + The test platform used were FreeBSD-4.6.0 RELEASE and RedHat-7.3. Earlier versions of RedHat won't do. Whatever is the platform, at least the following are required: + + + + + XFree86-4.2.0 + (unsure about earlier versions) + + + + + + KDE-3 + + + + + + KWord-1.1.1 + + + + + + + TTF2PT1-3.4.3 + + + + + + + Bijoy2000 fonts + + + + + Strong willingness to create a Bangla PDF. + + + + There are many fonts that come with the Bijoy2000 package. In this text, to state a fontname, only SutonnyMJ has been used. This name can be replaced with others to meet individual needs. + + + + Caution + + After installing the Bijoy fonts and keyboard, one may be tempted to use them for purposes other than creating PDFs. But a little common sense and + farsightedness will reveal that the use of a nonstandard font and keyboard like + Bijoy is destined to create the same kind of chaos regarding Bangla in the Open + Source environment as is now prevailing in the proprietary world. PDF is a + different story though as they are font independent(if created properly) and + has no chance of getting into this kind of chaos. Now what if one needs to + create a Bangla text file? Easy - use Unicode. Recent developments has made it + possible to write Unicode based Bangla in GTK+ 2.0 (or higher) based softwares. + And the same thing is on the offing for QT (which is the backbone of KDE). + Even PDFs can be created from Unicode encoded Bangla text files. This has been + described in a later . So instead of relying on + nonstandard softwares like Bijoy, try to use Unicode based Bangla wherever + possible. + +
+ + + + Fonts + + While creating PDFs, KWord + gives the best result if Type1 fonts are used. But + Bangla Type1 fonts are quite rare, so converting TrueType + fonts to Type1 is a good option. This conversion is done with + the ttf2pt1 + package. This package has some useful programs to carry out the + conversion properly. After downloading and uncompression, the + ttf2pt1 + package can be installed using the following commands: + + + $ make all + $ make install + + + The last command needs to be executed as root. The + README of ttf2pt1 + has some better descriptions of these. + + + TrueType to Type1 Conversion + + The following steps describe converting TrueType Bijoy fonts to + Type1, suitable for PDF creation: + + + + Instead of creating a Type1 font directly from + sutom___.ttf (TrueType font file of SutonnyMJ + font), create an interim file sutonnymj.t1a: + + + $ ttf2pt1 sutom___.ttf sutonnymj + + + + + Perform some correction to sutonnymj.t1a + using forceiso, a PERL script supplied with the + ttf2pt1 package, and create + sutonnymj2.t1a: + + + $ cat sutonnymj.t1a | /usr/local/share/ttf2pt1/scripts/forceiso \ + "U00%x" > sutonnymj2.t1a + + + This correction is needed because some glyphs of Bijoy fonts + have no name. forceiso solves this problem by + assigning proper names to those otherwise nameless glyphs. + + + + + + Finally, create the Type1 version of SutonnyMJ from + sutonnymj2.t1a using t1asm, + another program supplied with the ttf2pt1 + package: + + + $ cat sutonnymj2.t1a | /usr/local/libexec/ttf2pt1/t1asm \ + > sutonnymj.pfa + + + The last two steps can also be done in one go: + + + $ cat sutonnymj.t1a | /usr/local/share/ttf2pt1/scripts/forceiso \ + "U00%x" | /usr/local/libexec/ttf2pt1/t1asm > sutonnymj.pfa + + + + + + + The final product, in this case sutonnymj.pfa, + is the actual Type1 font file. The first step also produces + sutonnymj.afm + which can be ignored through the rest of the text. + + + + + Font Installation + + There are some programs that automate font installation, such as + type1inst for Type1, + ttmkfdir + for TrueType, KDE's own font installer for both types and some others. When + these are used, the font encoding can be wrong and needs hand-editing of the + fonts.scale file. + If any of the font installing programs were used, mkfontdir + must be executed after editing font.scale + by hand. For Type1 fonts, the encoding is adobe-fontspecific + and not iso8859-1. For TrueType fonts, the encoding is + apple-roman and not iso8859-1. Besides, + anti-aliasing must be stopped for these TrueType fonts to show up. + + Alternatively, the next three sections can be considered to + install fonts manually. This is a bit cumbersome but when things go + wrong, it is easier to debug, as the user has a clear idea about the + whole thing. + + + Type1 Font Installation + + The following steps describe manual installation of Type1 + fonts: + + + + Create a new directory, + /usr/local/share/fonts/type1/bijoy/, and copy the Type1 font there: + + + + $ mkdir -p /usr/local/share/fonts/type1/bijoy/ + + $ cp sutonnymj.pfa /usr/local/share/fonts/type1/bijoy/ + + + + + Create the file fonts.scale + and place it inside /usr/local/share/fonts/type1/bijoy/. The fonts.scale's creation process will be described later in . + + + + Create another file fonts.dir + using mkfontdir: + + + + $ cd /usr/local/share/fonts/type1/bijoy/ + + $ mkfontdir + + + If the fonts.scale + was created correctly then fonts.dir + will be created, otherwise some error messages will appear + after executing mkfontdir. + + + + Open XF86Config and add + /usr/local/share/fonts/type1/bijoy/ + as a new fontpath in the Files section: + + FontPath "/usr/local/share/fonts/type1/bijoy/" + + The XF86Config file is generally found inside + /etc/X11/. + If it's not present there then use find + to get the path: + + + + $ find / -name XF86Config + + + + + Restart X server by pressing + + Ctrl + Alt + Bksp + . + The font will be installed. + + + + Check whether the font has really been installed by using + xlsfonts. This program shows the + XLFD of every font that is available to the X server. + grep can be used to find the desired font from + xlsfonts' output: + + + + $ xlsfonts | grep sutonnymj + + + If sutonnymj is unavailable to X then grep will give no output. Otherwise the output will be the XLFD of sutonnymj: + + + + -altsys-sutonnymj-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific + + + If more than one font were installed then + grep altsys + will show them all (if present in xlsfonts' output). + + + + + + Creating <filename>fonts.scale</filename> + + The fonts.scale + file contains various information about the fonts in a directory + where that fonts.scale + itself is placed. This means every directory which has any font + file can have its own fonts.scale + (non-scalable fonts like Bitmap fonts do not need a + fonts.scale file). The + information that every line of a fonts.scale contains + (preceded by the name of the font file itself) is called XLFD + (X Logical Font Definition). An example line from a + fonts.scale file is: + + sutonny.pfa -altsys-SutonnyMJ-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific + + + The only difference is the very first line of + fonts.scale, which has only a + number instead of the usual font-file name followed by the + corresponding XLFD. This number is the total + number of XLFDs listed in that fonts.scale + file. + + The structure of a fonts.scale + is like this: + + + + Line 1: Total number of XLFD + Line 2: FontFileName1 XLFD + Line 3: FontFileName2 XLFD + .... + .... + .... + + + The following is a suitable XLFD for Type1 Bijoy fonts: + + + -altsys-SutonnyMJ-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific + + + Please note that in the above string, SutonnyMJ + is the actual fontname. This name needs to be changed accordingly for + other fonts. + + + An example fonts.scale + file for two Type1 Bijoy fonts can be like this (Where + sutonnymj.pfa and rinkymj.pfa are the actual Type1 font files for + the fonts Sutonnymj and Rinkymj respectively): + + + +2 +sutonnymj.pfa -altsys-SutonnyMJ-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific +rinkymj.pfa -altsys-RinkyMJ-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific + + + + It's better not to press Return after writing the + XLFD in the last line. This sometimes create problem with the total + number of XLFD lines and the file is taken as having bad structure by + mkfontdir. If fonts.scale + is not created properly, the mkfontdir + command will give error message. Otherwise fonts.dir + will be created. + + The adobe-fontspecific substring found at the end of every XLFD for Type1 Bijoy fonts is the encoding of that font. If iso8859-1 encoding is required, this can be done too by creating another file fonts.alias. Every line of fonts.alias contains two XLFDs. The first XLFD is the alias and the second one is the original. Unlike fonts.scale and fonts.dir, there is no number at the first line of fonts.alias. An example fonts.alias's +structure looks like this: + + + +Line 1: -altsys-SutonnyMJ-medium-r-normal--0-0-0-0-p-0-iso8859-1 + -altsys-SutonnyMJ-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific +Line 2: -altsys-RinkyMJ-medium-r-normal--0-0-0-0-p-0-iso8859-1 + -altsys-RinkyMJ-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific + + + + Generally, some subdirectories under /usr/X11R6/lib/X11/fonts/ contain many font files and some fonts.scale files, fonts.dir and fonts.alias as well. A browse through these files can make it easier to create new ones. One thing to notice is that the content of both fonts.scale and fonts.dir are same but both are still needed. + + + + + TrueType Font Installation + + The Bijoy font's TrueType installation method is quite similar + to that of Type1. Just keep a separate directory for the fonts, like, + + + /usr/local/share/fonts/ttfonts/bijoy/ + + + and change the XLFD to: + + + -altsys-SutonnyMJ-medium-r-normal--0-0-0-0-p-0-apple-roman + + + In the example, the font encoding is apple-roman + instead of adobe-fontspecific. Also to use these fonts + anti-aliasing must be stopped, and this is where Xft + comes into business.In your $HOME + directory, create a hidden file ~/.xftconfig + and write the following lines in it ( the file may be + already present, in that case just add these lines): + + + +dir "/usr/local/share/fonts/ttfonts/bijoy/" + +match any family == "sutonnymj" +edit antialias = false; encoding = "apple-roman"; + + + + The match any family == "sutonnymj" and the next line + prevents anti-aliasing for sutonnymj only. If there are other Bijoy + fonts in use, more similar lines must be added. + + The presence of only ~/.xftconfig + is enough to make a TrueType font available to KWord. There is no + need to create fonts.scale and + fonts.dir. Even the fontpath needs not be added + in XF86Config. So these steps can be skipped if + wished. + + Newer systems(like RH 8.0) use Xft 2.0 instead of Xft 1.0 . + Xft 2.0 doesn't use ~/xftconfig. Instead it uses + ~/.fonts . This file can be modified by + fontconfig . Here also, antialias must be + stopped and encoding remains apple-roman + . + + + + + + On Using TrueType + + + KWord + can't create PDFs perfectly using TrueType fonts, so there is no + reason to use TrueType fonts for creating PDFs. But TrueType is useful + for creating PDFs from files written in MS Word + (i.e. *.doc files). Even then these PDFs are defective (due to the use + of Type3 fonts inside the PDFs) and so are not transferable to other + computers; they can be used for printing only. So the only suggested + use of TrueType is to create PDFs from MS Word + files for printing. Again, these PDFs are of low quality, so if it + is not urgently needed, TrueType should be avoided completely for + PDF creation. + + To open an MS Word file in + KWord , the encoding of the relevant font(s) should be changed from + apple-roman to iso8859-1 in the ~/.xftconfig, for example: + + + +match any family == "sutonnymj" + edit antialias = false; encoding = "apple-roman"; + + + + will become: + + + +match any family == "sutonnymj" + edit antialias = false; encoding = "iso8859-1"; + + + + Type1 and TrueType versions of a font should not be used + together. To stop using TrueType fonts, the corresponding FontPath must + be commented out from the Files section of + XF68Config. The relevant entries for the font in + ~/.xftconfig must also be commented out. In both cases, + a # as the first character on any line comments out the whole + line. Given below is an example ~/.xftconfig, + where entry for a font has been commented out: + + + +# dir "/usr/local/share/fonts/ttfonts/" + +# match any family == "sutonnymj" +# edit antialias = false; encoding = "apple-roman"; + + + + + + + Keyboard + + + Using The Bijoy Keyboard + + In X Window, all the keyboard related stuff is handled by XKB. + XKB relies on some configuration files called the symbol + files, to get the layout of a specific keyboard. The following steps describe the + installation process of a symbol file for the Bijoy Bangla keyboard: + + + + + Below is the symbol file for the Bijoy keyboard. Save it as + bn_bijoy + . + + + + { [], [ 49, exclam ] }; +key { [], [ 50, 64 ] }; +key { [], [ 51, 35 ] }; +key { [], [ 52, 36 ] }; +key { [], [ 53, 37 ] }; +key { [], [ 54, 94 ] }; +key { [], [ 55, 117 ] }; +key { [], [ 56, asterisk ] }; +key { [], [ 57, parenleft ] }; +key { [], [ 48, parenright ] }; +key { [], [ minus, 209 ] }; +key { [], [ 61, plus ] }; +key { [], [ 79, 115 ] }; +key { [], [ 104, 113 ] }; +key { [], [ 87, 88 ] }; +key { [], [ 99, 100 ] }; +key { [], [ 85, 86 ] }; +key { [], [ 80, 81 ] }; +key { [], [ 82, 83 ] }; +key { [], [ 110, 84 ] }; +key { [], [ 77, 78 ] }; +key { [], [ 111, 112 ] }; +key { [], [ bracketleft, braceleft ]}; +key { [], [ bracketright, braceright]}; +key { [], [ U84, 169 ] }; +key { [], [ 121, 126 ] }; +key { [], [ 119, 120 ] }; +key { [], [ 118, 65 ] }; +key { [], [ Multi_key, 124 ] }; +key { [], [ 101, 102 ] }; +key { [], [ 75, 76 ] }; +key { [], [ 90, 95 ] }; +key { [], [ 96, 97 ] }; +key { [], [ semicolon, colon] }; +key { [], [ 213, 211 ] }; +key { [], [ 212, 210 ] }; +key { [], [ 114, 116 ] }; +key { [], [ 170, 168 ] }; +key { [], [ 73, U8a ] }; +key { [], [ U87, U89 ] }; +key { [], [ 105, 106 ] }; +key { [], [ 98, 89 ] }; +key { [], [ 109, 108 ] }; +key { [], [ 103, 107 ] }; +key { [], [ comma, less ] }; +key { [], [ period, greater]}; +key { [], [ slash, question]}; + +} ; + + ]]> + + + + + Copy bn_bijoy to + /usr/X11R6/lib/X11/xkb/symbols/ + + + + + Edit the InputDevice section of + XF86Config so it looks like: + + +......... +......... + +Section "InputDevice" + Identifier "Keyboard0" + Driver "keyboard" + + Option "XkbKeycodes" "xfree86" + Option "XkbTypes" "complete" + Option "XkbCompat" "complete+leds" + Option "XkbSymbols" "us(pc104)+bn_bijoy+group(lwin_toggle)" + Option "XkbGeometry" "pc(pc104)" +EndSection +.......... +.......... + + + + The above description is for a 104-key keyboard. + + + + Restart X server by pressing + + Ctrl + + Alt + + Bksp + . + + + + After restarting X, the Bijoy keyboard should be + present along side the English one. To activate it, press the + left Win-key. If everything is okay, the + Scroll Lock LED will be on and the + key presses will produce codes according to the Bijoy keyboard + layout. Pressing the left Win-key + again will disable Bijoy and the Scroll Lock LED will go off. + + + + + To test the newly installed Bijoy keyboard, follow these steps: + + + + Open KWord, + + + + Select sutonnymj from the font list, + + + + Press the left Winkey, + + + + Start typing according to the Bijoy keyboard layout. + + + + + + A handy tool for testing mouse and keypress events is + xev. This program shows all the generated codes from keypresses. + + + + + These steps are not enough, however, to write ligatures or compound + characters. The next section describes this very thing. + + + + Writing Ligatures + + The ligature writing process described here is not a standard one + . At best it can be called a work-around (it has a similarity to + cuckoos laying eggs in crows' nests). If this method is used, the + Multikey feature won't work on Latin characters (at least when Bijoy + keyboard is needed). If there is no need to use the Multikey for + typing various Latin characters like ssharp then this method is + okay. The typing sequence of characters for writing ligatures is + slightly different from the the original Bijoy keyboard. Whatever is + the situation, the following steps describe a way to get the ligatures + to appear on the screen: + + + + Save the following as Compose.bijoy: + + + Means +# Special Character + +# Special + : "\46" + +# Ka + : "\260" + : "\274" + : "\351" + : "\256\213" + : "\257\213" + +# Kha + + : "\225\114" + : "\366" + +# Ga + : "\271" + : "\275" + : "\230\115" + : "\352" + : "\377" + +#Gha + : "\225\116" + : "\230\116" + +# Cha +

: "\224\120" +

: "\302" +

: "\360" + +# Chha +

: "\224\121" + : "\303" + +# Ja + : "\276" + : "\304" + : "\342" + +# Jha + : "\300" + : "\305" + +# Io + : "\301" + +# Ta + : "\261" + : "\306" + : "\310" + : "\233\125" + : "\336" + : "\353" + : "\363" + : "\367" + +# Tha + : "\311" + : "\332" + : "\364" + +# Da + : "\307" + : "\312" + : "\333" + : "\354" + +# Nna + : "\362" + : "\156\350" + +# Ta + : "\263" + : "\313" + : "\232\227" + : "\337" + : "\257\227" + +# Tha + : "\314" + : "\232\222" + : "\257\222" + +# Dda + : "\272" + : "\317" + : "\233\140" + : "\343" + +# Dha + : "\273" + : "\327" + : "\334" + : "\344" + +# Na + : "\113\350" + : "\115\350" + : "\116\350" + : "\131\350" + : "\132\350" + : "\142\234" + : "\143\350" + : "\346" + : "\153\350" + : "\370" + : "\375" + +# Pa + : "\340" + : "\244\143" + : "\355" + : "\256\143" + : "\257\143" + +# Pha + : "\347" + : "\356" + : "\365" + : "\371" + +# Ba + : "\113\241" + : "\115\246" + : "\122\241" + : "\125\241" + : "\131\136" + : "\132\241" + : "\137\241" + : "\330" + : "\141\237" + : "\233\136" + : "\145\237" + : "\244\136" + : "\152\246" + : "\153\246" + : "\257\136" + : "\156\237" + +# Bha + : "\231\242" + : "\244\242" + +# Ma + : "\264" + : "\115\245" + : "\225\147" + : "\125\245" + : "\315" + : "\331" + : "\141\245" + : "\142\245" + : "\244\247" + : "\152\245" + : "\153\245" + : "\256\247" + : "\257\247" + : "\376" + +# La + : "\113\254" + : "\115\254" + : "\143\254" + : "\144\254" + : "\145\254" + : "\146\254" + : "\244\254" + : "\152\254" + : "\153\254" + : "\257\254" + : "\156\254" + +# Ssa + : "\266" + +# Sa + : "\267" + : "\335" + : "\341" + +# Miscellaneous + : "\265" + : "\316" + : "\345" + : "\374" + : "\270" + : "\151\223" + : "\357" + : "\373" + : "\151\203" + +# Vowels + : "\102" + : "\103" + : "\104" + : "\104" + : "\105" + : "\106" + : "\107" + : "\110" + : "\112" + + +# End of Sequence Definition + + ]]> + + + + + Get the current locale name. One way to get it is: + + + + $ echo $LANG + + + + + + Find the Compose file for the current locale. + /usr/X11R6/lib/X11/locale/compose.dir + lists the Compose files for all the locales. If + the locale is C, the Compose file is + iso8859-1/Compose, i.e. + /usr/X11R6/lib/X11/locale/iso8859-1/Compose. + If the locale is en_US.ISO8859-15, the Compose + file is iso8859-15/Compose, i.e. + /usr/X11R6/lib/X11/locale/iso8859-1/Compose. + Whichever is the Compose file for the current locale, make a + backup of it: + + + + $ cd /usr/X11R6/lib/X11/locale/iso8859-1/ + + $ mv Compose Compose.real + + + The above example commands were written assuming that the + locale was C. + + + + Make Compose.bijoy + the new Compose file for the current locale: + + + + $ cp Compose.bijoy /usr/X11R6/lib/X11/locale/iso8859-1/Compose + + + The above example command was written assuming that the + locale was C. + + + + The ligatures can be written now. To test it do the following: + + + + Open + KWord, + + + + Select sutonnymj from the font list, + + + + Press the left Winkey, + + + + Press 'Hashanta'(g)+'Ka'(j)+'Ka'(j). + + + + + If the output is Zukta Ka, then the ligature writing process is okay. + Now the thing to notice here is that, unlike the original Bijoy + keyboard, Hashanta has been pressed before the two 'Ka's. The + original Bijoy keyboard requires that 'Hashanta' be pressed in the + midst of the two 'Ka's, for example: + + Zukta Ka = 'Ka'(j)+'Hashanta'(g)+'Ka'(j) + + Except this change of sequence for writing ligatures there + are a few minor ones that have been listed below: + + + + + + Original Sequence + + Changed Sequence + + + + + + 'Ka'(j)+'Rafala'(z) + + 'Hashanta'(g)+'Ka'(j)+'Rafala'(z) + + + + 'Ta'(k)+'Rafala'(z) + + 'Hashanta'(g)+'Ta'(k)+'Rafala'(z) + + + + 'Va'(H)+'Rafala'(z) + + 'Hashanta'(g)+'Va'(H)+'Rafala'(z) + + + + 'Ha'(i)+'Rikar'(a) + + 'Hashanta'(g)+'Ha'(i)+'Rikar'(a) + + + + 'Ga'(o)+'Ukar'(s) + + 'Hashanta'(g)+'Ga'(o)+'Ukar'(s) + + + + 'Ra'(v)+'Ukar'(s) + + 'Hashanta'(g)+'Ra'(v)+'Ukar'(s) + + + + 'Sha'(M)+'Ukar'(s) + + 'Hashanta'(g)+'Sha'(M)+'Ukar'(s) + + + + 'Ha'(i)+'Ukar'(s) + + 'Hashanta'(g)+'Ha'(i)+'Ukar'(s) + + + + 'Ra'(v)+'UUkar'(S) + + 'Hashanta'(g)+'Ra'(v)+'UUkar'(S) + + + + + + + + + + + + Printing as PDF + + After typing some text in KWord, + do the following to get a PDF: + + + + Press Print Preview; if the output is okay, + the PDF will be okay. If not, the font conversion was faulty, so check it again + (especially the use of forceiso). + + + + Word-wrapping in the Preview window and in + KWord may look different. If this is unaccptable then it needs to be adjusted manually. The PDF will always appear as shown in the Preview. + + + + Press Print and a box will appear. Press + System Options... and select Embed fonts in + PostScript data when printing. Then click OK. + + + + From the printer selection list select Print To File + (PDF/Acrobat). Change the output file's name or leave it unchanged. + + + + + Now press Print. It may take a while for the box to disappear and the PDF to be created. + + + + Now check the PDF with any PDF viewer. + + + + A good utility to use here is pdffonts + to check whether the Bangla font has really been embeded in the newly + created PDF. + + + + + + RedHat Peculiarities + + In some places, the previous descriptions are not applicable to + RedHat. These differences are described below: + + + + While installing new font(s), the fontpath was supposed to be + included in the Files section of XF86Config. + In the case of RedHat this is not needed at all. There is a script called + chkfontpath to do this. With chkfontpath, + add a fontpath like this: + + + + $ chkfontpath -a /usr/local/share/fonts/ttfonts/bijoy/ + + + And remove a fontpath like this: + + + + $ chkfontpath -r /usr/local/share/fonts/ttfonts/bijoy/ + + + If chkfontpath doesn't show any error messages then the font(s) become + available or unavailable just after executing it. But even for RedHat, there + is no need to add a TrueType fontpath as Xft itself makes the fonts + avilable to KWord. So use of chkfontpath + for TrueType is optional. + + + Note + Just for reference, in the case of RedHat, the fontpaths are added in + /etc/X11/fs/config and not in XF86Config + or XF86Config-4. + + + + + To use the Bijoy keyboard, the InputDevice section of + XF86Config needs editing. For RedHat it's a different file, + XF86Config-4 (i.e. /etc/X11/XF86Config-4). + + + + + The only use of TrueType was stated as low quality PDF creation + from MS Word files, for printing only. Unfortunately + KWord failed to open any MS Word + files in RedHat, let alone create PDFs. Don't know why. + + + + + + PDF from Unicode + + + Lekho + + Lekho is a simple text editor with the + capability to create Unicode encoded Bangla+English text files. It uses the + Adarshalipi family of TrueType fonts for showing Bangla + glyphs. If you have never used it then have a look at it's + website. The website along with the + Lekho distribution contain enough docs to get someone start using Lekho. + + + + The Adarshalipi fonts are quite similar to the Bijoy fonts and + so the Type1 conversion procedure is same as the Bijoy fonts. Using a Type1 + Adarshalipi font, Lekho can produce PDFs from Unicode encoded Bangla text + files. Actually Lekho produces Postscript files which in turn is converted to + PDF using tools like ps2pdf. The next steps describe PDF + creation using Lekho, provided that a Type1 Adarshalipi font has + been installed already: + + + + When editing is over, change the font size of both Bangla and + English fonts to 11. This is not mandatory but it keeps the format of the + Postscript file as near as it is seen in Lekho. + + + + Click the PRINT FILE button and select + PRINT TO FILE. Write a name for the soon to be created + Postscript file and click OK. + + + + Use a tool like ps2pdf to convert the + Postscript file to PDF: + + + + $ ps2pdf file.ps + + + + + Lekho has another valuable feature - it can export a file to + bangtex + , the Latex macro package for + Bangla. So, the Latex users can eventually use this feature to create PDFs. + + + + + BSpeller + + + + BSpeller is basically a Bangla spell checker. Besides, it is a light + weight text editor with the ability to print. Instead of TrueType or + Type1, BSpeller relies on OpenType fonts. So it requires GTK+ 2.0 (or later) to + render Bangla glyphs. As it is still a beta software, it's output is somewhat + shaky. + + + + + Other Resources + + + Useful tools + + The following is a list of programs that may be useful for + debugging any trouble regarding the fonts, keyboard or the PDFs. Their + usages are well documented in their respective man pages: + + + + + xlsfonts, lists the XLFDs of the all fonts available to X. + + + + + xfd, shows all the glyphs of a font when available to X. + + + + + xset, resets various X options like fontpath. + + + + + xev, detects and shows various mouse and keypress events. + + + + + xkbcomp, besides other operations, prints the current XKB configuration in a single file. + + + + + xpdf, a PDF viewer. + + + + + pdffonts, shows font list of a PDF file. + + + + + ps2pdf, PostScript to PDF converter. + + + + + + Useful Links & References + + + + A detailed description of XKB, + www.charvolant.org/~doug/xkb/ + + + + + A one stop mall for Unicode based Bangla on Linux, + www.bengalinux.org + + + + + + The XFree86-De-uglification-Mini-HOWTO + + + + + + Font-HOWTO + + + + + + Fonts in XFree86, + also supplied with the XFree86 documentation as README.fonts + and normally found inside /usr/X11R6/lib/X11/doc/ + + + + + + Bangla Localisation + HOWTO, a good starting point for using Unicode based Bangla. + + + + + + + Acknowledgments + + + + + Jan + Benedict + Glaw + + (jbglaw AT lug-owl.de), for advocating Bangla in spite of being + non-Bangali. + + + + + + Shishir + + Bhai (shishir_faruk AT yahoo.com) + + + Dolon + + (mrk_ju AT yahoo.com) &Co, for the inspiration. + + + + + + Mojahed + + Bhai (mojahed AT agni.com), for being the Guinea pig ;-) + + + + + + Sergey + Babkin + + (babkin AT bellatlantic.net), + the ultimate Type1 guy. + + + + People at the Ankur (formerly Bengalinux) group, for working + towards the future. + + + + + + Tabatha + Persad + + (tabatha AT merlinmonroe.com), for the review and valuable + changes. + + + + To the Almighty, for this text wouldn't have been possible + without his (???) will. + + + + +

+ + diff --git a/LDP/retired/Beowulf-HOWTO.sgml b/LDP/retired/Beowulf-HOWTO.sgml new file mode 100644 index 00000000..6d610fd8 --- /dev/null +++ b/LDP/retired/Beowulf-HOWTO.sgml @@ -0,0 +1,1211 @@ + + +
+Beowulf HOWTO + + +<author>Jacek Radajewski and Douglas Eadline + +<date>v1.1.1, 22 November 1998 + + +<abstract> +This document introduces the Beowulf Supercomputer architecture and +provides background information on parallel programming, including +links to other more specific documents, and web pages. + +</abstract> + +<toc> + +<sect>Preamble + +<sect1>Disclaimer +<p> +We will not accept any responsibility for any incorrect information +within this document, nor for any damage it might cause when applied. + +<sect1>Copyright +<p> +Copyright © 1997 - 1998 Jacek Radajewski and Douglas Eadline. +Permission to distribute and modify this document is granted under the +GNU General Public Licence. + +<sect1>About this HOWTO +<p> +Jacek Radajewski started work on this document in November 1997 and +was soon joined by Douglas Eadline. Over a few months the Beowulf +HOWTO grew into a large document, and in August 1998 it was split into +three documents: Beowulf HOWTO, Beowulf Architecture Design HOWTO, and +the Beowulf Installation and Administration HOWTO. Version 1.0.0 of +the Beowulf HOWTO was released to the Linux Documentation Project on +11 November 1998. We hope that this is only the beginning of what +will become a complete Beowulf Documentation Project. + +<sect1>About the authors +<p> +<itemize> + +<item>Jacek Radajewski works as a Network Manager, and is studying for +an honors degree in computer science at the University of Southern +Queensland, Australia. Jacek's first contact with Linux was in 1995 +and it was love at first sight. Jacek built his first Beowulf cluster +in May 1997 and has been playing with the technology ever since, +always trying to find new and better ways of setting things up. You +can contact Jacek by sending e-mail to <htmlurl +name="jacek@usq.edu.au" url="mailto:jacek@usq.edu.au"> + +<item>Douglas Eadline, Ph.D. is President and Principal Scientist at +Paralogic, Inc., Bethlehem, PA, USA. Trained as Physical/Analytical +Chemist, he has been involved with computers since 1978 when he built +his first single board computer for use with chemical instrumentation. +Dr. Eadline's interests now include Linux, Beowulf clusters, and +parallel algorithms. Dr. Eadline can be contacted by sending +email to <htmlurl name="deadline@plogic.com" +url="mailto:deadline@plogic.com"> + +</itemize> + +<sect1>Acknowledgements +<p> +The writing of the Beowulf HOWTO was a long proces and is finally +complete, thanks to many individuals. I would like to thank the +following people for their help and contribution to this HOWTO. +<itemize> + +<item> Becky for her love, support, and understanding. + +<item> Tom Sterling, Don Becker, and other people at NASA who started +the Beowulf project. + +<item> Thanh Tran-Cong and the Faculty of Engineering and Surveying +for making the <it>topcat</it> Beowulf machine available for experiments. + +<item> My supervisor Christopher Vance for many great ideas. + +<item> My friend Russell Waldron for great programming ideas, his +general interest in the project, and support. + +<item> My friend David Smith for proof reading this document. + +<item> Many other people on the Beowulf mailing list who provided me +with feedback and ideas. + +<item> All the people who are responsible for the Linux operating +system and all the other free software packages used on +<it>topcat</it> and other Beowulf machines. + +</itemize> + +<sect>Introduction +<p> + +As the performance of commodity computer and network hardware +increase, and their prices decrease, it becomes more and more +practical to build parallel computational systems from off-the-shelf +components, rather than buying CPU time on very expensive +Supercomputers. In fact, the price per performance ratio of a Beowulf +type machine is between three to ten times better than that for +traditional supercomputers. Beowulf architecture scales well, it is +easy to construct and you only pay for the hardware as most of the +software is free. + +<sect1>Who should read this HOWTO ? +<p> +This HOWTO is designed for a person with at least some exposure to the +Linux operating system. Knowledge of Beowulf technology or +understanding of more complex operating system and networking +concepts is not essential, but some exposure to parallel computing +would be advantageous (after all you must have some reason to read +this document). This HOWTO will not answer all possible questions you +might have about Beowulf, but hopefully will give you ideas and guide +you in the right direction. The purpose of this HOWTO is to provide +background information, links and references to more advanced +documents. + +<sect1>What is a Beowulf ? +<p> +<it>Famed was this Beowulf: far flew the boast of him, son of Scyld, +in the Scandian lands. So becomes it a youth to quit him well with +his father's friends, by fee and gift, that to aid him, aged, in after +days, come warriors willing, should war draw nigh, liegemen loyal: by +lauded deeds shall an earl have honor in every clan.</it> Beowulf is +the earliest surviving epic poem written in English. It is a story +about a hero of great strength and courage who defeted a monster +called Grendel. See <ref id="history" name="History"> to find out +more about the Beowulf hero. +<p> +There are probably as many Beowulf definitions as there are people who +build or use Beowulf Supercomputer facilities. Some claim that one +can call their system Beowulf only if it is built in the same way as +the NASA's original machine. Others go to the other extreme and call +Beowulf any system of workstations running parallel code. My +definition of Beowulf fits somewhere between the two views described +above, and is based on many postings to the Beowulf mailing list: + +<p> +Beowulf is a multi computer architecture which can be used for +parallel computations. It is a system which usually consists of one +server node, and one or more client nodes connected together via +Ethernet or some other network. It is a system built using commodity +hardware components, like any PC capable of running Linux, standard +Ethernet adapters, and switches. It does not contain any custom +hardware components and is trivially reproducible. Beowulf also uses +commodity software like the Linux operating system, Parallel Virtual +Machine (PVM) and Message Passing Interface (MPI). The server node +controls the whole cluster and serves files to the client nodes. It +is also the cluster's console and gateway to the outside world. Large +Beowulf machines might have more than one server node, and possibly +other nodes dedicated to particular tasks, for example consoles or +monitoring stations. In most cases client nodes in a Beowulf system +are dumb, the dumber the better. Nodes are configured and controlled +by the server node, and do only what they are told to do. In a +disk-less client configuration, client nodes don't even know their IP +address or name until the server tells them what it is. One of the +main differences between Beowulf and a Cluster of Workstations (COW) +is the fact that Beowulf behaves more like a single machine rather +than many workstations. In most cases client nodes do not have +keyboards or monitors, and are accessed only via remote login or +possibly serial terminal. Beowulf nodes can be thought of as a CPU + +memory package which can be plugged in to the cluster, just like a CPU +or memory module can be plugged into a motherboard. + +<p> Beowulf is not a special software package, new network topology or +the latest kernel hack. Beowulf is a technology of clustering Linux +computers to form a parallel, virtual supercomputer. Although there +are many software packages such as kernel modifications, PVM and MPI +libraries, and configuration tools which make the Beowulf architecture +faster, easier to configure, and much more usable, one can build a +Beowulf class machine using standard Linux distribution without any +additional software. If you have two networked Linux computers which +share at least the <tt>/home</tt> file system via NFS, and trust each +other to execute remote shells (rsh), then it could be argued that you +have a simple, two node Beowulf machine. + + +<sect1>Classification +<p> +Beowulf systems have been constructed from a variety of parts. For the sake +of performance some non-commodity components (i.e. produced by a single +manufacturer) have been employed. In order to account for the different +types of systems and to make discussions about machines a bit easier, we +propose the following simple classification scheme: +<p> +CLASS I BEOWULF: +<p> +This class of machines built entirely from commodity "off-the-shelf" parts. +We shall use the "Computer Shopper" certification test to define commodity +"off-the-shelf" parts. (Computer Shopper is a 1 inch thick monthly +magazine/catalog of PC systems and components.) The test is as follows: + + A CLASS I Beowulf is a machine that can be assembled + from parts found in at least 3 nationally/globally circulated + advertising catalogs. + +The advantages of a CLASS I system are: +<itemize> +<item> hardware is available form multiple sources (low prices, easy maintenance) +<item> no reliance on a single hardware vendor +<item> driver support from Linux commodity +<item> usually based on standards (SCSI, Ethernet, etc.) +</itemize> + +The disadvantages of a CLASS I system are: +<itemize> +<item>best performance may require CLASS II hardware +</itemize> +<p> +CLASS II BEOWULF +<p> +A CLASS II Beowulf is simply any machine that does not pass the Computer +Shopper certification test. This is not a bad thing. Indeed, it is merely a +classification of the machine. + +The advantages of a CLASS II system are: +<itemize> +<item> Performance can be quite good! +</itemize> + +The disadvantages of a CLASS II system are: +<itemize> +<item> driver support may vary +<item> reliance on single hardware vendor +<item> may be more expensive than CLASS I systems. +</itemize> + +One CLASS is not necessarily better than the other. It all depends on your +needs and budget. This classification system is only intended to make +discussions about Beowulf systems a bit more succinct. The "System Design" +section may help determine what kind of system is best suited for your needs. + + + + +<sect>Architecture Overview +<p> + +<sect1>What does it look like ? +<p> +I think that the best way of describing the Beowulf supercomputer +architecture is to use an example which is very similar to the actual +Beowulf, but familiar to most system administrators. The example that +is closest to a Beowulf machine is a Unix computer laboratory with a +server and a number of clients. To be more specific I'll use the DEC +Alpha undergraduate computer laboratory at the Faculty of Sciences, +USQ as the example. The server computer is called <it>beldin</it> and +the client machines are called <it>scilab01</it>, <it>scilab02</it>, +<it>scilab03</it>, up to <it>scilab20</it>. All clients have +a local copy of the Digital Unix 4.0 operating system installed, but +get the user file space (<tt>/home</tt>) and <tt>/usr/local</tt> from +the server via NFS (Network File System). Each client has an entry +for the server and all the other clients in its +<tt>/etc/hosts.equiv</tt> file, so all clients can execute a remote +shell (rsh) to all others. The server machine is a NIS server for the +whole laboratory, so account information is the same across all the +machines. A person can sit at the <it>scilab02</it> console, +login, and have the same environment as if he logged onto the server +or <it>scilab15</it>. The reason all the clients have the same look +and feel is that the operating system is installed and configured +in the same way on all machines, and both the user's <tt>/home</tt> +and <tt>/usr/local</tt> areas are physically on the server and +accessed by the clients via NFS. For more information on NIS and NFS +please read the <htmlurl name="NIS" +url="http://sunsite.unc.edu/LDP/HOWTO/NIS-HOWTO.html"> and <htmlurl +name="NFS" url="http://sunsite.unc.edu/LDP/HOWTO/NFS-HOWTO.html"> +HOWTOs. + + +<sect1>How to utilise the other nodes ? +<p> + +Now that we have some idea about the system architecture, let us take +a look at how we can utilise the available CPU cycles of the machines +in the computer laboratory. Any person can logon to any of the +machines, and run a program in their home directory, but they can also +spawn the same job on a different machine simply by executing remote +shell. For example, assume that we want to calculate the sum of the +square roots of all integers between 1 and 10 inclusive. We write a +simple program called <tt>sigmasqrt</tt> (please see <ref +id="sigmasqrt" name="source code">) which does exactly that. To +calculate the sum of the square roots of numbers from 1 to 10 we +execute : +<verb> +[jacek@beldin sigmasqrt]$ time ./sigmasqrt 1 10 +22.468278 + +real 0m0.029s +user 0m0.001s +sys 0m0.024s + +</verb> +The <tt>time</tt> command allows us to check the wall-clock (the +elapsed time) of running this job. As we can see, this example took +only a small fraction of a second (0.029 sec) to execute, but what if +I want to add the square root of integers from 1 to 1 000 000 000 ? +Let us try this, and again calculate the wall-clock time. + +<verb> +[jacek@beldin sigmasqrt]$ time ./sigmasqrt 1 1000000000 +21081851083600.559000 + +real 16m45.937s +user 16m43.527s +sys 0m0.108s +</verb> + + +This time, the execution time of the program is considerably longer. +The obvious question to ask is what can we do to speed up the +execution time of the job? How can we change the way the job is +running to minimize the wall-clock time of running this job? The +obvious answer is to split the job into a number of sub-jobs and to +run these sub-jobs in parallel on all computers. We could split one +big addition task into 20 parts, calculating one range of square roots +and adding them on each node. When all nodes finish the +calculation and return their results, the 20 numbers could be added +together to obtain the final solution. Before we run this job we will +make a named pipe which will be used by all processes to write their +results. + +<verb> +[jacek@beldin sigmasqrt]$ mkfifo output +[jacek@beldin sigmasqrt]$ ./prun.sh & time cat output | ./sum +[1] 5085 +21081851083600.941000 +[1]+ Done ./prun.sh + +real 0m58.539s +user 0m0.061s +sys 0m0.206s +</verb> + +This time we get about 58.5 seconds. This is the time from starting +the job until all the nodes have finished their computations and +written their results into the pipe. The time does not include the +final addition of the twenty numbers, but this time is a very small +fraction of a second and can be ignored. We can see that there is a +significant improvement in running this job in parallel. In fact the +parallel job ran about 17 times faster, which is very reasonable for a +20 fold increase in the number of CPUs. The purpose of the above +example is to illustrate the simplest method of parallelising +concurrent code. In practice such simple examples are rare and +different techniques (PVM and PMI APIs) are used to achieve the +parallelism. + + +<sect1>How does Beowulf differ from a COW ? +<p> +The computer laboratory described above is a perfect example of a +Cluster of Workstations (COW). So what is so special about Beowulf, +and how is it different from a COW? The truth is that there is not +much difference, but Beowulf does have few unique characteristics. +First of all, in most cases client nodes in a Beowulf cluster do not +have keyboards, mice, video cards nor monitors. All access to the +client nodes is done via remote connections from the server node, +dedicated console node, or a serial console. Because there is no need +for client nodes to access machines outside the cluster, nor for +machines outside the cluster to access client nodes directly, it +is a common practice for the client nodes to use private IP addresses +like the 10.0.0.0/8 or 192.168.0.0/16 address ranges (RFC 1918 <htmlurl +name="http://www.alternic.net/rfcs/1900/rfc1918.txt.html" +url="http://www.alternic.net/rfcs/1900/rfc1918.txt.html">). Usually +the only machine that is also connected to the outside world using a +second network card is the server node. The most common ways of using +the system is to access the server's console directly, or either +telnet or remote login to the server node from personal workstation. +Once on the server node, users can edit and compile their code, and +also spawn jobs on all nodes in the cluster. In most cases COWs are +used for parallel computations at night, and over weekends when people +do not actually use the workstations for every day work, thus +utilising idle CPU cycles. Beowulf on the other hand is a machine +usually dedicated to parallel computing, and optimised for this +purpose. Beowulf also gives better price/performance ratio as it is +built from off-the-shelf components and runs mainly free software. +Beowulf has also more single system image features which help the +users to see the Beowulf cluster as a single computing workstation. + + +<sect>System Design +<p> +Before you purchase any hardware, it may be a good idea to consider +the design of your system. There are basically two hardware issues +involved with design of a Beowulf system: the type of nodes or +computers you are going to use; and way you connect the computer +nodes. There is one software issue that may effect your hardware +decisions; the communication library or API. A more detailed +discussion of hardware and communication software is provided later in +this document. +<p> +While the number of choices is not large, there are some important +design decisions that must be made when constructing a Beowulf +systems. Because the science (or art) of "parallel computing" has +many different interpretations, an introduction is provided below. If +you do not like to read background material, you may skip this +section, but it is advised that you read section <ref id="suitability" +name="Suitability"> before you make you final hardware decisions. + +<sect1>A brief background on parallel computing. +<p> +This section provides background on parallel computing concepts. It +is NOT an exhaustive or complete description of parallel computing +science and technology. It is a brief description of the issues that +may be important to a Beowulf designer and user. +<p> +As you design and build your Beowulf, many of these issues described +below will become important in your decision process. Due to its +component nature, a Beowulf Supercomputer requires that we consider +many factors carefully because they are now under our control. In +general, it is not all that difficult to understand the issues +involved with parallel computing. Indeed, once the issues are +understood, your expectations will be more realistic and success will +be more likely. Unlike the "sequential world" where processor speed is +considered the single most important factor, processor speed in the +"parallel world" is just one of several factors that will determine +overall system performance and efficiency. +<p> + +<sect1>The methods of parallel computing +<p> +Parallel computing can take many forms. From a user's perspective, it is +important to consider the advantages and disadvantages of each methodology. +The following section attempts to provide some perspective on the methods of +parallel computing and indicate where the Beowulf machine falls on this +continuum. +<p> +<sect2>Why more than one CPU? +<p> +Answering this question is important. Using 8 CPUs to run your word +processor sounds a little like "over-kill" -- and it is. What about a +web server, a database, a rendering program, or a project scheduler? +Maybe extra CPUs would help. What about a complex simulation, a fluid +dynamics code, or a data mining application. Extra CPUs definitely +help in these situations. Indeed, multiple CPUs are being used to +solve more and more problems. +<p> +The next question usually is: "Why do I need two or four CPUs, I will +just wait for the 986 turbo-hyper chip." There are several reasons: +<enum> +<item> Due to the use of multi-tasking Operating Systems, it is +possible to do several things at once. This is a natural +"parallelism" that is easily exploited by more than one low cost CPU. + +<item> Processor speeds have been doubling every 18 months, but what +about RAM speeds or hard disk speeds? Unfortunately, these speeds are +not increasing as fast as the CPU speeds. Keep in mind most +applications require "out of cache memory access" and hard disk +access. Doing things in parallel is one way to get around some of +these limitations. + +<item> Predictions indicate that processor speeds will not continue to double +every 18 months after the year 2005. There are some very serious obstacles to +overcome in order to maintain this trend. + +<item> Depending on the application, parallel computing can speed things up by any +where from 2 to 500 times faster (in some cases even faster). Such performance +is not available using a single processor. Even supercomputers that at one +time used very fast custom processors are now built from multiple "commodity- +off-the-shelf" CPUs. +</enum> + +If you need speed - either due to a compute bound problem and/or an I/O bound +problem, parallel is worth considering. Because parallel computing is +implemented in a variety of ways, solving your problem in parallel will +require some very important decisions to be made. These decisions may +dramatically effect portability, performance, and cost of your application. +<p> +Before we get technical, let's look take a look at a real "parallel computing +problem" using an example with which we are familiar - waiting in long lines +at a store. + +<sect2>The Parallel Computing Store +<p> +Consider a big store with 8 cash registers grouped together in the front of +the store. Assume each cash register/cashier is a CPU and each customer is a +computer program. The size of the computer program (amount of work) is the +size of each customer's order. The following analogies can be used to +illustrate parallel computing concepts. +<p> +<sect3>Single-tasking Operating System +<p> +One cash register open (is in use) and must process each customer one at a +time. +<p> +Computer Example: MS DOS +<p> +<sect3>Multi-tasking Operating System: +<p> +One cash register open, but now we process only a part of each order at a +time, move to the next person and process some of their order. Everyone +"seems" to be moving through the line together, but if no one else is in the +line, you will get through the line faster. +<p> +Computer Example: UNIX, NT using a single CPU +<p> +<sect3>Multitasking Operating Systems with Multiple CPUs: +<p> +Now we open several cash registers in the store. Each order can be processed +by a separate cash register and the line can move much faster. This is called +SMP - Symmetric Multi-processing. Although there are extra cash registers +open, you will still never get through the line any faster than just you and a +single cash register. +<p> +Computer Example: UNIX and NT with multiple CPUs +<p> + +<sect3>Threads on a Multitasking Operating Systems extra CPUs +<p> +If you "break-up" the items in your order, you might be able to move through +the line faster by using several cash registers at one time. First, we must +assume you have a large amount of goods, because the time you invest "breaking +up your order" must be regained by using multiple cash registers. In theory, +you should be able to move through the line "n" times faster than before*; +where "n" is the number of cash registers. When the cashiers need to get sub- +totals, they can exchange information quickly by looking and talking to all +the other "local" cash registers. They can even snoop around the other cash +registers to find information they need to work faster. There is a limit, +however, as to how many cash registers the store can effectively locate in any +one place. + +Amdals law will also limit the application speed-up to the slowest +sequential portion of the program. + +Computer Example: UNIX or NT with extra CPU on the same motherboard running +multi-threaded programs. + + +<sect3>Sending Messages on Multitasking Operating Systems with extra CPUs: +<p> +In order to improve performance, the store adds 8 cash registers at the back +of the store. Because the new cash registers are far away from the front cash +registers, the cashiers must call on the phone to send their sub-totals to the +front of the store. This distance adds extra overhead (time) to communication +between cashiers, but if communication is minimized, it is not a problem. If +you have a really big order, one that requires all the cash registers, then as +before your speed can be improved by using all cash registers at the same +time, the extra overhead must be considered. In some cases, the store may have +single cash registers (or islands of cash registers) located all over the +store - each cash register (or island) must communicate by phone. Since all +the cashiers working the cash registers can talk to each other by phone, it +does not matter too much where they are. + +Computer Example: One or several copies of UNIX or NT with extra CPUs on the +same or different motherboard communicating through messages. + +The above scenarios, although not exact, are a good representation of +constraints placed on parallel systems. Unlike a single CPU (or cash +register) communication is an issue. + +<sect1>Architectures for parallel computing +<p> +The common methods and architectures of parallel computing are presented +below. While this description is by no means exhaustive, it is enough to +understand the basic issues involved with Beowulf design. + +<sect2>Hardware Architectures +<p> + +There are basically two ways parallel computer hardware is put together: + +<enum> +<item> Local memory machines that communicate by messages (Beowulf Clusters) +<item> Shared memory machines that communicate through memory (SMP machines) +</enum> + +A typical Beowulf is a collection of single CPU machines connected using fast +Ethernet and is, therefore, a local memory machine. A 4 way SMP box is a +shared memory machine and can be used for parallel computing - parallel +applications communicate using shared memory. Just as in the computer store +analogy, local memory machines (individual cash registers) can be scaled up to +large numbers of CPUs, while the number of CPUs shared memory machines (the +number of cash registers you can place in one spot) can have is limited due to +memory contention. + +It is possible, however, to connect many shared memory machines to create a +"hybrid" shared memory machine. These hybrid machines "look" like a single +large SMP machine to the user and are often called NUMA (non uniform memory +access) machines because the global memory seen by the programmer and shared +by all the CPUs can have different latencies. At some level, however, a NUMA +machine must "pass messages" between local shared memory pools. + +It is also possible to connect SMP machines as local memory compute nodes. +Typical CLASS I motherboards have either 2 or 4 CPUs and are often used as a +means to reduce the overall system cost. The Linux internal scheduler +determines how these CPUs get shared. The user cannot (at this point) assign +a specific task to a specific SMP processor. The user can however, start two +independent processes or a threaded processes and expect to see a performance +increase over a single CPU system. + +<sect2>Software API Architectures +<p> +There basically two ways to "express" concurrency in a program: +<enum> +<item> Using Messages sent between processors +<item> Using operating system Threads +</enum> +<p> +Other methods do exist, but these are the two most widely used. It is +important to remember that the expression of concurrency is not necessary +controlled by the underlying hardware. Both Messages and Threads can be +implemented on SMP, NUMA-SMP, and clusters - although as explained below +efficiently and portability are important issues. +<p> +<sect3>Messages +<p> +Historically, messages passing technology reflected the +design of early local memory parallel computers. Messages require +copying data while Threads use data in place. The latency and speed +at which messages can be copied are the limiting factor with message +passing models. A Message is quite simple: some data and a destination +processor. Common message passing APIs are <htmlurl +url="http://www.epm.ornl.gov/pvm" name="PVM"> or <htmlurl +url="http://www.mcs.anl.gov/Projects/mpi/index.html" name="MPI">. Message +passing can be efficiently implemented using Threads and Messages work +well both on SMP machine and between clusters of machines. The +advantage to using messages on an SMP machine, as opposed to Threads, +is that if you decided to use clusters in the future it is easy to add +machines or scale your application. +<p> +<sect3>Threads +<p> +Operating system Threads were developed because shared memory SMP +(symmetrical multiprocessing) designs allowed very fast shared memory +communication and synchronization between concurrent parts of a +program. Threads work well on SMP systems because communication is +through shared memory. For this reason the user must isolate local +data from global data, otherwise programs will not work properly. In +contrast to messages, a large amount of copying can be eliminated with +threads because the data is shared between processes (threads). Linux +supports POSIX threads. The problem with threads is that it is +difficult to extend them beyond one SMP machine and because data is +shared between CPUs, cache coherence issues can contribute to +overhead. Extending threads beyond the SMP boundary efficiently +requires NUMA technology which is expensive and not natively +supported by Linux. Implementing threads on top of messages has been +done (<htmlurl name="(http://syntron.com/ptools/ptools_pg.htm)" +url="http://syntron.com/ptools/ptools_pg.htm">), but Threads are often +inefficient when implemented using messages. +<p> +The following can be stated about performance: +<verb> + SMP machine cluster of machines scalability + performance performance + ----------- ------------------- ----------- +messages good best best + +threads best poor* poor* + +* requires expensive NUMA technology. +</verb> + +<sect2>Application Architecture +<p> +In order to run an application in parallel on multiple CPUs, it must be +explicitly broken in to concurrent parts. A standard single CPU application +will run no faster than a single CPU application on multiple processors. +There are some tools and compilers that can break up programs, but +parallelizing codes is not a "plug and play" operation. Depending on the +application, parallelizing code can be easy, extremely difficult, or in some +cases impossible due to algorithm dependencies. +<p> +Before the software issues can be addressed the concept of Suitability +needs to be introduced. + +<sect1>Suitability<label id="suitability"> +<p> +Most questions about parallel computing have the same answer: +<p> +"It all depends upon the application." +<p> +Before we jump into the issues, there is one very important distinction that +needs to be made - the difference between CONCURRENT and PARALLEL. For the +sake of this discussion we will define these two concepts as follows: +<p> +CONCURRENT parts of a program are those that can be computed independently. +<p> +PARALLEL parts of a program are those CONCURRENT parts that are executed on +separate processing elements at the same time. +<p> +The distinction is very important, because CONCURRENCY is a property of the +program and efficient PARALLELISM is a property of the machine. Ideally, +PARALLEL execution should result in faster performance. The limiting factor +in parallel performance is the communication speed and latency between compute +nodes. (Latency also exists with threaded SMP applications due to cache +coherency.) Many of the common parallel benchmarks are highly parallel and +communication and latency are not the bottle neck. This type of problem can be +called "obviously parallel". Other applications are not so simple and +executing CONCURRENT parts of the program in PARALLEL may actually cause the +program to run slower, thus offsetting any performance gains in other +CONCURRENT parts of the program. In simple terms, the cost of communication +time must pay for the savings in computation time, otherwise the PARALLEL +execution of the CONCURRENT part is inefficient. +<p> +The task of the programmer is to determining what CONCURRENT parts of the +program SHOULD be executed in PARALLEL and what parts SHOULD NOT. The answer +to this will determine the EFFICIENCY of application. The following graph +summarizes the situation for the programmer: +<p> +<verb> + + + + | * + | * + | * + % of | * + appli- | * + cations | * + | * + | * + | * + | * + | * + | **** + | **** + | ******************** + +----------------------------------- + communication time/processing time +</verb> +<p> +In a perfect parallel computer, the ratio of communication/processing would be +equal and anything that is CONCURRENT could be implemented in PARALLEL. +Unfortunately, Real parallel computers, including shared memory machines, are +subject to the effects described in this graph. When designing a Beowulf, the +user may want to keep this graph in mind because parallel efficiency depends +upon ratio of communication time and processing time for A SPECIFIC PARALLEL +COMPUTER. Applications may be portable between parallel computers, but there +is no guarantee they will be efficient on a different platform. +<p> +IN GENERAL, THERE IS NO SUCH THING AS A PORTABLE AND EFFICIENT PARALLEL +PROGRAM +<p> +There is yet another consequence to the above graph. Since efficiency depends +upon the comm./process. ratio, just changing one component of the ratio does +not necessary mean a specific application will perform faster. A change in +processor speed, while keeping the communication speed that same may have non- +intuitive effects on your program. For example, doubling or tripling the CPU +speed, while keeping the communication speed the same, may now make some +previously efficient PARALLEL portions of your program, more efficient if they +were executed SEQUENTIALLY. That is, it may now be faster to run the +previously PARALLEL parts as SEQUENTIAL. Furthermore, running inefficient +parts in parallel will actually keep your application from reaching its +maximum speed. Thus, by adding faster processor, you may actually slowed down +your application (you are keeping the new CPU from running at its maximum +speed for that application) +<p> +UPGRADING TO A FASTER CPU MAY ACTUALLY SLOW DOWN YOUR APPLICATION +<p> +So, in conclusion, to know whether or not you can use a parallel hardware +environment, you need to have some insight into the suitability of a +particular machine to your application. You need to look at a lot of issues +including CPU speeds, compiler, message passing API, network, etc. Please +note, just profiling an application, does not give the whole story. You may +identify a computationally heavy portion of your program, but you do not +know the communication cost for this portion. It may be that for a given +system, the communication cost as do not make parallelizing this code +efficient. +<p> +A final note about a common misconception. It is often stated that "a program +is PARALLELIZED", but in reality only the CONCURRENT parts of the program have +been located. For all the reasons given above, the program is not +PARALLELIZED. Efficient PARALLELIZATION is a property of the machine. +<p> + +<sect1>Writing and porting parallel software +<p> +Once you decide that you need parallel computing and would like to design and +build a Beowulf, a few moments considering your application with respect to +the previous discussion may be a good idea. +<p> +In general there are two things you can do: +<enum> +<item>Go ahead and construct a CLASS I Beowulf and then "fit" your + application to it. Or run existing parallel applications that + you know work on your Beowulf (but beware of the portability and + efficiently issues mentioned above) + +<item>Look at the applications you need to run on your Beowulf and + make some estimations as to the type of hardware and software you + need. +</enum> + +In either case, at some point you will need to look at the efficiency issues. +In general, there are three things you need to do: +<enum> +<item> Determine concurrent parts of your program +<item> Estimate parallel efficiently +<item> Describing the concurrent parts of your program +</enum> + +Let's look at these one at a time. + +<sect2>Determine concurrent parts of your program +<p> +This step is often considered "parallelizing your program". Parallelization +decisions will be made in step 2. In this step, you need to determine data +dependencies. +<p> +>From a practical standpoint, applications may exhibit two types of +concurrency: compute (number crunching) and I/O (database). Although in many +cases compute and I/O concurrency are orthogonal, there are application that +require both. There are tools available that can perform concurrency analysis +on existing applications. Most of these tools are designed for FORTRAN. +There are two reasons FORTRAN is used: historically most number crunching +applications were written in FORTRAN and it is easier to analyze. If no tools +are available, then this step can be some what difficult for existing +applications. +<p> +<sect2>Estimate parallel efficiency +<p> +Without the help of tools, this step may require trial and error tests or just +a plain old educated guess. If you have a specific application in mind, try +to determine if it is CPU limited (compute bound) or hard disk limited (I/O +bound). The requirements of your Beowulf may be quite different depending +upon your needs. For example, a compute bound problem may need a few very +fast CPUs and high speed low latency network, while an I/O bound problem may +work better with more slower CPUs and fast Ethernet. +<p> +This recommendation often comes as a surprise to most people because, the +standard assumption is that faster processor are always better. While this is +true if your have an unlimited budget, real systems may have cost constraints +that should be maximized. For I/O bound problems, there is a little known +rule (called the Eadline-Dedkov Law) that is quite helpful: +<p> + For two given parallel computers with the same cumulative CPU performance + index, the one which has slower processors (and a probably correspondingly + slower interprocessor communication network) will have better performance + for I/O-dominant applications. +<p> +While the proof of this rule is beyond the scope of this document, you +find it interesting to download the paper <it>Performance +Considerations for I/O-Dominant Applications on Parallel +Computers</it> (Postscript format 109K ) <htmlurl +url="ftp://www.plogic.com/pub/papers/exs-pap6.ps" +name="(ftp://www.plogic.com/pub/papers/exs-pap6.ps)"> +<p> +Once you have determined what type of concurrency you have in your +application, you will need to estimate how efficient it will be in +parallel. See Section <ref id="software" name="Software"> for a +description of Software tools. +<p> +In the absence of tools, you may try to guess your way through this step. If +a compute bound loop measured in minutes and the data can be transferred in +seconds, then it might be a good candidate for parallelization. But remember, +if you take a 16 minute loop and break it into 32 parts, and your data +transfers require several seconds per part, then things are going to get +tight. You will reach a point of diminishing returns. +<p> +<sect2>Describing the concurrent parts of your program +<p> +There are several ways to describe concurrent parts of your program: +<enum> +<item> Explicit parallel execution +<item> Implicit parallel execution +</enum> + +The major difference between the two is that explicit parallelism is +determined by the user where implicit parallelism is determined by the +compiler. + +<sect3>Explicit Methods +<p> +These are basically method where the user must modify source code +specifically for a parallel computer. The user must either add +messages using <htmlurl url="http://www.epm.ornl.gov/pvm" name="PVM"> or +<htmlurl url="http://www.mcs.anl.gov/Projects/mpi/index.html" name="MPI"> or +add threads using POSIX threads. (Keep in mind however, threads can +not move between SMP motherboards). +<p> +Explicit methods tend to be the most difficult to implement and debug. Users +typically embed explicit function calls in standard FORTRAN 77 or C/C++ source +code. The MPI library has added some functions to make some standard parallel +methods easier to implement (i.e. scatter/gather functions). In addition, it +is also possible to use standard libraries that have been written for parallel +computers. Keep in mind, however, the portability vs. efficiently trade-off) +<p> +For historical reasons, most number crunching codes are written in FORTRAN. +For this reasons, FORTRAN has the largest amount of support (tools, +libraries, etc.) for parallel computing. Many programmers now use C or re- +write existing FORTRAN applications in C with the notion the C will allow +faster execution. While this may be true as C is the closest thing to a +universal machine code, it has some major drawbacks. The use of pointers in C +makes determining data dependencies extremely difficult. Automatic analysis +of pointers is extremely difficult. If you have an existing FORTRAN program +and think that you might want to parallelize it in the future - DO NOT CONVERT +IT TO C! +<p> +<sect3>Implicit Methods +<p> +Implicit methods are those where the user gives up some (or all) of the +parallelization decisions to the compiler. Examples are FORTRAN 90, High +Performance FORTRAN (HPF), Bulk Synchronous Parallel (BSP), and a whole +collection of other methods that are under development. +<p> +Implicit methods require the user to provide some information about the +concurrent nature of their application, but the compiler will then make many +decisions about how to execute this concurrency in parallel. These methods +provide some level of portability and efficiency, but there is still no "best +way" to describe a concurrent problem for a parallel computer. + +<sect>Beowulf Resources +<p> + +<sect1>Starting Points +<p> + +<itemize> + +<item>Beowulf mailing list. To subscribe send mail to <htmlurl +url="mailto:beowulf-request@cesdis.gsfc.nasa.gov" +name="beowulf-request@cesdis.gsfc.nasa.gov"> with the word +<it>subscribe</it> in the message body. + +<item>Beowulf Homepage <htmlurl name="http://www.beowulf.org" +url="http://www.beowulf.org"> + +<item>Extreme Linux <htmlurl name="http://www.extremelinux.org" +url="http://www.extremelinux.org"> + +<item>Extreme Linux Software from Red Hat <htmlurl name="http://www.redhat.com/extreme" +url="http://www.redhat.com/extreme"> + +</itemize> + + +<sect1>Documentation +<p> + +<itemize> + +<item>The latest version of the Beowulf HOWTO <htmlurl +name="http://www.sci.usq.edu.au/staff/jacek/beowulf" +url="http://www.sci.usq.edu.au/staff/jacek/beowulf">. + +<item>Building a Beowulf System <htmlurl +url="http://www.cacr.caltech.edu/beowulf/tutorial/building.html" +name="http://www.cacr.caltech.edu/beowulf/tutorial/building.html"> + +<item>Jacek's Beowulf Links <htmlurl +name="http://www.sci.usq.edu.au/staff/jacek/beowulf" +url="http://www.sci.usq.edu.au/staff/jacek/beowulf">. + +<item>Beowulf Installation and Administration HOWTO (DRAFT) <htmlurl +name="http://www.sci.usq.edu.au/staff/jacek/beowulf" +url="http://www.sci.usq.edu.au/staff/jacek/beowulf">. + +<item>Linux Parallel Processing HOWTO <htmlurl +name="http://yara.ecn.purdue.edu/~pplinux/PPHOWTO/pphowto.html" +url="http://yara.ecn.purdue.edu/~pplinux/PPHOWTO/pphowto.html"> + +</itemize> + + +<sect1>Papers<label id="papers"> +<p> + +<itemize> + +<item>Chance Reschke, Thomas Sterling, Daniel Ridge, Daniel Savarese, +Donald Becker, and Phillip Merkey <it>A Design Study of Alternative +Network Topologies for the Beowulf Parallel Workstation</it>. +Proceedings Fifth IEEE International Symposium on High Performance +Distributed Computing, 1996. <htmlurl +name="http://www.beowulf.org/papers/HPDC96/hpdc96.html" +url="http://www.beowulf.org/papers/HPDC96/hpdc96.html"> + + +<item>Daniel Ridge, Donald Becker, Phillip Merkey, Thomas Sterling +Becker, and Phillip Merkey. <it>Harnessing the Power of Parallelism in +a Pile-of-PCs</it>. Proceedings, IEEE Aerospace, 1997. <htmlurl +name="http://www.beowulf.org/papers/AA97/aa97.ps" +url="http://www.beowulf.org/papers/AA97/aa97.ps"> + + +<item>Thomas Sterling, Donald J. Becker, Daniel Savarese, Michael +R. Berry, and Chance Res. <it>Achieving a Balanced Low-Cost +Architecture for Mass Storage Management through Multiple Fast +Ethernet Channels on the Beowulf Parallel Workstation</it>. +Proceedings, International Parallel Processing Symposium, 1996. +<htmlurl name="http://www.beowulf.org/papers/IPPS96/ipps96.html" +url="http://www.beowulf.org/papers/IPPS96/ipps96.html"> + + +<item>Donald J. Becker, Thomas Sterling, Daniel Savarese, Bruce +Fryxell, Kevin Olson. <it>Communication Overhead for Space Science +Applications on the Beowulf Parallel Workstation</it>. +Proceedings,High Performance and Distributed Computing, 1995. +<htmlurl name="http://www.beowulf.org/papers/HPDC95/hpdc95.html" +url="http://www.beowulf.org/papers/HPDC95/hpdc95.html"> + + + +<item>Donald J. Becker, Thomas Sterling, Daniel Savarese, John +E. Dorband, Udaya A. Ranawak, Charles V. Packer. <it>BEOWULF: A +PARALLEL WORKSTATION FOR SCIENTIFIC COMPUTATION</it>. Proceedings, +International Conference on Parallel Processing, 95. +<htmlurl name="http://www.beowulf.org/papers/ICPP95/icpp95.html" +url="http://www.beowulf.org/papers/ICPP95/icpp95.html"> + +<item>Papers at the Beowulf site <htmlurl +url="http://www.beowulf.org/papers/papers.html" +name="http://www.beowulf.org/papers/papers.html"> + + +</itemize> + + +<sect1>Software<label id="software"> +<p> +<itemize> +<item>PVM - Parallel Virtual Machine <htmlurl +name="http://www.epm.ornl.gov/pvm/pvm_home.html" +url="http://www.epm.ornl.gov/pvm/pvm_home.html"> + + + +<item>LAM/MPI (Local Area Multicomputer / Message Passing Interface +<htmlurl url="http://www.mpi.nd.edu/lam" +name="http://www.mpi.nd.edu/lam"> + +<item>BERT77 - FORTRAN conversion tool <htmlurl +url="http://www.plogic.com/bert.html" +name="http://www.plogic.com/bert.html"> + +<item>Beowulf software from Beowulf Project Page <htmlurl +name="http://beowulf.gsfc.nasa.gov/software/software.html" +url="http://beowulf.gsfc.nasa.gov/software/software.html"> + +<item>Jacek's Beowulf-utils <htmlurl +name="ftp://ftp.sci.usq.edu.au/pub/jacek/beowulf-utils" +url="ftp://ftp.sci.usq.edu.au/pub/jacek/beowulf-utils"> + +<item>bWatch - cluster monitoring tool <htmlurl +url="http://www.sci.usq.edu.au/staff/jacek/bWatch" +name="http://www.sci.usq.edu.au/staff/jacek/bWatch"> + +</itemize> + + + +<sect1>Beowulf Machines +<p> +<itemize> + +<item>Avalon consists of 140 Alpha processors, 36 GB of RAM, and is +probably the fastest Beowulf machine, cruising at 47.7 Gflops and +ranking 114th on the Top 500 list. <htmlurl +name="http://swift.lanl.gov/avalon/" +url="http://swift.lanl.gov/avalon/"> + +<item>Megalon-A Massively PArallel CompuTer Resource (MPACTR) consists +of 14, quad CPU Pentium Pro 200 nodes, and 14 GB of RAM. <htmlurl +name="http://megalon.ca.sandia.gov/description.html" +url="http://megalon.ca.sandia.gov/description.html"> + +<item>theHIVE - Highly-parallel Integrated Virtual Environment is +another fast Beowulf Supercomputer. theHIVE is a 64 node, 128 CPU +machine with the total of 4 GB RAM. <htmlurl +name="http://newton.gsfc.nasa.gov/thehive/" +url="http://newton.gsfc.nasa.gov/thehive/"> + +<item>Topcat is a much smaller machine and consists of 16 CPUs and 1.2 +GB RAM. <htmlurl name="http://www.sci.usq.edu.au/staff/jacek/topcat" +url="http://www.sci.usq.edu.au/staff/jacek/topcat"> + +<item>MAGI cluster - this is a very interesting site with many good +links. <htmlurl name="http://noel.feld.cvut.cz/magi/" +url="http://noel.feld.cvut.cz/magi/"> + +</itemize> + + + +<sect1>Other Interesting Sites +<p> + +<itemize> +<item>SMP Linux <htmlurl name="http://www.linux.org.uk/SMP/title.html" +url="http://www.linux.org.uk/SMP/title.html"> + +<item>Paralogic - Buy a Beowulf <htmlurl name="http://www.plogic.com" +url="http://www.plogic.com"> + +</itemize> + +<sect1>History<label id="history"> +<p> +<itemize> + +<item> Legends - Beowulf <htmlurl name="http://legends.dm.net/beowulf/index.html" +url="http://legends.dm.net/beowulf/index.html"> + +<item> The Adventures of Beowulf <htmlurl +name="http://www.lnstar.com/literature/beowulf/beowulf.html" +url="http://www.lnstar.com/literature/beowulf/beowulf.html"> + +</itemize> + +<sect>Source code +<p> +<sect1>sum.c<label id="sum"> +<p> +<verb> +/* Jacek Radajewski jacek@usq.edu.au */ +/* 21/08/1998 */ + +#include <stdio.h> +#include <math.h> + +int main (void) { + + double result = 0.0; + double number = 0.0; + char string[80]; + + + while (scanf("%s", string) != EOF) { + + number = atof(string); + result = result + number; + } + + printf("%lf\n", result); + + return 0; + +} +</verb> + +<sect1>sigmasqrt.c<label id="sigmasqrt"> +<p> +<verb> +/* Jacek Radajewski jacek@usq.edu.au */ +/* 21/08/1998 */ + +#include <stdio.h> +#include <math.h> + +int main (int argc, char** argv) { + + long number1, number2, counter; + double result; + + if (argc < 3) { + printf ("usage : %s number1 number2\n",argv[0]); + exit(1); + } else { + number1 = atol (argv[1]); + number2 = atol (argv[2]); + result = 0.0; + } + + for (counter = number1; counter <= number2; counter++) { + result = result + sqrt((double)counter); + } + + printf("%lf\n", result); + + return 0; + +} +</verb> + + +<sect1>prun.sh<label id="prun"> +<p> + +<verb> +#!/bin/bash +# Jacek Radajewski jacek@usq.edu.au +# 21/08/1998 + +export SIGMASQRT=/home/staff/jacek/beowulf/HOWTO/example1/sigmasqrt + +# $OUTPUT must be a named pipe +# mkfifo output + +export OUTPUT=/home/staff/jacek/beowulf/HOWTO/example1/output + +rsh scilab01 $SIGMASQRT 1 50000000 > $OUTPUT < /dev/null& +rsh scilab02 $SIGMASQRT 50000001 100000000 > $OUTPUT < /dev/null& +rsh scilab03 $SIGMASQRT 100000001 150000000 > $OUTPUT < /dev/null& +rsh scilab04 $SIGMASQRT 150000001 200000000 > $OUTPUT < /dev/null& +rsh scilab05 $SIGMASQRT 200000001 250000000 > $OUTPUT < /dev/null& +rsh scilab06 $SIGMASQRT 250000001 300000000 > $OUTPUT < /dev/null& +rsh scilab07 $SIGMASQRT 300000001 350000000 > $OUTPUT < /dev/null& +rsh scilab08 $SIGMASQRT 350000001 400000000 > $OUTPUT < /dev/null& +rsh scilab09 $SIGMASQRT 400000001 450000000 > $OUTPUT < /dev/null& +rsh scilab10 $SIGMASQRT 450000001 500000000 > $OUTPUT < /dev/null& +rsh scilab11 $SIGMASQRT 500000001 550000000 > $OUTPUT < /dev/null& +rsh scilab12 $SIGMASQRT 550000001 600000000 > $OUTPUT < /dev/null& +rsh scilab13 $SIGMASQRT 600000001 650000000 > $OUTPUT < /dev/null& +rsh scilab14 $SIGMASQRT 650000001 700000000 > $OUTPUT < /dev/null& +rsh scilab15 $SIGMASQRT 700000001 750000000 > $OUTPUT < /dev/null& +rsh scilab16 $SIGMASQRT 750000001 800000000 > $OUTPUT < /dev/null& +rsh scilab17 $SIGMASQRT 800000001 850000000 > $OUTPUT < /dev/null& +rsh scilab18 $SIGMASQRT 850000001 900000000 > $OUTPUT < /dev/null& +rsh scilab19 $SIGMASQRT 900000001 950000000 > $OUTPUT < /dev/null& +rsh scilab20 $SIGMASQRT 950000001 1000000000 > $OUTPUT < /dev/null& +</verb> + + +</article> diff --git a/LDP/retired/CSPM-HOWTO/CSPM-HOWTO.xml b/LDP/retired/CSPM-HOWTO/CSPM-HOWTO.xml new file mode 100644 index 00000000..b29225ed --- /dev/null +++ b/LDP/retired/CSPM-HOWTO/CSPM-HOWTO.xml @@ -0,0 +1,260 @@ +<?xml version="1.0"?> +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://docbook.org/xml/4.2/docbookx.dtd" +> +<article id="spm"> + <articleinfo><title>Complete System Performance Monitor HOWTO + + This HOWTO provides an overview of the Complete System Performance Monitor, including a description of the product and installation and configuration information. + + + Chris + Lorenz + +
lorenzc@us.ibm.com
+
+
+ 2003-06-10 + + + 2.0 + 2003-06-10 + CL + + + +Copyright and legal notice + Copyright © 2003 IBM Corporation. All + rights reserved. + + This document is provided "AS IS," with no + express or implied warranties. Use the information in + this document at your own risk. + + Linux is a registered trademark of Linus Torvalds. Other company, product, and service + names may be trademarks or service marks of others. + +Permission is granted to copy, distribute, and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover text, and no Back-Cover text. A copy of the license can be found at http://www.gnu.org/licenses/fdl.txt. + +What Is the Complete System Performance Monitor? +The Complete System Performance Monitor (CSPM), written by Don Dupuis of Compaq Computer Corporation, is a graphical tool that monitors a Linux® system's CPU, memory, storage, network, and IRQ utilization. CSPM gathers all the data automatically and then generates histogram displays of system usage. + +Requirements +CSPM V1.0 and later require the following: +Red Hat Linux 7.2 or later, Mandrake 8.2 or later, or any Linux +kernel that has Stephen Tweedie's sar or sysstat patch applied (such as 2.4.20). +The Trolltech Qt 3.0 or later C++ application development environment, which is available for download from Trolltech for free. + + + +Installing CSPM and its requirements +This section describes how to acquire the Qt application development environment and install CSPM. +Installing Qt 3.0 or later + +Qt 3.0 or later must be installed on the system before you install CSPM. +Follow these steps to acquire and configure Qt: + + + +Download the Qt X/11 Free Edition from http://www.trolltech.com for the latest version of Qt. + + +Follow Trolltech's instructions for installing Qt. + + +Run ./configure with the -thread switch to the configure +program so that Qt is installed to run in multithreaded mode. +# ./configure -thread + +Be sure to export the variables QTDIR and LD_LIBRARY_PATH, as +described in the Qt installation instructions that are downloaded with the software. + + + + +Installing CSPM +The following sections describe how to download and install CSPM. +These steps must be run by the root user. +The installation process creates a directory called spm and places all the files in that directory. + + +Installing from rpm +Follow these steps to install CSPM from the rpm file: + + +Download the CSPM rpm file from SourceForge at http://sourceforge.net/projects/cspm. The program name +for CSPM is spm2. + +Install the software: +# rpm -ihv --nodeps spm2-1.0-1.586.rpm +The rpm creates the binary call spm2 in the current directory. + + + + +Installing from tar +Follow these steps to install CSPM from the tar file: + +Download the CSPM tar file from SourceForge at http://sourceforge.net/projects/cspm. The program name +for CSPM is spm2. + +Untar the spm2.tar.gz file: +# tar xvzf spm2.tar.gz +Compile CSPM: +# make all +The make command creates the binary call spm2 in the current directory. + + + + +Starting the CSPM monitor +The spm2 program should be run by a user other than root so that any changes to +the default preference settings can be changed. +Enter the following command from the directory where CSPM is installed: +# ./spm2 +If a segmentation fault occurs when spm2 is starting up, make sure that you have set the QTDIR and LD_LIBRARY_PATH variables, as described in the Qt installation instructions that are downloaded with the software. + + + +Modifying CSPM defaults +By default, the number of "range bars" along the y-coordinate of each histogram +is five. When there is no activity for a particular device, CSPM provides default values +of 0, 0.2, 0.4, 0.6, and 0.8. Once activity begins on the device, CSPM sets the +five values in equal increments from 0 to the peak data value collected in each +collection interval. Sometimes the grid lines fall directly on the range bar numbers, +making the numbers hard to read. You can either adjust the color of the grid lines, +adjust the collection interval, or try to ignore the grid lines. + + +You can modify the default grid, sizing, and monitoring settings for each of the views from +the Preferences pulldown. From the +Preferences pulldown, you can select System, +Tests, CPU, Memory, Network, +Storage or IRQs. Once you select a particular item, you +can view the Grid, Monitoring, or Sizing tab +(if applicable) for that item. +From the Grid tab you can change such things as: + +the color of the grid lines +the distance (or time), in seconds, between intervals when data is collected (horizontal lines appear at each interval) +the color of the various data bars (such as read, write, user, nice, and "sys") +the number of horizontal range bars (default is 5) +the size of the histogram titles + +From the Monitor tab you can change things such as: + + +the height and width of the display boxes (in pixels) +the colors of the display boxes +the type of data to be monitored (IOs, data, reads and writes, sectors and blocks) + +From the Sizing tab you can change the minimum height and width of the +display boxes (in pixels). + +How CSPM displays data +CSPM displays histograms that provide information about system usage. +The program has 8 display tabs for the different types of system information CSPM +collects. These tabs are: + +System Overview + +IRQs + +CPU Utilization + +Memory + +Network + +Storage + +Tests + +Test Summary + + + +The key at the bottom of the histogram tables on each of the tabs tells how to interpret +the various colors representing data in the tables. +Use the horizontal and vertical scroll bars to view any histograms that do not +fit on the initial screen. + +<guilabel>System Overview</guilabel> tab +When CSPM starts up, the System Overview screen is displayed. The histograms +on the System Overview screen show data for the total system, including CPU, memory, +network, and storage usage. The following screenshot shows a sample view of a +System Overview screen. + +Below each histogram is a key that describes the data that is represented. For example, in the +CPU total histogram, the red line represents user CPU usage, the green line represents commands run with a modified scheduling priority (nice), and the blue line represents system CPU usage. + + +<guilabel>IRQs</guilabel> tab + +When you click the IRQs tab, a histogram opens for each IRQ line that +runs to an ISA slot +on the system. The following screenshot shows a sample view of the IRQs screen. +Note +With Qt 3.0, the horizontal scroll bars on the Irqs tab does not work properly. This +problem does not occur with Qt 3.1. + +The large blue number to the left of the histogram is the number of the IRQ. +The +red line on each histogram represents the number of IRQs per second utilitized by the device +connected to the IRQ's ISA slot. + + + +<guilabel>CPU Utilization</guilabel> tab +When you click the CPU Utilization tab, histograms open for each CPU +on the system, as +shown in the following screenshot: + + +The histograms show information about user (red), system (blue), and nice priority (green) command utilization. + + +<guilabel>Memory</guilabel> tab +The Memory tab is still under development. In a future release of CSPM, +the Memory tab will graphically show how much memory processes use, from most to least. + + +<guilabel>Network</guilabel> tab +When you click the Network tab, histograms that show the amount of traffic on the system's loopback device and each network device are displayed, as shown in the following screenshot. + + +Sends are shown in red and receives are shown in blue. + + +<guilabel>Storage</guilabel> tab +When you click the Storage tab, a collection of histograms opens that +show data +for controllers, disks, and partitions. +The key at the bottom of the histograms tells which +color of histogram box corresponds to which type of device. + + +The screenshot +displays purple for controllers, green for disks, and orange for partitions. +The red lines represent +reads from the devices and the blue lines represent writes to the devices. +To see information about a partition (such as file system name, space used, and +space available), right-click the partition's histogram and then left-click Properties. A +Partition Status window opens that displays information about the selected partition. + + + +<guilabel>Tests</guilabel> tab +The Tests tab opens a list of tests that can be run on the system +and is useful, for example, for quality assurance personnel who need to load test systems when testing hardware or software. + + +<guilabel>Test Summary</guilabel> tab +The Test Summary tab contains test output and utilization numbers for test runs. +You can print these test results and keep them for your records. + + + + + +
+ diff --git a/LDP/retired/CSPM-HOWTO/cpu.png b/LDP/retired/CSPM-HOWTO/cpu.png new file mode 100644 index 00000000..4a05e4f2 Binary files /dev/null and b/LDP/retired/CSPM-HOWTO/cpu.png differ diff --git a/LDP/retired/CSPM-HOWTO/irqs.png b/LDP/retired/CSPM-HOWTO/irqs.png new file mode 100644 index 00000000..e493883c Binary files /dev/null and b/LDP/retired/CSPM-HOWTO/irqs.png differ diff --git a/LDP/retired/CSPM-HOWTO/network.png b/LDP/retired/CSPM-HOWTO/network.png new file mode 100644 index 00000000..042bbc92 Binary files /dev/null and b/LDP/retired/CSPM-HOWTO/network.png differ diff --git a/LDP/retired/CSPM-HOWTO/snapshot5.png b/LDP/retired/CSPM-HOWTO/snapshot5.png new file mode 100644 index 00000000..1151d4fc Binary files /dev/null and b/LDP/retired/CSPM-HOWTO/snapshot5.png differ diff --git a/LDP/retired/CSPM-HOWTO/snapshot7.png b/LDP/retired/CSPM-HOWTO/snapshot7.png new file mode 100644 index 00000000..dc190b27 Binary files /dev/null and b/LDP/retired/CSPM-HOWTO/snapshot7.png differ diff --git a/LDP/retired/CSPM-HOWTO/snapshot8.png b/LDP/retired/CSPM-HOWTO/snapshot8.png new file mode 100644 index 00000000..02dd48a4 Binary files /dev/null and b/LDP/retired/CSPM-HOWTO/snapshot8.png differ diff --git a/LDP/retired/CSPM-HOWTO/snapshot9.png b/LDP/retired/CSPM-HOWTO/snapshot9.png new file mode 100644 index 00000000..3f7087ba Binary files /dev/null and b/LDP/retired/CSPM-HOWTO/snapshot9.png differ diff --git a/LDP/retired/CSPM-HOWTO/storage.png b/LDP/retired/CSPM-HOWTO/storage.png new file mode 100644 index 00000000..aaafc3c7 Binary files /dev/null and b/LDP/retired/CSPM-HOWTO/storage.png differ diff --git a/LDP/retired/CSPM-HOWTO/sysover.png b/LDP/retired/CSPM-HOWTO/sysover.png new file mode 100644 index 00000000..fe7c3091 Binary files /dev/null and b/LDP/retired/CSPM-HOWTO/sysover.png differ diff --git a/LDP/retired/Distributions-HOWTO/Distributions-HOWTO.sgml b/LDP/retired/Distributions-HOWTO/Distributions-HOWTO.sgml new file mode 100755 index 00000000..0d329730 --- /dev/null +++ b/LDP/retired/Distributions-HOWTO/Distributions-HOWTO.sgml @@ -0,0 +1,3540 @@ + + + + + +
+ + English-language GNU/Linux distributions on CD-ROM + + + + + + + English-language GNU/Linux distributions on CD-ROM + + (formerly: The Linux distributions HOWTO) + + + Martin + Wheeler + S. + + + StarTEXT + document engineering +
+ Glastonbury + England, UK + + msw@startext.co.uk + +
+
+
+ + + + v7.0 + 2000-01-31 + +  msw + + + + + + + 2001 + Martin S. Wheeler + + + + + This document is intended to show prospective + users or administrators of a GNU/Linux system the range of + choices open to them when deciding on a + distribution for the first time. It also aims to help experienced + users track the state of the GNU/Linux distributions + market. + It emphatically does not + aim to be a complete list of all GNU/Linux distributions for all + platforms and in all languages. The focus is on popular + English-language distributions; specifically compiled for the Intel platform; + available on CD-ROM; and easily accessible to the first-time user. + + + + + + Archived Document Notice: + This document has been archived by the LDP. It is no longer + being actively maintained and has been replaced by the + English-language + GNU/Linux distributions on CD-ROM. + + + + + + +
+ + + + +Introduction + + + + + Background + + + There is no one single authoritative master distribution of the + GNU/Linux operating system software suites. Instead, there are many + such distributions (over one hundred and sixty at the last count) — + available over the net via anonymous FTP; by mail order from various + emporia; directly from + the shelves of your local bookshop or computer store; as a boxed set + or as loose CD-ROMs; as an insert in the back of a book; or as a cover + disk on specialist magazines. + + + + The purpose of this document is to provide short summaries of those + English-language GNU/Linux CD-ROM distributions available as loose or as + boxed CD-ROM sets (with or without manuals); and to provide + pointers for the reader to find more information. Distributions + in languages + other than English also exist, but are outwith the scope of + this document. + + + + The information presented here is in no way complete; i.e. there are + certainly more English-language distributions than all those listed + in this document. By the nature of open + source software, anyone who changes anything in their GNU/Linux + installation and then makes that particular version available to others + can be said to be in some way creating a `distribution'. + A document such as this has to choose somewhere to draw the line + between what is, and what is not, suitable for consideration as a + distinct distribution in its own right. + The editors have chosen `available on CD' as their simple criterion. + + + + Note that this is + by no means the authoritative definition of a distribution. There are + numerous small distributions available on floppy disk that offer things the + big distributions don't — not the least of which is smallness + itself. A good list of such distributions is to be found at: + Tom's rescue and boot disk site; or the + small distributions + site. + + + + The rationale behind producing this document in the first place — given that + there are very many similar texts to be found on the WWW at any one moment + — is to provide a distributable version of the same information, accessible by + other than online means. (Not everyone who could use this information has access + to a telephone line or to the web.) + + + + If you are associated with a CD-ROM distribution we don't list, please see + + near the end of this document for information on making a submission. + It's easy to do and should take less than five minutes. + + + + For a more complete list of distributions (albeit with perhaps slightly less + information on each), see the + + Linux HQ distributions list; or the + full distributions + site. + + + + Disclaimer: + We make absolutely no guarantee as to the + correctness of the information, prices, and ordering details given + in this document. Check the date-last-modified field of each distribution + to get an idea of its currency, then go to the vendor's web page for + up-to-date information. Furthermore, unless otherwise stated, all + GNU/Linux software comes with ABSOLUTELY NO WARRANTY. + + + + The editor tries to stick to facts in most of this document, but + — inevitably — has personal opinions on the state of the Linux market. + You can read these under . + + + + Personal disclaimer: + I [msw] have no financial connection with any Linux + vendor, nor have I accepted any remuneration or perquisites from + any vendor. No free disks for review; not even as much as a T-shirt. + (But hey — I'm always open to offers. XXL.) + + + + + + + + New versions of this document + + + This document will be regularly posted to the newsgroup + comp.os.linux.answers + The document is also archived on a number + of Linux FTP sites, including metalab.unc.edu in + pub/Linux/docs/HOWTO. + + + + You can also view the latest version of this document on the World + Wide Web via the url + + http://www.startext.co.uk/msw/NEW_Distributions-HOWTO/index.html. + + + + Feel free to mail any questions or comments about this document to the + current editor, Martin Wheeler + (msw@startext.co.uk). + Please do not + send general Linux questions or requests for help in + choosing a distribution (unless you're willing to hire me at my + commercial consultancy rates); I don't have time to deal with them; + and I try to put everything I know about choosing a suitable + distribution into this document. + + + + + + + + Recent changes + + + - details of individual distributions brought up to date + + + + - text markup upgraded from DocBook 3.0 to DocBook 4.1 + + + + - division of distributions into two lists + + + + - increased number of distributions covered + + + + - inclusion of inline images for company logos + + + + - added scope for inclusion of reviewers' remarks + + + + The editorship and maintenance of this document was taken over from + Eric S. Raymond (esr@thyrsus.com) + by Martin Wheeler in + January 2001; and although much of the original text has been retained, all + controversial statements and opinions should be considered solely + those of the current editor. + + + + + + + + Overview of the Linux market + + + In the beginning (say 1993), a GNU/Linux distribution was something + you downloaded off the Internet onto floppies. Installation was a + lengthy, laborious and error-prone process; + repeated frustrations due to bad (magnetic-disk) media were common. + + + + Then came cheap CD-ROM drives, and the cheap-to-produce CD-ROM — + a medium ideally suited for shipping large volumes of operating-system + software at low cost. A whole mini-industry has now built up around + commercial CD-ROM GNU/Linuxes; and because the vendors have the actual + cash flow to fund support and marketing these days, they have come + to dominate the Linux world. Debian is now the only significant + non-commercial release; and despite the ease with which software may + be downloaded from the internet these days, even it seems to be + propagated to new users largely by the ubiquitous CD-ROM. + + + + (In all fairness, it should be noted here that the rise in popularity of + GNU/Linux systems over the past five years has been due in no small measure + to the increased number of applications packages bundled with each distribution + — from circa 400 in 1995 to just under 4,000 in 2000. What used to be + distributable on a single CD is now usually spread over four or six disks. Downloading + a `full' distribution is no longer a real option for most users, whether + experienced or novice.) + + + + Most of the CD-ROM distributions (including Slackware, S.u.S.E. Debian and + Red Hat) are still available for FTP from the home sites of their + developers. But if you have a CD-ROM drive and a few euros to + spare, you will have many more distributions and more support options to + choose from (and you'll usually get some well-produced and useful paper + documentation with it). For more on the details of installation, see + the Linux Installation HOWTO, + (http://www.linuxdoc.org/HOWTO/Installation-HOWTO/index.html). + + + + Prices for CD-ROM distributions of Intel GNU/Linux software start at + around 4 or 5 euros for a single disk, and can go all the way up to EUR 100 + for a boxed set, with manuals. (And those + extra euros can buy real value.) Many vendors also sell subscription deals + that will lower your cost-per-CD for regular updates over the + subscription period. Prices may be even higher when commercial packages + (e.g. graphics or word-processing applications) are bundled in with the basic + distribution. + + + + Price correlates with features and quality pretty well (as one + would expect in a very competitive market). I would personally recommend + paying the few extra euros for a top-drawer original CD-ROM + distribution; this will pay off in fewer installation and + administration hassles down the road. (For example, installation of S.u.S.E. 7.0 + from DVD now takes little over 20 mins on a fairly run-of-the-mill + machine, with automatic detection of most network and video cards. + Compare that with the one-and-a-half hours it took me to install my first + copy of Linux-FT, which — at the time — I thought was a dream installation.) + + + + Making good choices is also much simpler than it used to be. In 1995-96 + the Linux market underwent a serious shakeout, with only a very few + commercial distributions emerging as leaders, while the weaker ones + disappeared or stagnated. (My own personal favourite at the time — + Linux-FT — went down without trace. RIP Unifix — welcome S.u.S.E.) + The toll among general-purpose + non-commercial distributions has been even fiercer. Essentially, + only Debian (and derivatives) survive in this role. + + + + As a result, the three-tier structure of primary distribution + builders, value-added repackagers, and bottom-feeding CD shovellers + that used to define the market has nearly collapsed. To be + competitive in the third millennium, a Linux vendor (whether + commercial or non-commercial) has to offer reasonable support and + behave like a primary distribution builder, whether it really is one + or not. + + + + As long as you look for a recent freeze date though, it is + pretty hard to get stuck with a duff distribution these days. + + + + + + + + Personal opinions + + + + + + + + + + Martin Wheeler + + + + + + + In this section, I present my own opinions, for what they're worth. + However, there is no substitute for making your own evaluation, based + on experience — plus the data in this guide, of course. These opinions are + intended more to show up any possible + personal bias than as a guide to what anyone else should do. + + + + In the beginning was Slackware — usually to be found along with a + few other goodies on the cover disks of the more enlightened + magazines. But from the beginnings of the Linux (CD-ROM) industry + circa 1993 until the autumn of 1995, Yggdrasil was top distribution — it + essentially founded the CD-ROM market in North America, then set the + standard for everybody else. (In Europe of course, Slackware reigned.) + The previous editor of this document, Eric Raymond, described how he used + Yggdrasil, and recommended it over commercial System V versions for + its "superior documentation, large collection of applications, and + enlightened policy of sending free releases to open-source authors, + then dedicating part of the price of each CD-ROM to financially + supporting free software". Unfortunately, Yggdrasil hasn't issued + a new release since 1995, and they've now been left well behind by the market. + + + + Personally, after playing with Slackware for a while, I toyed with the + idea of Yggdrasil, but instead moved on to a distribution which gave me + what I wanted at the time — my own personal webserver; an X interface; + and enough development and SGML editing tools to keep me happy for years. + (Plus a rather nice system which loaded and unloaded applications for me + automatically, according to how much I used them.) + Unfortunately, Linux-FT was not to endure; and in 1996 I finally settled on + Debian as my ideal distribution, as I had come to want more, and was also a + far more experienced user by then. There is an important point to be noted by + first-time buyers here — go for whatever distribution gives you what you + most want at the time; then change with your needs. The financial costs + incurred in doing this are negligible. + + + In previous versions of this document, Eric Raymond wrote: + "I now run Red Hat Linux and am quite satisfied with it. They have + successfully created a de-facto standard in distribution packaging + with RPM (now also used by SuSE and Mandrake, among others). They've + made most of the right moves at the right times and I consider them + the current market leader." + + + + This may still be true for North America; but in Europe Red Hat is + rapidly falling into third place behind the very much more popular + S.u.S.E. and Mandrake distributions; and the "standard" RPM application + packaging is turning out to be not quite as standard as one might wish + for — as RPMs from one distribution do not necessarily always transfer + to another. + + + + Eric himself has now given up vanilla Red Hat and has written to tell me he's been + running the KRUD version for the last year and is very happy with it. It just goes + to show... + + + + However, one of the major influences in decision-making + for most newcomers to GNU/Linux is not so much the number of useful + packages included with any distribution, but the perceived sexiness of the user + interface it uses as its default. (All distributions will run all X + desktop environments and window managers, given the right hardware resources + — but not all distributions are set to default on startup to the most attractive + screen presentation for the novice user.) Be aware of this when evaluating + different distributions — it is surprising how many potential new users interpret + the sizzle as the steak. + + + + But if you're ideologically wedded to using a non-commercial distribution, + Debian seems to be the clear choice: the only one left with + a serious support team behind it, and a rock-solid package management + system, allowing trouble-free translation to and from other package + management systems. + + + + Certainly, in my own experience, Debian suits my personal needs best. + Nevertheless, despite any efforts I might make to persuade them otherwise, + my commercial clients invariably plump for S.u.S.E. or Mandrake as their + choice of first distribution. (As ever, it's a case of horses for courses.) + + + + These opinions should certainly not be interpreted as an + unconditional endorsement; different Linux distributions are + optimized for different needs, and yours may well be best served by + some other distribution (especially if, unlike us, you're mainly a + DOS user and are looking for a distribution tuned for dual-boot + systems and being launched from DOS). + + + + Furthermore, industry standing is volatile. By the time you read + this, Debian, S.u.S.E. or Red Hat may well have fallen out of favour + or fashion, and been displaced by hungrier newcomers offering more + and better features. (And the obligatory sexier graphical interface + of course.) + + + + + + + + + +Best-known distributions + + + (listed in alphabetical order) + + + + The handful of distributions listed here are those which are most widely + known by the general public, or referred to most + often by the specialist media, or those most commonly found in retail + outlets in English-speaking countries. + What exact sales percentage of the total GNU/Linux distributions market + they represent is unknown — but it is certainly extremely high. Between + them, they account for almost all that the (generally uninformed) public + knows about "Linux". + + + + + + + + Caldera OpenLinux + + + + + + Name: + + + Caldera OpenLinux + + + + + + Distributor: + + + +
+ Caldera, Inc. + 633 South 550 East + Provo, Utah 84606 +
+
+ + + + E-mail: info@caldera.com + WWW: http://www.caldera.com/ + FTP: ftp://ftp.caldera.com + Vox: (801)-377-7678 + Fax: (801)-377-8752 + + + +
+
+ + + Provider's description: + + + + + + + + + Caldera logo + + + + + + Caldera is shipping OpenLinux 1.2 in a three-tiered family of + products: OpenLinux Lite, OpenLinux Base, and OpenLinux Standard. + + + + OpenLinux Lite is a freely available evaluation of the OpenLinux + product (it includes a 90-day evaluation of the Caldera integrated + desktop — the full licensed version of the desktop is included in the + Base and Standard products). OpenLinux Lite can be downloaded from + Caldera's ftp site, or obtained on CD for the cost of shipping. It + is also designed for use by book and software publishers to provide + a commercially stable Linux offering with their books and software + products. + + + + OpenLinux Base contains everything that is in Lite plus it is a + complete, easy-to-install Linux operating system, with integrated + desktop, Internet client and server components, and Intranet + connectivity. OpenLinux Base includes Netscape Navigator and full + documentation. + + + + OpenLinux Standard includes what is in Base plus more high-end, name + brand, commercial software components (such as Netscape FastTrack Web + Server, Netscape Navigator Gold Web browser and authoring tools, + ADABAS D database, StarOffice productivity suite, Caldera OpenDOS, and + NetWare client and administration tools). + + + + All three tiers of the OpenLinux 1.2 release are currently available. + + + + With Caldera OpenLinux, you can see a whole world of powerful + new computing, even the power of a UNIX workstation on your PC! + By using a Linux kernel, OpenLinux gives you speed and stability + that compare to systems costing thousands of dollars. Open Linux + also gives you: + + + + + + + + Real multi-tasking runs many text or graphical applications at + once; no application can cause another to crash, unlike less robust + systems. + + + + + + The Linux 2.0 kernel gives super-fast TCP/IP access to the + Internet, plus loadable device drivers, for the most efficient use + of your system resources. + + + + + + Easy-to-follow, quick installation with menu-based choices and + auto-detection of your hardware make installation a snap on most + systems. The Getting Started Guide (included) provides a + step-by-step illustrated procedure, with troubleshooting tips. + + + + + + + + No other Linux system includes a complete, integrated desktop + interface with configuration tools and graphical editor. Its + powerful drag-and-drop capabilities come pre-configured with + thousands of icons and application settings. The Desktop provides a + convenient place where you can store your favorite programs and + data files for instant access. The Desktop gives you: + + + + + + + + Drag-and-drop launching of programs with data files. + + + + + + An integrated graphical text editor. + + + + + + Easy access to an array of powerful system configuration tools. + + + + + + A configurable icon bar, custom layouts, and preference settings. + + + + + + Powerful file management using drag-and-drop or graphical dialogs. + + + + + + + + + + + Internet access: + + + + WWW: http://www.caldera.com/ + FTP: ftp://ftp.caldera.com + + + + + + + Ordering: + + + By e-mail with PGP key, by phone, by fax, or by conventional mail. + Full ordering details are at + + http://www.caldera.com/mpro/orinfo/orderinfo.html. + + + + + + Support: + + + + Caldera is one of the only Linux distributors to offer E-mail and + telephone support. OpenLinux Base (E-mail only) and Standard + (Telephone and E-mail) users are fully supported (Standard users + receive 5 free incident calls during the first 30 days). There is + no technical support for the Lite product. + + + + OpenLinux Base and Standard ship with full licensed versions of the + Caldera Desktop, which do not expire. OpenLinux Lite ships with a + 90-day evaluation version of the Desktop. + + + + + + + Last freeze date: + + + + + + + + + Entry last modified: + + + 21 January 2001 + + + + + + Reviewer's comments: + + + + + + +
+
+ +
+ + + + + + + Debian GNU/Linux + + + + + + Name: + + + Debian GNU/Linux + + + + + + Distributor: + + + +
+ Software in the Public Interest, Inc. + PO Box 1326 + Boston, Ma. 02117 USA +
+
+ + + + Net: info@debian.org + WWW: http://www.debian.org/ + FTP: ftp://ftp.debian.org/debian + + + +
+
+ + + Provider's description: + + + + + + + + Debian logo + + + + + + Debian GNU/Linux is the result of a volunteer effort to create a + high-quality non-commercial Linux distribution. Debian GNU/Linux 2.2 + is a complete and fully-functional Unix-compatible operating system + for the personal computer. It contains around 4000 packages, making + it by far the largest free software distribution. + + + + Debian GNU/Linux is available for the IBM PC architecture + (386/486/Pentium), m68k, SPARC, Alpha, PowerPC, and ARM. Ports to + MIPS, HP PA-RISC, IA64 and GNU/Hurd are under way. + + + + Debian GNU/Linux is an easy-to-upgrade distribution that consists of + freely redistributable software from a number of different sources and + systems. Non-free packages may also obtained, making Debian a + well-rounded system. + + + + The benefits of Debian GNU/Linux are its upgradability, well-defined + dependencies between packages, and its open development. It is the + only GNU/Linux distribution that is being developed co-operatively by + many individuals over the Internet, in the same spirit as the Linux kernel and + other open-source operating systems. More than 500 package maintainers + are working on over 5000 packages and improving Debian GNU/Linux. A + sophisticated bug tracking system allows users to easily report bugs + and security concerns which are quickly dealt with by the Debian + community. A command-line tool, 'apt-get', can be used to dynamically + upgrade your system from the large Debian archive network. + + + + Debian GNU/Linux is a very dynamic distribution, although it does prefer + well-tested stability to having the very latest available. Major releases + are generally made about every year, although the Debian archives are + updated daily; and upgrading discrete elements of the system is a common and + supported operation. + + + + For more information about Debian GNU/Linux, please visit our World Wide + Web page at http://www.debian.org/. + There is also a book, Running Debian GNU/Linux, from + O'Reilly & Associates. + + + + If you're interested in joining this project, you are invited to subscribe to + either debian-user@lists.debian.org, or + debian-devel@lists.debian.org by sending a mail to + + debian-user-request@lists.debian.org + (or + + debian-devel-request respectively) + with the word "help" in the subject line. + + + + + + + Internet access: + + + Debian GNU/Linux is available for download via anonymous FTP or HTTP; see + + http://www.debian.org/distrib/ftplist/. + + + + + + Ordering: + + + A number of vendors + can provide CD-ROMs or snapshots. + + + + + + Support: + + + Aside from self-serve support + via mailing lists, IRC, or the online Bug Tracking System, there is also a number + of consultants providing + support. + + + + + + Last freeze date: + + + 5 December 2000 (2.2r2) + + + + + + Entry last modified: + + + 31 January 2001 + + + + + + Reviewer's comments: + + + + + + +
+
+ +
+ + + + + + + Mandrake Linux + + + + + + Name: + + + Mandrake Linux + + + + + + Distributor: + + + +
+ MandrakeSoft + Daniel Morales - MandrakeSoft 818.834.9860 + Caroline Carmagnol - Alizé Public Relations 650.323.1607 + mandrake@linux-mandrake.com +
+
+ + + + Net: + mandrake@linux-mandrake.com (orders) + WWW: + http://www.linux-mandrake.com + Vox: 818.834.9860 + + + +
+
+ + + Provider's description: + + + + + + + + mandrake logo + + + + + + Mandrake is inspired by Red Hat(tm) Linux, with many + improvements and pre-configured applications which make it easier to + use for beginners, and faster for everyone. + + + + Mandrake is available both in GPL Edition and in the PowerPack + Edition which includes 5 CDs and commercial applications. The GPL + Edition CD (base system and applications) is freely available from + the Internet as an iso image. + + + + Mandrake 6.0 won two LinuxWorld Editors' Choice Awards and + was a runner up at LinuxWorld Expo, San Jose, CA in August 1999: + + + + + + + + Best Linux Product of the Year. + + + + + + Best Distribution/Server. + + + + + + finalist for Best Distribution/Client. + + + + + + + + Mandrake 6.1 (Helios) features: + + + + + + + + Linux-Kernel: 2.2.13 (pre4) + + + + + + XFree86: 3.3.5 + + + + + + Glibc: 2.1.1 + + + + + + RPM: 3.0.3 + + + + + + Bash: 2.03 + + + + + + KDE: 1.1.2 (with Mandrake customization) + + + + + + Gnome: built from 1.0.4->1.0.14 versions (with Mandrake + customization) + + + + + + Enlightenment 0.16-dev5, Windowmaker 0.60, AfterStep 1.7.111, + XFCE 3.0.2, IceWM 0.9.48 + + + + + + + + and many applications such as Apache, MySQL etc. + + + + In Mandrake, packages have been compiled with CPU optimizations for + pentium-class (intel, amd, cyrix, winchip...) and higher processors + resulting in speed improvements up to 30%. + + + + + + + Internet access: + + + + http://www.linux-mandrake.com/en/ftp.php3 + + + + + + Ordering: + + + Free download available from Internet. + The Linux-Mandrake PowerPack price is typically between $45 and $50. + Payment method depends on the distributor. + Distributor lists available at: + + http://www.linux-mandrake.com/en/fsinglecd.php3. + + + + + + Support: + + + + The PowerPack is provided with 100 days of support by e-mail. + + + + Several specialized mailing-lists and a USENET newsgroup + (alt.os.linux.mandrake) are available for support + between users. + + + + Bynari Systems Group and LinuxCare also provide complete support + for Mandrake. + + + + + + + Last freeze date: + + + Sep 17, 1999 for Mandrake 6.1 (Helios). + Update frequency: about 4 months. + + + + + + Entry last modified: + + + 18 September 1999 + + + + + + Reviewer's comments: + + + + + + +
+
+ +
+ + + + + + + Red Hat Linux + + + + + + Name: + + + Red Hat Linux + + + + + + Distributor: + + + +
+ Red Hat Software + 3201 Yorktown Rd, Suite 123 DeKalb Center + Durham, NC 27713 +
+
+ + + + Vox: (800) 546-7274 or (919) 572-6500 + Fax: (919) 572-6726 + Net: redhat@redhat.com + WWW: http://www.redhat.com/ + FTP: ftp://ftp.redhat.com + + + +
+
+ + + Provider's description: + + + + + + + + Red Hat logo + + + + + + Red Hat 6.1 is based on the 2.2 kernel and is available for + Intel, Sparc and Alpha platforms. + + + + Four installation innovations make Red Hat the easiest Linux to + install ever. Our graphical installation mode brings you straight + up into X for most of the installation. Our boot disk creation script + eases selection of the proper boot disk, and it saves your existing + network configuration information and XF86Config so you don't have to + configure TCP/IP or X! Our FTP install allows you to install simply + by downloading 3 floppy disk images — the rest is done automatically! + And finally, the installation includes seamless support for PCMCIA + devices — install Red Hat on your laptop as easily as on your + desktop machine! + + + + After installing Red Hat Linux once, you will never need to reinstall + Linux again! The new RPM packaging system is sophisticated enough to + allow upgrading to new Red Hat releases without reinstalling your + system - no partitioning, no backing up all your files, no headaches. + + + + + + + Internet access: + + + + + + + + Ordering: + + + Available directly from Red Hat Software and most distributors + of Linux related products. Please contact Red Hat Software for + ordering details (on-line ordering is available through Red Hat's + Web). Suggested retail price for the Standard version is + $29.95; for the Professional (server) version + $149.95; for the Deluxe version $79.95. + + + + + + Support: + + + + + + + + Last freeze date: + + + Unknown. + + + + + + Entry last modified: + + + 1 Nov 1999. + + + + + + Reviewer's comments: + + + The big selling point of this distribution is RPM, the Red Hat + Package Manager. This piece of software is a remarkable advance; + it allows you to cleanly install and de-install applications and + operating-system components, including the kernel and OS base + itself. RPM is now used as well by essentially all other + distributions except Debian. [esr] + + + + +
+
+ +
+ + + + + + + Slackware Linux + + + + + + Name: + + + Slackware Linux + + + + + + Distributor: + + + +
+ Walnut Creek CDROM + 4041 Pike Lane, Suite D + Concord, CA 94520 +
+
+ + + + Net: info@cdrom.com (information), + order@cdrom.com (orders), + support@cdrom.com (support). + + + +
+
+ + + Provider's description: + + + + + + + + Slackware logo + + + + + + Ftp.cdrom.com is the home of Slackware Linux. We are the publishers + of the Official Slackware Linux CDROM. Our distribution is a 4-disc + set with the current version being Slackware 96. The current disc + is based on the 2.0.34 kernel. + + + + Slackware Linux is a full-featured distribution + of the Linux operating system designed for 386/486 computers with a + 3.5" floppy and CD-ROM drive. + + + + + + + Internet access: + + + + WWW: + http://www.cdrom.com/titles/os/slack96.htm + FTP: + ftp:ftp.cdrom.com/pub/linux/slackware + + + + + + + Ordering: + + + The cost of the CD-ROM set from Walnut Creek is $39.95. + + + + + + Support: + + + + + + + + Last freeze date: + + + July 1998 (3.5) + + + + + + Entry last modified: + + + 13 August 1998. + + + + + + Reviewer's comments: + + + + + + +
+
+ +
+ + + + + + + S.u.S.E. Linux + + + + + + Name: + + + S.u.S.E. Linux + + + + + + Distributor: + + + +
+ S.u.S.E., Inc. + 458 Santa Clara Ave + Oakland CA 94610 USA +
+
+ + + + Net: info@suse.com + WWW: http://www.suse.com/ + FTP: ftp://ftp.suse.com + Vox: +1-510-835-7873 + Fax: +1-510-835-7875 fax + + + +
+
+ + + Provider's description: + + + + + + + + S.u.S.E. logo + + + + + + S.u.S.E. Linux offers users of all levels, from novice to expert, + quick and easy entry into the world of Linux and Unix. Resources such + as a menu-driven installation from CD-ROM, a modular boot diskette, + 400-page reference book and S.u.S.E.'s own system administration + tool YaST, allow one to quickly get Linux installed and running, + and to keep it running smoothly. + + + + Furthermore, S.u.S.E. offers a series of supported X servers, which + support the newest graphics cards. These servers are created in + co-operation with the XFree86 (tm) development team. See the + following url for more details: + http://www.suse.de/XSuSE/. + + + + New in S.u.S.E. Linux 5.3: + + + + + + + + Kernel 2.0.35 + + + + + + KDE 1.0 + + + + + + GIMP 1.0 + + + + + + SaX (SuSE advanced XF86 configuration tool) + + + + + + + + Quick overview of other features: + + + + + + + + The Linux OS, over 875 software packages, including complete + sources and live file system on 4 CD-ROMs + + + + + + 400 page reference book + + + + + + Packages in RPM format; TGZ packages installable + + + + + + System V compatible boot concept, compliance with file + system standard + + + + + + Installation and administration utility 'YaST' configures + network, ISDN, e-mail, printer, X Window System + + + + + + S.u.S.E. X servers which support new graphics cards + + + + + + Administration of file systems, users, groups + + + + + + Automatic configuration of several window managers + + + + + + Online help system and documentation + + + + + + Demo mode, either directly from CD-ROM, or on DOS partition + + + + + + + + + + + + Internet access: + + + + + + + + Ordering: + + + + You can download from + + ftp://ftp.suse.com/pub/SuSE-Linux. + For the CD-ROM with support, order vphone, secure WWW order form, + fax, or post. Price is $49.95, or $34.95 per edition by + subscription. Use order code LSUE520 for the English version, + LSUD520. + + + + Also available: OSF Motif 2.1 for $129.95 (price for update to be + determined; order code: LMEA210 + + + + + + + Support: + + + 60 days of free installation support are included with each + purchase of S.u.S.E. Linux. See the web page for contact info and + conditions. + + + + + + Last freeze date: + + + Unknown. + + + + + + Entry last modified: + + + 13 Aug 1998 (5.3) + + + + + + Reviewer's comments: + + + + + + +
+
+ +
+ +
+ + + + +Other distributions + + + All these distributions are available on CD-ROM (some of the + non-commercial ones only show up on network-archive snapshots). + Most of these are available for free over the network (but the + commercial ones won't support you if you buy this way). They are + custom-assembled, rather than just being re-packagings of a + pre-existing network release. + + + + They are listed in alphabetical order. + + + + + + + + KRUD - Kevin's Red Hat Uber Distribution + + + + + + Name: + + + KRUD + + + + + + Distributor: + + + +
+ tummy.com, ltd + 200A North College Avenue + Fort Collins CO 80524 +
+
+ + + + Net: info@tummy.com + WWW: http://www.tummy.com/krud + FTP: ftp://ftp.tummy.com + Vox: (970)-494-0355 + Fax: (408)-490-2728 + + + + +
+
+ + + Provider's description: + + + + + + + + KRUD logo + + + + + + KRUD is a monthly updated distribution based on Red Hat. + It includes all of the current Red Hat distribution with full errata, + and is available by + subscription or as a single CD. Also included are a variety of + useful packages for Linux, including several security-related + packages such as ssh and isinglass. These additions are + hand-selected by the author of the Linux Security HOWTO. + Requires standard RedHat-compatible hardware. + Currently, KRUD is not for export because it contains crypto software. + + + + + + Internet access: + + + + Available on CD-ROM only because of export restrictions. + + + + http://www.tummy.com/krud/ + + + + + + + Ordering: + + + + KRUD is available on CD. You can purchase a 12 month subscription for $65, a + single issue for $7. Special rates available for subscription renewals. + International shipping available. + + + + + https://www.tummy.com/krud/onlineorder.html (online) + + http://www.tummy.com/krud/mailorder.htm (by mail) + $7/US each + $65/US 12 issue subscription (monthly update). + Visa/Mastercard/Discover/Amex credit cards accepted. + University and large business purchase orders. Postal money orders are + also accepted. + + + + + + + Support: + + + + tummy.com is a full service Linux consulting firm. + KRUD support is available on an hourly or contract basis from tummy.com, + Ltd. Rates start at $150/hour. + + + + KRUD helps you keep up with the flood of errata and package upgrades + by offering a monthly CD-ROM subscription delivered to you at a + reasonable price. + + + + + + + Last freeze date: + + + KRUD is updated monthly. Most recent version is dated 2001-01-01. + + + + + + Entry last modified: + + + 2001-01-30 + + + + + + Reviewer's comments: + + + (coming shortly) + + + + +
+
+ +
+ + + + + + + Linux by Libranet + + + + + + Name: + + + Linux by Libranet + + + + + + Distributor: + + + +
+ Libra Computer Systems Ltd. + 1860 Langworthy Street + North Vancouver, BC + V7K 1N8 +
+
+ + + + Net: sales@libranet.com (orders) + Net: support@libranet.com (support) + Net: faq@libranet.com (faq) + WWW: http://www.libranet.com/ + + + +
+
+ + + Provider's description: + + + + + + + + Libranet logo + + + + + + Based on the Debian distribution, it allows users to start with + an already configured desktop complete with the most commonly used + applications. The simple installation gets the system up and running + easily. This is a major benefit to those new to Linux and a great + time-saver for the experienced. + + + + + + + Internet access: + + + + + + + + + Ordering: + + + Available on CD for intel i386 and higher compatibles. + Order via the web at http://www.libranet.com or fax/mail order + One year free support via email and fax. + + + + + + Support: + + + The Linux by Libranet Desktop brings Debian, traditionally the + choice of developers, to the desktop user. + + + + + + Last freeze date: + + + Updated CD about every 4 months. + + + + + + Entry last modified: + + + 1 November 1999 + + + + + + Reviewer's comments: + + + + + + + +
+
+ +
+ + + + + + + LinuxGT + + + + + + Name: + + + LinuxGT + + + + + + Distributor: + + + +
+ Grey Technology + PMB 205 + 2479 Murphreesboro Rd. + Nashville, TN 37217 +
+
+ + + + Net: rick@greysite.com (orders) + WWW: http://www.greysite.com/ + FTP: + ftp://metalab.unc.edu/pub/Linux/distributions/linuxGT + + + +
+
+ + + Provider's description: + + + + + + + + LinuxGT logo + + + + + + LinuxGT is based in the Linux 2.2 kernel, available for Intel only + at this point, a PPC and SPARC are on the way! With a simple, to + the point installation, we believe it is the easiest to get running + server solutions available today! Creating a boot disk is a simple + click of a button (from Windows), or running a simple script + (DOS/Linux). Other installation methods are via ftp, http, NFS, or + from your existing hard disk partition. By following the steps in + the QuickStart Guide, you can't go wrong, most people won't NEED + the Guide if they have ANY familiarity with Linux. Further product + information can be found at our website (http://www.greysite.com) + or via e-mail. + + + + + + + Internet access: + + + + + + + + + Ordering: + + + Available through Grey Technologies, GT Partners, and Distribution + Vendors. Please contact Grey Technology for ordering details + (on-line ordering is available through GreySite.Com). Suggested + retail price is for the Intel Server version is $dollar;24.95. Other + platforms will be priced at time of availability. + + + + + + Support: + + + Technical support is available via telephone, e-mail, chatroom, or + online Web Forum. + + + + + + Last freeze date: + + + 24 Jun 1999 + + + + + + Entry last modified: + + + 24 Jun 1999 + + + + + + Reviewer's comments: + + + + + + + +
+
+ +
+ + + + + + + Linux Pro + + + + + + Name: + + + Linux Pro + + + + + + Distributor: + + + +
+ WorkGroup Solutions, Inc. + P.O. Box 460190 + Aurora, CO 80046-0190 +
+
+ + + + Vox: (303)-699-7470 + Fax: (303)-699-2793 + Net: info@wgs.com (orders) + FTP: ftp://ftp.wgs.com/pub2/wgs + + + +
+
+ + + Provider's description: + + + + + + + + Linux PRO logo + + + + + + The charter of the WGS Linux Pro CD is different from all other + distributions currently on the market. We are actively + pursuing penetration into the commercial marketplace for Linux. + Everything we do is aimed at increasing the size of the Linux + community, and helping Linux to become THE one true operating + system, not just an operating system. + + + + WGS Linux Pro consists of our Main "Stable" Linux CD, for which + we select what we consider to be the best Linux distribution + available. Then we make bug fixes & minor enhancements. This + CD often contains software older than the latest, under the theory + that "the latest is not always the greatest". Together with this + approach we provide technical support as well as support agreements. + For this reason WGS Linux Pro is considered a primary Linux + distribution. Optionally, and in addition to our primary CD, we + supply supplemental CDs containing all the latest Linux software + (including current archives of the tsx-11, metalab, and Red Hat + sites). Virtually anything you will get with anyone's Linux + product can be found on these supplemental CDs. We continually add + more to these supplemental CDs as software becomes available. Even + with all this, pricing on our product line is very favorable when + correctly compared to other Linux distributions. Also optional + (included with Linux Pro+) is a professionally produced and printed + manual containing the Linux documentation project and more! + + + + Current version is 4.0a; kernel is 1.2.13 with installable 2.0.x + on the CD. + + + + + + + Internet access: + + + Look in + http://www.wgs.com/ + for a list of WGS products, and latest information on the CD-ROM. + + + + + + Ordering: + + + + WGS Linux Pro is available on CD from dealers and distributors + worldwide, and soon from our FTP site. + + + + You may call, fax, email, or mail us, to purchase, or request + additional information. We will be happy to respond to any + question you have. We accept American Express, Visa, Discover, and + MasterCard, or purchase orders with approval of credit. + + + + + + + Support: + + + + Complete information is available on our FTP site. + + + + WGS publishes a free E-Mail newsletter on Linux and FlagShip + to which you may subscribe by just emailing us your request. + + + + In addition we carry Motif, FlagShip, A line of books, and + other products to make your experience with Linux more complete + and fulfilling. Check us out! + + + + + + Last freeze date: + + + 1 October 1996. + + + + + + Entry last modified: + + + 13 March 1997 + + + + + + Reviewer's comments: + + + They describe their current distribution as "Red Hat 3.03 plus". + + + + +
+
+ +
+ + + + + + + Trans-Ameritech Linuxware + + + + + + Name: + + + Linuxware + + + + + + Distributor: + + + +
+ Trans-Ameritech + 2342A Walsh Avenue + Santa Clara, CA 95051 +
+
+ + + + Net: info@trans-am.com + WWW: http://www.trans-am.com + Vox: (408)-727-3883 + Fax: (408)-727-3882 + BBS: (408)-980-9840 + + + +
+
+ + + Provider's description: + + + + + + + + + Linuxware logo + + + + + + Trans-Ameritech has published 10 releases of Linux by early 1997. + Traditionally, Trans-Ameritech has set new standards for combining + ease of use and straightforward installation, even for a first-time + user, with its line of LinuxWare CD-ROMs. This is a flexible, + easy-to-install operating system geared toward those interested in + learning Unix as well as technical people, students and home PC + users. + + + + + + + + New Linux users will appreciate a Windows-based set up + program from the CD. + + + + + + To minimize the possibility of hardware conflicts many extra + kernels are provided for different configurations. They are usable + for installation and normal operation. + + + + + + Many on-line documents are provided for quick reference, + including the Linux Documentation Project files in source, dvi and + ps formats. + + + + + + + + Many applications are included: + + + + + + + + MS-Windows based X configuration program + + + + + + C/C++,Pascal and Ada compilers as well as converters fron + Fortran + + + + + + TCP/IP networking, UUCP, SLIP, CSLIP, PPP + + + + + + Internet access with binaries and sources for + FTP, Telnet, News and E-mail + + + + + + Multiple terminals and X-Windows environment + + + + + + Gnu and international versions of the ispell spell-checker + + + + + + The communications apps: term, minicom, Seyon (X-Windows based) + + + + + + Editors: elvis (vi clone), joe, jove, Emacs + + + + + + PostScript clone ghostscript + + + + + + Object oriented GNU Smalltalk and the Smalltalk interface to X + + + + + + TCL/Tk (Powerful scripting language with Motif-like X interface) + + + + + + Programs for electrical engineers and ham enthusiasts + + + + + + Interviews libraries,include files and doc Word-processor + and idraw drawing program + + + + + + Typesetting: TeX, LaTeX, xdvi, dvips, Metafont, groff + + + + + + Andrew multimedia word processor with hyperlinks + + + + + + FAX send and receive on either class 1 or class 2 fax modems + + + + + + DOOM for game enthusiasts + + + + + + + + All the sources are available on the CD-ROM. The often needed + sources are uncompressed and can be used directly from the CD-ROM. + + + + An uncompressed Linux filesystem is available for references and + disk space conversaion. You can run programs directly from the + CD-ROM! There is a large info directory for on-line reference and + many manpages. + + + + For hacker's reference, uncompressed FreeBSD and netBSD sources are + provided. + + + + Our distribution is targeted for Windows and DOS users who want an easy + migration path upwards, rather than for UNIX experts. + + + + + + + Internet access: + + + + + + + + + Ordering: + + + + Email orders are taken at order@trans-am.com + + + + The price for our current release of LinuxWare 2.5 is $19.95 + + + + The price for a package order: LinuxWare 2.5,Supplement 5 and + Supplement 4 (Ultimate LinuxWare Bundle) in one shipment is $30 + + + + If you order with a credit card (VISA, MC, AmEx, Discovery), + please, indicate the card number, expiration date and your mailing + address. + + + + Shipping and handling in US: single CD-ROM or Ultimate LinuxWare + Bundle is $5(first class US mail). + + + + Overseas shipping is $8 for single CD-ROM , $12 for + the bundle. + + + + COD is available in the US only for $4.50. + California residents, please add 7.75% sales tax. + + + + Annual subscription (4 releases) is available for $80 plus + S&H (note: there are 4 shipments in a subscription). Example: + subscription in US is:$80+$5x4=$100. + Subscription in Europe/Japan etc. $80 + $8x4 = + $112. + + + + + + + Support: + + + If you have any further questions,please contact us through E-mail: + info@trans-am.com or order@trans-am.com. + + + + + + Last freeze date: + + + January 1997 (Supplement 5) + + + + + + Entry last modified: + + + 13 August 1998 + + + + + + Reviewer's comments: + + + + + + + +
+
+ +
+ + + + + + + Turbo Linux + + + + + + Name: + + + Turbo Linux + + + + + + Distributor: + + + +
+ TurboLinux, Inc. + 2000 Sierra Point Parkway + Suite 401 + Brisbane, CA 94005 +
+
+ + + + Net: info@turbolinux.com (orders) + WWW: http://www.turbolinux.com/ + FTP: ftp://ftp.turbolinux.com/ + Vox: (650)-244-7777 + Fax: 650-244-7766 + + + +
+
+ + + Provider's description: + + + + + + + + + Turbo Linux logo + + + + + + TurboLinux makes a suite of high-performance Linux products for the + workstation and server markets. Our products are available from our + Web site, at more than 3,000 retail stores in North America and + from our value-added reseller partners around the world. Our products: + + + + + + + Workstation 6.0 + + + TurboLinux Workstation 6.0 is your high-performance choice for + Linux on the desktop. The powerful office productivity suite + StarOffice gives you full Microsoft Office compatibility and + Netscape gets you quickly online for e-mail and Web surfing. + + + + + + Server 6.0 + + + TurboLinux Server 6.0, completely re-engineered as a secure, + high-performance backend server for business workgroups in the + enterprise, now includes robust e-commerce software for + business-to-business transactions. + + + + + + TurboCluster Server 4.0 + + + Build affordable, scalable and available server clusters (25+ + cluster nodes!) with TurboCluster Server 4.0, voted Best Web + Solution by the editors of Linux Journal. TurboCluster Server, + also named Corporate IT Best Product winner for enterprise-class + customers at the IT 2000 Sydney computer show, integrates + seamlessly into your existing IT environment to cluster Solaris and + Windows NT server nodes as well as Linux.. + + + + + + enFuzion 6.0> + + + Turn your existing network into a supercomputer! Based on a simple + but powerful concept called parametric execution, enFuzion turns + your existing computer network into a high speed, fault tolerant, + highly available supercomputer. + + + + + + + + + + + + Internet access: + + + + + + + + + Ordering: + + + See + http://www.turbolinux.com/products/ + TurboLinux is also offered in retail stores and many online stores. + + + + + + Support: + + + + + + + + + + Last freeze date: + + + + Workstation 6.0 - January 3. + Server 6.0 - January 3. + TurboCluster Server - October 4. + + + + Estimated update frequency can vary from 2 weeks to 3 months + depending on the product. + + + + + + + Entry last modified: + + + 22 Mar 2000. + + + + + + Reviewer's comments: + + + + + + + +
+
+ +
+ + + + + + + xxxxx Linux + + + + + + Name: + + + xxxxx Linux + + + + + + Distributor: + + + +
+ xxxxxxxxxxx + xxxxxxxxxxx + xxxxxxxxxxx +
+
+ + + + Net: info@xxx.com + WWW: http://www.xxx.com + FTP: ftp://ftp.xxx.com + Vox: (000)-000-1234 + Fax: (000)-000-1234 + + + +
+
+ + + Provider's description: + + + + + + + + xxxxx Linux logo + + + + + + + + + + + + Internet access: + + + + + + + + + Ordering: + + + + + + + + + + Support: + + + + + + + + + + Last freeze date: + + + + + + + + + Entry last modified: + + + + + + + + + Reviewer's comments: + + + + + + + +
+
+ +
+ + + +
+ + + + + +Hall of Remembrance + + + The distributions listed in this section are no longer maintained. + They are included here for historical reasons, and for those who may + be attempting to locate information about the distribution. + + + + They are listed in alphabetical order. + + + + + + + + Corel Linux + + + + + + Name: + + + Corel Linux + + + + + + Distributor: + + + +
+ xxxxxxxxxxx + xxxxxxxxxxx + xxxxxxxxxxx +
+
+ + + + Net: info@xxx.com + WWW: http://www.xxx.com + FTP: ftp://ftp.xxx.com + Vox: (000)-000-1234 + Fax: (000)-000-1234 + + + +
+
+ + + Provider's description: + + + + + + + + Corel logo + + + + + + + + + + + + Internet access: + + + + + + + + + Ordering: + + + + + + + + + + Support: + + + + + + + + + + Last freeze date: + + + + + + + + + Entry last modified: + + + + + + + + + Reviewer's comments: + + + + + + + +
+
+ +
+ + +
+ + + + +Submissions for inclusion in this document + + + We encourage anyone and everyone who maintains a Linux distribution + or mail order service, to submit information on their service to + this document. It's easy and fun, and it's free advertising. This + document is posted to many places and is archived (see the next + section). + + + + + + Types of submissions + + + We are interested in submissions for: + + + + + + + + Complete distributions + of GNU/Linux software available on CD-ROM. + (We no longer carry FTP-only distributions, as this document is + aimed primarily at new users for whom such a means of distribution + is not appropriate.) + By `complete distribution' we mean any set of software which can be + used to build a complete GNU/Linux system from scratch. + + + + + + Layered products or individual software + packages available only via + mail order. If your software package is available via + anonymous FTP, chances are people can find it. Software products + only available via mail-order include commercial things such as + Motif, and any other commercial software ported to Linux. + + + + + + Any other Linux-specific goods + available via mail order, + such as Linux-specific books and documentation, T-shirts, and + assorted paraphernalia. Note: our interest in the latter + categories is marginal — this is a Linux Distributions HOWTO, + not a catalogue of cutesy Linux junk. Whatever you're + selling will have to be (a) very useful, (b) very original, or + (c) very funny, to get listed here. + + + + + + + + If the number of submissions for services and layered products + is large, we'll create a separate document for these items. + + + + + + + + How to submit + + + To submit an entry to this document, please send mail to + + msw@startext.co.uk + with the following information. This + format is not machine-parsable; any of the fields may be any + length that you wish, but I'd like to keep each entry down to, + say, 50 lines. + + + + + + + Name: + + + - name of service or distribution + + + + + + Distributor: + + + - name of company, person, etc. who distributes/maintains + the service or distribution. Should include mail, e-mail, + phone contact information, and (if possible) a WWW reference. + + + + + + Provider's description: + + + - description of the distribution or service + that you provide. If this is a software distribution, please include + information such as what software is included, versions, general + overview of installation, requirements, and so on. + + + + + + Internet access: + + + - where your service or distribution is + available over the Internet; typically a WWW or FTP address. + + + + + + Ordering: + + + - how to order your distribution or service, if + applicable. Include prices, shipping information, methods of + payment, etc. + + + + + + Support: + + + - information on support terms and support contracts. + + + + + + Last freeze date: + + + - last freeze date of the current version(s). Also, your estimated + update frequency. + + + + + + Entry last modified: + + + - date of submission of this entry. + + + + + + Reviewer's comments: + + + - independent reviewer's comments. + + + + + + + + + + + + + Submission guidelines + + + Please keep your entry as short as possible. If you need to include + extensive information, please make a reference to where one can FTP + or mail to get more information on your distribution; these entries + are only meant to be pointers to where one can + find information on your service or distribution. + + + + If you provide more than one service or distribution, please use + separate entries for each. + + + + We may edit your entries for conciseness and brevity if we find + any irrelevant information, or if the entry is overly verbose. + Otherwise the content should remain the same. + + + + When making submissions to this document, you grant implicit + permission for the LDP to use the entries in other materials, such as + printed books, or further online documents. For example, information + taken from this document may be included in a published Linux book. + If you do not want us to include + your entry in materials other than the current online document, please say so. + + + + + + + + + +Administrivia + + + + + Terms of use + + + This document is copyright 2001 by Martin S. Wheeler. You may use, + disseminate, and reproduce it freely, provided you: + + + + + + + + do not omit or alter this copyright notice. + + + + + + do not omit or alter the version number and date. + + + + + + do not omit or alter the document's pointer to the current WWW version. + + + + + + clearly mark any condensed, or altered versions as such. + + + + + + + + These restrictions are intended to protect potential readers from + stale or mangled versions. If you think you have a good case for + an exception, ask me. + + + + + + + + Acknowledgements + + + This document was originated by Bill Riemers. + Matt Welsh + maintained the second version. Erik Troan + then maintained the document to release 3.0. + + + + In January 1995, Eric Raymond, + while unaware of the existence of + this document, began to develop a similar FAQ in the format + of his not-quite-yet-discontinued PC-clone UNIX Software Buyer's + Guide, which covered mainly System V UNIXes and BSD/OS. + (This Buyer's Guide should still be available on Eric's site somewhere, if he + has not yet turned it into a useful HOWTO.) + + + + In March 1995, Eric approached Erik about cooperating on a merged + version. In early April 1995, Erik went to work for Red Hat + Software, and (wishing to avoid a conflict of interest) handed the + document to Eric. Eric merged in a lot of new information and + added several new fields to the distribution entries, taking the + document through releases 4, 5 and 6. + + + + In January 2001, Martin Wheeler took + over editorship of the document, + which with the enormous expansion in numbers of distributions available, + had become extremely time-consuming to maintain, and which Eric had decided to + abandon. + + + + Accordingly, this document is the result of serial collaboration. + The editorial `we' generally tags observations by all the + maintainers; `I' is Martin (the current editor/maintainer) speaking. + + + + We are delighted to acknowledge the contributions of all the + Linux users and Internet hackers who have contributed information + and feedback. + + + + + Martin Wheeler + Glastonbury + January 2001 + + + + + + + + +
diff --git a/LDP/retired/Distributions-HOWTO/caldera.gif b/LDP/retired/Distributions-HOWTO/caldera.gif new file mode 100755 index 00000000..9d39c053 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/caldera.gif differ diff --git a/LDP/retired/Distributions-HOWTO/corel.gif b/LDP/retired/Distributions-HOWTO/corel.gif new file mode 100755 index 00000000..69162ef8 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/corel.gif differ diff --git a/LDP/retired/Distributions-HOWTO/debian.jpg b/LDP/retired/Distributions-HOWTO/debian.jpg new file mode 100755 index 00000000..dacff173 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/debian.jpg differ diff --git a/LDP/retired/Distributions-HOWTO/krudlogo.jpg b/LDP/retired/Distributions-HOWTO/krudlogo.jpg new file mode 100755 index 00000000..af4c343b Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/krudlogo.jpg differ diff --git a/LDP/retired/Distributions-HOWTO/libranet.gif b/LDP/retired/Distributions-HOWTO/libranet.gif new file mode 100755 index 00000000..abdfe6a7 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/libranet.gif differ diff --git a/LDP/retired/Distributions-HOWTO/linuxpro.gif b/LDP/retired/Distributions-HOWTO/linuxpro.gif new file mode 100755 index 00000000..a78b08f8 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/linuxpro.gif differ diff --git a/LDP/retired/Distributions-HOWTO/mandrake.gif b/LDP/retired/Distributions-HOWTO/mandrake.gif new file mode 100755 index 00000000..5260ae56 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/mandrake.gif differ diff --git a/LDP/retired/Distributions-HOWTO/redhat.gif b/LDP/retired/Distributions-HOWTO/redhat.gif new file mode 100755 index 00000000..08658a73 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/redhat.gif differ diff --git a/LDP/retired/Distributions-HOWTO/slackbutton2.jpg b/LDP/retired/Distributions-HOWTO/slackbutton2.jpg new file mode 100755 index 00000000..c8d3bc02 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/slackbutton2.jpg differ diff --git a/LDP/retired/Distributions-HOWTO/suse_logo.gif b/LDP/retired/Distributions-HOWTO/suse_logo.gif new file mode 100755 index 00000000..bcf02c46 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/suse_logo.gif differ diff --git a/LDP/retired/Distributions-HOWTO/turbologo.gif b/LDP/retired/Distributions-HOWTO/turbologo.gif new file mode 100755 index 00000000..5dd55554 Binary files /dev/null and b/LDP/retired/Distributions-HOWTO/turbologo.gif differ diff --git a/LDP/retired/Ext2fs-Undeletion-Dir-Struct.sgml b/LDP/retired/Ext2fs-Undeletion-Dir-Struct.sgml new file mode 100644 index 00000000..eb53a709 --- /dev/null +++ b/LDP/retired/Ext2fs-Undeletion-Dir-Struct.sgml @@ -0,0 +1,881 @@ + + +
+ Ext2fs Undeletion of Directory Structures mini-HOWTO + + + + + + Tomas + Ericsson + +
+ tomase@matematik.su.se +
+
+ +
+ + + + + v0.1.1 + 14 November 2000 + T.E. + Initial release. + + + + + + + + This document is supposed to be as an complementary to the + Ext2fs-Undeletion mini-HOWTO written by + Aaron Crane. I really recommend you to carefully study that one before + reading this. + + + + Here I will describe a straight forward way of recovering whole + directory structures, instead of file by file, that have been removed + by a misplaced rm -rf. + + + + +
+ + + + + + Introduction + + + Disclaimer + + + The author is not responsible for damages due actions taken based on + this document. You will do everything at your own risk. + + + + + + License + + + This document may be distributed only subject to the terms and + conditions set forth in the LDP license available at + + http://www.linuxdoc.org/manifesto.html + + + + + + + Feedback + + + Any kind of feedback is welcome. Corrections of errors in this text are + of great interest. If someone find things described here useful I really + would appreciate to hear that from you. + + + + + + New versions of this document + + + The latest version of this document will be found at + + http://www.matematik.su.se/~tomase/ext2fs-undeletion/ + + + + + + Acknowledgements + + + Thanks to the following persons for correctures etc (in alphabetic + order). + + + + Gabriel Kihlman + Richard Nyberg + Mats Oldin + Tobias Westerblom + + + + + + Background + + + This text has been written while solving my own undeletion problems that + I had some time ago. I was about to move some directories from one disk + to another. The problem was that the extra disk went corrupted directly + after the move for some reason. + + + + So I wanted to get the moved directories back from my original disk. + There were totally about 40000 files to recover and I did not feel very + much like to search and rename each one of them by hand. + + + + I wanted to get back the whole structure of directories. The same + situation would have appeared if I had made an + rm -rf to those directories. + + + + + + + + + + + Preconditions + + + It is really important that you unmount the affected partition immediately + before doing anything else with it. If you have copied around some files + in this partition after the accident, then the chance for this method to + work has lowered a lot. + + + + Also you must have a quite new kernel, because the + 2.0.x and below zeroes indirect blocks, which will + not make this process to work for files with more than 12 blocks of data. + + + + I will describe one method of recovery and I will not leave out much for + error handling. If you suspect that some step described below went wrong, + I do not recommend you to go any further. + + + + + + + + + Preparation + + + Unmount the partition where you got your deleted files at. I will denote + that partition with /dev/hdx1. + + + + + # umount /dev/hdx1 + + + + Check the size in blocks of /dev/hdx1. + + + + + # fdisk -l /dev/hdx + + + + Now you need to have an extra partition of the same size as + /dev/hdx1, to be able to act safely. Suppose that you + have an empty harddrive located at /dev/hdy. + + + + + # fdisk /dev/hdy + + + + Create a partition with the same size as /dev/hdx1. + Here size is the size in blocks (each block is + 1024 kB) of /dev/hdx1 taken from above. + + + + + I am using fdisk version 2.10f + and if you have another version the fdisk + interaction below may not be the same. + + + + + + fdisk: n <- Add a new partition. + fdisk: p <- Primary partition. + fdisk: <- Just press return to chose the default first cylinder. + fdisk: +sizeK <- Make a partition of the same size as /dev/hdx1. + fdisk: w <- Write table to disk and exit. + + + + Now copy the content of the original partition to that extra one. + + + + + # dd if=/dev/hdx1 of=/dev/hdy1 bs=1k + + + + This process may take quite a long time dependent of how big the partition + is. You can get the job done faster by increasing the blocksize, + bs, but then you need to get the division of the + partition by bs to have a remainder of zero. + + + + From now on we will only work with that copy of the source partition to + be able to step back if something goes wrong. + + + + + + + + + Finding inodes for deleted directories + + + We will try to find out the inode numbers of the deleted directories. + + + + + # debugfs /dev/hdy1 + + + + Walk to that place in the structure where the directories were located + before the deletion. You can use ls and + cd inside debugfs. + + + + + debugfs: ls -l + + + + Example of output from the above command. + + + + + 179289 20600 0 0 0 17-Feb-100 18:26 file-1 + 918209 40700 500 500 4096 16-Jan-100 15:18 file-2 + 160321 41777 0 0 4096 3-Jun-100 06:13 file-3 + 177275 60660 0 6 0 5-May-98 22:32 file-4 + 229380 100600 500 500 89891 19-Dec-99 15:40 file-5 + 213379 120777 0 0 17 16-Jan-100 14:24 file-6 + + + + Description of the fields. + + + + + + + Inode number. + + + + + + + First two (or one) numbers represents the kind of inode we got: + + + 2 = Character device + 4 = Directory + 6 = Block device + 10 = Regular file + 12 = Symbolic link + + + Last four numbers are the usual Unix rights. + + + + + + + Owner in number representation. + + + + + + Group in number representation. + + + + + + Size in bytes. + + + + + + Date (Here we can see the Y2K bug =)). + + + + + + Time. + + + + + + Filename. + + + + + + + Now dump the mother directory to disk. Here inode is + the corresponding inode number (do not forget the '<' and '>'). + + + + + debugfs: dump <inode> debugfs-dump + + + + Get out of debugfs. + + + + + debugfs: quit + + + + + + + + + Analyse of directory dump + + + View the dumped inode in a readable format. + + + + + # xxd debugfs-dump | less + + + + Every entry consist of five fields. For the first two fields the bytes + representing the field comes in backward order. That means the first byte + is the least significant. + + + + Description of the fields. + + + + + + + Four bytes - Inode number. + + + + + + Two bytes - Directory entry length. + + + + + + One byte - Filename length (1-255). + + + + + + + One byte - File type (0-7). + + + 0 = Unknown + 1 = Regular file + 2 = Directory + 3 = Character device + 4 = Block device + 5 = FIFO + 6 = SOCK + 7 = Symbolic link + + + + + + Filename (1-255 characters). + + + + + + + If an entry in the directory is to be deleted, then the second field at + the entry before will be increased by the value of the deleted entrys + second field. + + + + If a filename is renamed to a shorter one, then the third field will be + decreased. + + + + The first entry you will see is the directory itself, represented by a + dot. + + + + Suppose that we have the following directory entry. + + + + + c1 02 0e 00 40 00 05 01 'u' 't' 'i' 'l' 's' + + + + Then the inode would be e02c1 in hexadecimal representation or 918209 in + decimal. The next entry would be located after 64 bytes (40 in hex). We + see that the filename consist of 5 bytes ("utils") and the file type (01) + is a regular file. + + + + Now recalculate the directories inode numbers in decimal representation. + + + + If you do not like to calculate this by hand I have made a small program + in C that will do this for you. The program takes as input a directory + dump (created by debugfs as described in + ). The output (at stdout) consist of each entrys + inode number and filename. + + + + Before you run the program you need to load the dump into a hexeditor and + change the directory entry length field at the entry + before the one you want to get back. But it is simple. If we name the + field before to x and the field at the entry you want + to get back to y. Then change x + to x - y. + + + + The program called e2dirana (ext2fs directory + analyse) can be found at + + http://www.matematik.su.se/~tomase/ext2fs-undeletion/ + + + + + + + + + Locating deleted inodes + + + Get a list of all deleted inodes. + + + + + # echo lsdel | debugfs /dev/hdy1 > lsdel.out + + + + One problem here is that debugfs will not give the + inode numbers to files that are zero in size (you probably have some in + your /etc directory for instance). I will tell how to solve this problem + in and . + + + + Load "lsdel.out" into a texteditor. The list of inodes should be sorted in + time. Try to remember exactly what time you did that + rm -rf. Probably it was the the last items you + deleted and then they will be located at the bottom of the list, because it + is sorted in time. Delete all lines that has nothing of interest. Save as + "lsdel.out-selected". + + + + Now we will cut away everything except the inodes. + + + + + # cut -b 1-8 lsdel.out-selected | tr -d " " > inodes + + + + To be sure, check that the deleted directories found above have their + inodes in the list. + + + + + # grep ^inode$ inodes + + + + Where inode is the corresponding inode number. + + + + + + + + + Activating inodes + + + Now it is time for changing some flags of the deleted inodes. + + + + Copy the following 6 lines into a file named "make-debugfs-input". + + + + + #!/bin/sh + awk '{ print "mi <" $1 ">\n"\ + "\n\n\n\n\n\n\n"\ + "0\n"\ + "1\n"\ + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" }' + + + + This will simulate the user input when editing the inodes manually. + We will set deletion time to 0 + and link count to 1. + + + + + I am using debugfs version 1.18 and if you have + another version you should check if you need to adjust the number of + returns above. + + + + + Now change the inodes. + + + + + # ./make-debugfs-input < inodes | debugfs -w /dev/hdy1 | tail -c 40 + + + + If all went well it should end with "Triple Indirect Block [0] debugfs:". + + + + + + + + + Adding directory entries + + + Start up debugfs in read-write mode. + + + + + # debugfs -w /dev/hdy1 + + + + Now you should add the deleted directories to the directory were they were + located before deletion. + + + + + debugfs: link <inode> directoryname + + + + Where inode is the inode number and + directoryname is the directoryname. + + + + After you have added the links you will notice that the directories have + popped up in the current directory. You can now list their contents (from + debugfs). + + + + But the size shown for each directory is zero and that need to be fixed, + otherwise they will look empty with ls from the + shell. + + + + Get out of debugfs. + + + + + debugfs: quit + + + + + + + + + Recalculation + + + Now it is time to call e2fsck to recalculate the + sizes and checksums. + + + + + I am using e2fsck version 1.18 and if you have + another version you should check if some parameters or interaction have + changed. + + + + + If you know that you do not have any files with the + size of zero that you want to recover you can do the following and skip + the rest of this section (Of course you can leave out the + y parameter, but then you need to answer all + questions by hand and it may take a lot of time.). + + + + + # e2fsck -f -y /dev/hdy1 > e2fsck.out 2>&1 + + + + If you instead want the zero files back you have to answer + no to all questions about clearing entries and + yes to the other ones. + + + + Copy the following 7 lines into a file named "e2fsck-wrapper". + + + + + #!/usr/bin/expect -f + set timeout -1 + spawn /sbin/e2fsck -f $argv + expect { + "Clear<y>? " { send "n" ; exp_continue } + "<y>? " { send "y" ; exp_continue } + } + + + + Run the script. + + + + + # ./e2fsck-wrapper /dev/hdy1 > e2fsck.out 2>&1 + + + + Examine "e2fsck.out" to see what e2fsck thought about + your partition. + + + + + + + + + If /lost+found not empty + + + Some of the directory and files may not pop-up at their right places. + Instead they will be located in /lost+found with names after their inode + numbers. + + + + In this case the pointer at the ".." directory entry probably have been + increased and will point to one of the later entrys in the directory (of + some reason I do not know, maybe it is a fs bug). + + + + Examine pass 3 (where directory connectivity is + checked) of "e2fsck.out". There you will find which directories that are + affected. Dump those to disk (as described in ). + + + + Run + + e2dirana + both with and without the p parameter (it changes the + pointer at the ".." directory entry). Here dump is + the dumped directory. + + + + + # e2dirana dump > dump1 + # e2dirana -p dump > dump2 + + + + Compare the outputs. + + + + + # diff dump1 dump2 + + + + If they are not the same there are missing files in that directory. Then + move those files from /lost+found to their right place. Here + dest is a symbolic link to the destination directory. + Put the output in a script and run it if you agree. + + + + + # diff dump1 dump2 |\ + tail -n $[`diff dump1 dump2 | wc -l`-1] | cut -b 3- |\ + sed -e 's/^\([^ ]*\) \(.*\)$/mv lost+found\/#\1 dest\/"\2"/' |\ + sed -e 's/!/"\\\!"/g' + + + + Repeat all this until /lost+found is empty. + + + + + + + + + Final touch + + + If in you choosed to get files with the size of + zero back you now have a problem, because those files has a non-zero + deletion time and their link count is zero. That means that every time + e2fsck is running it will prompt to remove (clear) + those files. + + + + The easy way to solve this is to copy the whole directory structure to + another place (it can be the same partition) and then delete the old + directory structure. Otherwise you will have to locate those inodes and + change them with debugfs. + + + + Now if everything have went well, things should have been restored to its + original state before deletion. At least it did for me and in those tests + I have made while writing this. Be sure that you have brought up to the + preconditions described in . + + + + + + + + + References + + + Linux Ext2fs Undeletion mini-HOWTO, v1.3 + + + + Aaron Crane + + + + Design and Implementation of the Second Extended Filesystem, + + http://e2fsprogs.sourceforge.net/ext2intro.html + + + + Rémy Card, Laboratoire MASI--Institut Blaise Pascal + Theodore Ts'o, Massachussets Institute of Technology + Stephen Tweedie, University of Edinburgh + + + + Kernel Source for Linux 2.2.16 + + + + linux/include/linux/ext2_fs.h + linux/fs/ext2/namei.c + + + + +
diff --git a/LDP/retired/FDU.sgml b/LDP/retired/FDU.sgml new file mode 100644 index 00000000..92146abf --- /dev/null +++ b/LDP/retired/FDU.sgml @@ -0,0 +1,4307 @@ + + +
+ + + +XFree86 Font De-uglification HOWTO + + + + Hal + Burgiss + +
+ hal@foobox.net +
+
+
+ +
+ + + +v2.04c, 30 October 2002 + + + + + + Font + + + TrueType + + + xfs + + + xfsft + + + XFree + + + X Windows + + + xfstt + + + freetype + + + Netscape + + + Mozilla + + + legible + + + Anti Aliasing + + + XftConfig + + + + + + + How to improve X Window fonts. Various tips for improving font handling for + XFree86, including sections on font servers, TrueType fonts, Mozilla, and + related topics. + + + + + + +Modify 'New Versions Section'!!!!!!!!!!!!!!!! +Remove my xfs!!!!!!!!!!!!!! + + aspell -H -c FDU.sgml + submit@linuxdoc.org + http://feenix.burgiss.net/ldp/fdu/FDU.sgml.gz +================================================= +ToDo + RENDER not required for Xft2!!! + +Changes 2.04: + TrueType hinting + http://www.xfree86.org/current/fonts.html (julius) + http://www.theregister.co.uk/content/4/27788.html (TT / freetype) + + +Mike Harris: + + +Xft1 (1.1), included with XFree86 stock sources uses XftConfig. +Keith Packard took the Xft1 library, enhanced it to use +fontconfig instead of XftConfig, removed the XftConfig baggage, +and released it as Xft 1.2 - a drop in replacement for Xft 1.x +for XFree86 4.2.0. So, what you get in Red Hat Linux 8.0, is the +Xft 1.1 library is gone, now replaced with Keith Packard's +official Xft 1.2 library which uses fontconfig. This allows Xft +to use one configuration file - /etc/fonts/fonts.conf, and +/etc/X11/XftConfig is now obsolete, and gone. Xft2 is a separate +RPM (Xft) because it was much easier to have it a separate RPM +package to update it quickly and easily without updating XFree86 +packages every snapshot, as it was in development during Red Hat +Linux development. Having it separate made it ultra simple to +update, and makes no difference to the end user. + + +Correct. Xft1 development is intentionally not supported, as +Xft1 is considered legacy now. Qt is the main thing that used +Xft1, very few other things ever used it, and Qt now uses Xft2. +Supporting Xft1 for development when so few apps use it, is a +waste of time, and only holds back the widespread adoption of +Xft2. Xft2 is a significant improvement over Xft1, so the hope is +that any interesting applications will be ported to Xft2 properly +by their authors. Existing apps using Xft1 should run ok in 8.0 +since the fontconfigized Xft1 makes configuration centralized, +while allowing precompiled Xft1 apps to continue to work. 1 such +app is xterm. 8.0 is a major new release, so ditching legacy +stuff, especially which not a lot of things use anyway is a good +time to do it. This will again as I said, put a fire under +everyone out there to port there Xft1 stuff to Xft2. + +[more] + + +There are two font subsystems, the old one is 15-20 years old and +is referred to as "core X fonts"; these are classic X Window System +fonts. To install new fonts for this, instructions should be easy to +google up, it involves putting the fonts in a system directory and +running ttmkfdir and restarting the "xfs" font server. Core X fonts +have these properties: + + - they are server-side, handled by the X server and xfs + - they are always monochrome (not antialiased) + - they have annoying names like "-urw-nimbus roman no9 l-medium-i-normal--0-0-0-0-p-0-iso8859-1" + +The new font subsystem is being phased in to replace it. The new one +is called "fontconfig/Xft2" where fontconfig is the part that parses +/etc/fonts/fonts.conf and scans your ~/.fonts and /usr/share/fonts +directories, and Xft2 is the part that draws fonts on the screen. + + + - these fonts are client-side, handled by the application + - they can be used for printing etc. in addition to + display on the screen + - they can be rendered antialiased or not, as in Preferences->Fonts + rendering tweaks + - they have sane names like "Nimbus Sans" + +So anyhow, we are currently in a transition period. Some applications, +namely those using Qt 3 or GTK 2, use the new system. Other +applications, most of the rest, use the old system. You have to +install the fonts once for each system. + +Over time (for the most part we hope by the next release), everything +will move to the new system. + +(Someone add this post to a FAQ somewhere! ;-) + +Havoc + +Links: + + +http://fontconfig.org/ and + +http://fontconfig.org/mozilla/ + + + + +Submitted: 2.01 Oct 3, 2002 + Notes on better browsers than NS. + Mozilla/xft + http://sourceforge.net/projects/font-tool/ Michael Fratoni + +Submitted 2.00 09/12/02 + +Changes 1.99pre + No more MS web fonts!!: + http://unixlab.cs.put.poznan.pl/pub/Windows/TTF-fonts/ + Fixed http://gongolo.usr.dsi.unimi.it/~vigna/webFonts4Linux/ + More on gdkxft, and AA. + More on Mozilla, userChrome.css, etc. + Touch up AbiSuite font issue. + Add Linus's usenet quote. + Comments on GNOME2. + Perl script for fonts.alias. + Improve the dpi section, and ad tip from Alex Jacques. + Some rewording of the TrueType section. + +TODO: + + +Date: Sun, 6 Oct 2002 19:05:42 +0200 (CEST) +Subject: De-uglification: XFree86 changes advance warning +To: hal@foobox.net + +XFree86 4.3.0 will include a new utility, mkfontscale, which creates +fonts.scale files for both TrueType and Type 1 fonts, just like +ttmkfdir does for TrueType fonts. + +You'll find pre-release versions of mkfontscale on + + http://www.pps.jussieu.fr/~jch/software/files/ + +Regards, + + Juliusz + + +Alex Jacques : +xdpyinfo|grep resolution + +indicated 88x91 dpi. Seems that horiz. and vert. resolution not being +the same caused the problem. 88 or 91 is about the right resolution for +my setup, hence I'd never bothered to configure it manually. Explicitly +telling the X server -dpi 91 fixed it completely (I now get +xdpyinfo|grep resolution => 91x91). + + + +http://www.tuxfan.homeip.net:8080/core_fonts-0.1-3.noarch.rpm + +I found the fonts in several locations: +http://unixlab.cs.put.poznan.pl/pub/Windows/TTF-fonts/ +http://nuoriso.hel.fi/__files/ms_truetype_core_fonts_for_the_web/Win95-98-NT/ index.html +http://web.archive.org/web/20000420210719/http://www.microsoft.com/opentype/ fontpack/default.htm +Time to modify xf86ttfontool again, I think. + +More reading here: +http://www.kottke.org/02/08/020813the_case_of_.html + +And even a MS explination of sorts: +http://typographi.ca/2002_08_13.php#000428 + + + +]]> + + +Submitted 1.9 Mon 11/05/01 10:48:43 AM +Todo 1.9 + ftlint (freetype) checks for bad fonts. + +Changes 1.9 + Added 2 URLs for Debian config from Paul Smith. + Added note about RH adding mkfontdir, etc to init script. + Changes for distros now handling font servers in several places, and + ways to dl/install MS TTF. + +====================== + +Changes 1.8 + Different URL for webfonts. Old one is broke. + Added the Debian msttcorefonts link. + Added nice AA/Xft section from Danny Tholen D.J.H.Tholen@bio.uu.nl + Gave full URL for MS fonts for text version. + Minor change to intro. + Added note on Abisuite ugly fonts + Added URL for webFonts4Linux + Added Kristen's Mozilla FAQ URL. + + + + + + +
+ + + + + + + + + + +Introduction + + + An often heard complaint is the poor default fonts and font settings of X as + implemented by many Linux distributions. Some programs use fixed width + default fonts when a variable width font would be more appropriate. Other + programs use fonts that are so small as to be practically unreadable. Many of + the fonts that are bundled with XFree86 are not of the same quality as found + on some other platforms. XFree86 does come with a halfway decent courier + font, but its Times and Helvetica fonts are simple bitmap fonts that pixelize + when scaled. This is changing for the better recently, but a default Linux + desktop still often needs some tweaking to get the best fonts possible. + + + + + This HOWTO attempts to show how to adjust various font settings, install new + fonts, and a few other things that should greatly improve the appearance and + readability of fonts on the X Window Desktop. This is done by adjusting the + FontPath in the XF86Config file, by + adding switches to X server command line in startx or + xdm (and variants), by adding new fonts, and by + making sure TrueType fonts are installed and available. TrueType does + indeed make a huge difference in many applications. + + + + + + Comments, corrections, additions and critiques are always welcome. You can + reach the author at hal@foobox.net. Contributions are also + welcomed. Especially anyone who really stays current with KDE and/or GNOME + issues! (So I guess nobody uses these since the silence is deafening?) + + + + + + + + +Conventions Used in this Document + + + + + + X and XFree86 are (incorrectly) used + here interchangably. The overwhelming percentage of Linux users indeed + use XFree86.org's X implementation, but there are other implentations + as well. The information here probably does not apply to those others in + most cases. + + + + + + Where examples of commands are used, a # character is used to + denote where typically the command would be run as the root user. A + $ is used where typically a non-root user would be executing + the command. + + + + + + The examples use /usr/local/share/fonts/ttfonts as our + TrueType font directory. There is no magic to this location, and could + conceivably just as well be in any number of other locations. Some + distros may have a default location for TrueType fonts, and you may + want to use that instead. + + + + + + References to "xfs" are to the xfs as packaged by Red Hat (and some other + distros) for versions 6.x and later. This differs significantly in some + respects from the stock XFree86 xfs. + + + + + + References to "Netscape" are to the entire suite of programs from Netscape: + Communicator, Navigator, Messenger, etc. And for all intents and purposes, + font configuration in Mozilla is very similar (but generally looks + better!). + + + + + + 'XF86Config' is the X configuration file. This has changed to + 'XF86Config-4' for XFree86 v4.x. For the most part, we'll just use + 'XF86Config' here. + + + + + Also, while some aspects of XFree86 4.x configuration are the same as + 3.3.x, there are some significant differences. We'll only highlight the + differences. So unless noted otherwise, any comments or examples should + apply to both 3.3.x and 4.x versions. + + + + + + + File system layout varies somewhat from distribution to distribution. It + is impossible to stay on top of every conceivable variation of who keeps + which files where. So take the examples here with a grain of salt if the + PATHs don't seem to match your system. + + + + + + + + + + + + + + + +Change Log and What's New + + + + + + + 2.04: October 30, 2002. + Include info on TrueType hinting, and enabling in + freetype sources (thanks Andreas Oesterhelt!). A few new useful links, + and minor cleanups. + + + If this keeps up, this document will have to be renamed the + Font Beautification HOWTO ;-). + + + + + 2.03: October 17, 2002. + Some brief notes on Red Hat 8.0 differences/newness, notably the changes + that accompany Xft2. More on the distinction of core X fonts and Xft (and + then Xft2). + + + + + 2.01: October 03, 2002. + Update links for obtaining the MS web fonts (TrueType fonts of choice). + There are two Sourceforge projects + with these fonts available, including. + http://sourceforge.net/projects/font-tool/. + + + Add section to Mozilla configuration to + include info on Xft and anti-aliasing. + + + + + 2.00: September 12, 2002. + Wow, MS has taken down their webfonts page :( Not good news. Installing + TrueType is a key ingredient to better living through nice fonts. + + + Major re-organization by moving the font server section to the appendix, + since any recent distro is already installing these, or they are + not any longer needed. + + + Some clarifications on gdkxft and font anti-aliasing. Finally, add + Aristotle Pagaltzis's perl script for converting fonts.dir + to fonts.alias. Include interesting example + of using anti-aliased TrueType fonts in xterm. + Note that GNOME 2 is out. Fix the usual assorted broken links. + + + Clarifications on dpi settings, and add tip + about unbalanced dpi causing major trouble with fonts. + + + + + 1.95: February 11, 2002. A few corrections. Removed the section on Fonts in + KDE since this has to have changed, and I don't know anything about KDE + (does anyone want to help here?). Added a brief section on gdkxft, which + adds anti-aliasing support for GTK+ 1.2 applications. + + + + + 1.9: November 5, 2001. A few new links and some minor catch ups only. + + + + + 1.8: June 25, 2001: Included a new section on Anti-aliasing and Xft from + Danny Tholen obiwan@mailmij.org. Many thanks on this not so + well documented subject. Also, Sebastiano Vigna's neat little package for + downloading and installing MS webfonts: http://freshmeat.net/webFonts4Linux. + A few other odds and ends. + + + + + + + 1.70: April 18, 2001: + Added links for converting Mac TrueType Fonts (thanks to Karl A. Krueger), + links to Unicode TrueType fonts (thanks to Tzafrir Cohen for suggestions + and URLs), and added a section on anti-aliasing with X 4.0.2 (or greater). + Also, included a reference to cabextract, a + utility that is now available for extracting Win32 Fonts (among other + things) from a Window's cab archive. + + + + + + 1.60: March 21, 2001: + A few very minor changes. Most notable news is anti-aliasing support now + in XFree 4.02 (referenced in the Notes section only). Chinese translation + URL added. + + + + + + + + + + + + + + + + +New Versions + + + + The pre-release versions of this document can be found at + http://feenix.burgiss.net/ldp/fdu/index.html. + + + + + + + + + + + + + +Copyright + + + Copyright © 1999 by Doug Holland, 2002 Hal Burgiss. + + + + Unless otherwise stated, Linux HOWTO documents are copyrighted by their + respective authors. Linux HOWTO documents may be reproduced and distributed + in whole or in part, in any medium physical or electronic, as long as this + copyright notice is retained on all copies. Commercial redistribution is + allowed and encouraged; however, the author would like to be notified of any + such distributions. + + + + All translations, derivative works, or aggregate works incorporating any + Linux HOWTO documents must be covered under this copyright notice. That is, + you may not produce a derivative work from a HOWTO and impose additional + restrictions on its distribution. Exceptions to these rules may be granted + under certain conditions; please contact the Linux HOWTO coordinator for more + information. + + + + In short, we wish to promote dissemination of this information through as + many channels as possible. However, we do wish to retain copyright on the + HOWTO documents, and would very much like to be notified of any plans to + redistribute the HOWTOs, this one in particular! Web page authors are free + to link to this HOWTO without restriction, though the author would appreciate + an email informing him of this, just so he can boost his ego by knowing who + else reads and links to this document. + + + + Many of the terms mentioned in this document are trade names. Unless + otherwise stated, all trademarks are property of their respective owners. + + + + + + + + + + + + +Credits + + + + + Original author: Doug Holland. + Email: meldroc@frii.com + WWW: http://www.frii.com/~meldroc/ + + + + + + + + Updated and maintained by Hal Burgiss. + Email: hal@foobox.net + WWW: http://feenix.burgiss.net/ldp/fdu/ + + + + + + +Special thanks go to: + + + + + + The developers of the XFree86 Project, + for all the hard work and time they have given. Also, Juliusz Chroboczek for + his work with xfsft, and XFree86 4.x to help bring TrueType to the + hungry masses. And Keith Packard for his anti-aliasing, and other work. + This is not to slight the many, many other XFree86 volunteers. + + + + + + Font wizard Kristin Aanestad, whose legwork and insight on much of the xfs, + TrueType, Netscape, and especially, the fonts.alias sections are much + appreciated. More from Kristin at Some Linux for Beginners + on a wide range of topics. + + + + + + Danny Tholen obiwan@mailmij.org is responsible for the nice + Xft section, and examples. + + + + + + The folks at comp.os.linux.x who + gave me a hand in figuring all of this out in the first place. + + + + + + The Linux community in general who made all of this possible + in the first place. Especially those who have offered suggestions and + comments that help to make this HOWTO a better resource. Keep those cards + and letters coming ;-) + + + + + + + + + + + + + + + + +Translations + + + +Chinese: http://www.linux.org.tw/CLDP/mini/FDU.html by Yu-Chia Chang. + + + + + + + + + + + + + + + +X Server Configuration + + + There are a few simple configuration tweaks that will help X do its job + better. + + + + + + +Setting The FontPath + + + The first place to look for curing font problems is the + XF86Config file. + /usr/X11/lib/X11/XF86Config or + /etc/X11/XF86Config are the common locations. (This may + be XF86Config-4 for XFree86 4.x.) If you haven't + guessed already, the most important part of this file relating to fonts is + the FontPath. Before we get into that, this would be a + good time to check the other parts of your X configuration. Bad monitor + settings can be even more of a headache than bad fonts, so make sure your + refresh rate is as high as your monitor can handle (85 Hz is great, 75 Hz is + OK, 60 Hz is painful.) + + + + + + Use your favorite text editor and edit + XF86Config. Near the top of the file in the + "Files" section, you should see something vaguely like this: + + +
+ + + + +FontPath "/usr/X11R6/lib/X11/fonts/misc/" +FontPath "/usr/X11R6/lib/X11/fonts/Type1/" +FontPath "/usr/X11R6/lib/X11/fonts/Speedo/" +FontPath "/usr/X11R6/lib/X11/fonts/75dpi/" +FontPath "/usr/X11R6/lib/X11/fonts/100dpi/" + + + + +
+ + + This much should be the same, or at least similar, for both XFree86 3.x and + 4.x. The FontPath tells X where to find the fonts it uses + to render text on your display. Order is important -- when an X application + asks X to render some text, the X server usually has some leeway to choose the + font that is used. The X server then goes through the + FontPath and grabs the first font it sees that matches the + X client's criteria, and then displays it. (Note that Red Hat's xfs for versions 6.x + and later has a different way of setting the FontPath. See + the below for more on xfs.) + + + + + If the 100dpi fonts are not listed, they probably did not get installed for + whatever reason, so you may want install them now. Default installations + may put 75dpi fonts before the 100dpi fonts. If you have a high + resolution display (1024x768 or higher), this means very tiny fonts. If this + is the case, the first tweak you'll use is to switch the 75dpi and 100dpi + FontPath lines: + + +
+ + + + +FontPath "/usr/X11R6/lib/X11/fonts/misc/" +FontPath "/usr/X11R6/lib/X11/fonts/Type1/" +FontPath "/usr/X11R6/lib/X11/fonts/Speedo/" +FontPath "/usr/X11R6/lib/X11/fonts/100dpi/" +FontPath "/usr/X11R6/lib/X11/fonts/75dpi/" + + + + +
+ + + Next, specify that you prefer to use unscaled bitmap fonts. If you've ever + used Netscape or any other program that displays titles using big fonts, + you might have noticed that those fonts were pixelized. This is ugly and needs + to be corrected. So add :unscaled to the ends of the misc, + 100dpi and 75dpi fonts. You can even use both unscaled and scaled fonts if + you want, just put the unscaled FontPath lines first to + tell X you prefer unscaled fonts if possible: + + +
+ + + + +FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled" +FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled" +FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled" +FontPath "/usr/X11R6/lib/X11/fonts/Type1" +FontPath "/usr/X11R6/lib/X11/fonts/Speedo" +FontPath "/usr/X11R6/lib/X11/fonts/misc" +FontPath "/usr/X11R6/lib/X11/fonts/100dpi" +FontPath "/usr/X11R6/lib/X11/fonts/75dpi" + + + + +
+ + + + After making these changes, restart X (and your font server, if installed). + Doesn't the desktop look better already? + + +
+ + + + + + + + +X Server Command Line Options + + + The next thing you might need to do is adjust the command line options for + the X server. It is important that the dpi resolution + be accurate. Run this command: + + + + + + $ xdpyinfo | grep resolution + resolution: 111x111 dots per inch + + + + + + If this does not look to match what your monitor can do, or if it is + unbalanced (e.g 98x95), you will need to use the + -dpi switch which specifies the display resolution in dots + per inch. As a lot of systems use high resolution displays these days, + chances are they'll be working at 100 dpi, or better. While an unbalanced + setting reportedly can really play havoc with some fonts. + + + + If you start X from the console command prompt, type: + + + + + $ startx -- -dpi 100 -depth 16 # v4.x syntax + + + + + Or these options can be stored in ~/.xserverrc. See the + startx and xinit man pages for more on + this. + + + + If you use xdm (or friends such as gdm) for graphical logins, you'll want to + edit your /usr/X11/lib/X11/xdm/Xservers file (or + possibly /etc/X11/xdm/Xservers) which will have the + command line for the Xserver in it. Mine has the line: + + + + + :0 local /usr/X11R6/bin/X -dpi 100 -gamma 1.6 + + + + + You want to specify a value that is compatible with your monitor's output. + + + + More information is in the X, Xserver, + xdm, xinit, and + startx man pages. + + + + +
+ + + + + + + + + + + +TrueType Fonts + + + + Historically, the Unix world relied on Type 1 fonts for high + quality scalable fonts. Linux supports Type 1 quite well, both for + printing and for screen output. But, Type 1 never was widely adopted + by web designers, and on other platforms. TrueType, due to its association + with Windows, is the preferred web font. And XFree86 seems to render + TrueType a little better. + + + + You won't find many decent TrueType fonts included with any distribution, + however. The reason is that there are not many quality TrueType fonts + available under a suitable license at this time. In fact, many of the + free ones, are rather poor. Many distributions are + including some TrueType fonts, and also including tools for automating the + process of adding TrueType fonts from external sources. See if that is an + option for you. This will be easiest route. You will definitely want + to add some quality TrueType fonts, one way or another. + + + + Because the boys in Redmond are very concerned with the appearance of their + software (as opposed to the internal workings ;), they built TrueType font + support into Windows. And of course no big surprise, but they got the idea + from Apple. In fact, TrueType is a registered trademark of Apple Computer, + Inc. Windows 9x, NT, 2K and nearly every other incarnation of Windows comes + with Arial, Times New Roman, and Courier New, which are roughly equivalent + to Helvetica, Times and Courier. TrueType fonts are scalable, so they look + good in large sizes, and they are well hinted, so they are readable at small + sizes. Many windows applications come with dozens more TrueType fonts. + And let's face it, those MS and Apple fonts are, generally speaking, just + plain better than the freely available ones with a suitable license. Don't + microwave your Windows CD yet, you'll want to get those quality fonts first! + + + + + + + +Making TrueType Fonts Available + + + Let's start with the fonts first. Any TrueType font included with the various + MS Windows incarnations should work. Don't forget word processors and other + apps that may include their own fonts. MacOS fonts will only work if + converted to a usable format. (See the links + section for converter packages.) There are also some 'free' TrueType + fonts available for download if you have already nuked that CD (see links section). + + + + Many distributions are now bundling tools for automating the process of + including quality TrueType fonts. SuSE, Debian, and Mandrake do (Red Hat 7.x + does not at this time). See what packages you might have for this as this + will be the most painless way to go. Essentially, these tools help migrate + fonts from a Windows installation, or download those available from + Microsoft [note 08/15/02 MS has recently removed these fonts!] , and then + handle the installation and configuration all in one neat utility. If you do + have such a utility, the below information may not be necessary! + + + + + In order to use TrueType, the fonts will have to be always accessible to + X. This means they will have to be on a filesystem that is + always mounted. This can conceivably be a Windows + partition on a dual boot system. Alternately, the fonts can be copied to + Linux. First su to root: + + + + + + + # su - + # mkdir -p /usr/local/share/fonts/ttfonts + + + + + + + Now, change to the new font directory: + + + + + + + # cd /usr/local/share/fonts/ttfonts + + + + + + + + Then, add the fonts to this directory, either by copying them from your + Windows system: + + + + + + + # cp /mnt/<path_to_fonts>/*ttf . + + + + + + + or by downloading those available directly from Microsoft: + http://www.microsoft.com/typography/fontpack/default.htm. + Note 08/17/02: Microsoft has recently discontinued this + page. At this time, the following pages (may!) still have these + fonts available (or google search for them): + + + + + +     http://nuoriso.hel.fi/__files/ms_truetype_core_fonts_for_the_web/Win95-98-NT/index.html + + +     http://web.archive.org/web/20000420210719/http://www.microsoft.com/opentype/fontpack/default.htm + + + + + + + + + These can be unarchived under Linux with + cabextract, which can be found + http://www.kyz.uklinux.net/cabextract.php3. + This would now seem to be the best way to go at this time. + + + + A slick solution to this from Sebastiano Vigna is his + + http://freshmeat.net/webFonts4Linux, which automates + the downloading, extracting and installation of the Microsoft fonts + all in one neat package. A utility designed primarily for Red Hat can be found: + http://sourceforge.net/projects/font-tool/, + which includes all the core MS web fonts, plus relevant system configuration. + There is a tarball, as well as RPMs (both require cabextract). + + + + You can also get an RPM of WebFonts that contains some of the MS Web + fonts from ftp://ftp.rpmfind.net/linux/contrib/noarch/noarch/webfonts-1-3.noarch.rpm. + This has enough basic fonts to keep Mozilla and other web browsers happy. + Something similar for Debian is http://packages.debian.org/unstable/graphics/msttcorefonts.html. + This does not include the actual fonts, but facilitates the installation. + + + + If doing it yourself, you will also have to include the new TrueType + directory(s) in the X server's fontpath. So with your text editor of choice + add the line(s) as appropriate: + + +
+ + + + +FontPath "/usr/local/share/fonts/ttfonts" +FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled" +FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled" +FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled" +FontPath "/usr/X11R6/lib/X11/fonts/Type1" +FontPath "/usr/X11R6/lib/X11/fonts/Speedo" +FontPath "/usr/X11R6/lib/X11/fonts/misc" +FontPath "/usr/X11R6/lib/X11/fonts/100dpi" +FontPath "/usr/X11R6/lib/X11/fonts/75dpi" + + + + +
+ + + This configuration is for core X font support. For + additional configuration relating to the new Xft rendering engine, + see the sections below on XFT and anti-aliasing. + + + +
+ + + + + + + +TrueType Hinting + + Hinting is a TrueType specific feature, that is generally + considered to be a useful technique that improves the appearance of TrueType + fonts. Unfortunately, there are some licensing and patent issues involved + with this, and it is disabled by default in the freetype sources! And also + quite likely that if you are using vendor supplied binaries, it is disabled + there as well. + + + To enable this feature, the sources need to be rebuilt. Look for + include/freetype/config/ftoption.h in the freetype + source tree, and then search for: + + + + #undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + + + And very simply, make this small change: + + + + #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + + + Red Hat users can rebuild the src.rpm by toggling one setting at the top, + and accomplish the same thing: + + + + %define without_bytecode_interpreter 1 + + + + And change to: + + + + %define without_bytecode_interpreter 0 + + + + Other vendors may have a similar, easy-to-use mechanism. + + + Then rebuild and install the finished binaries. Be sure to restart X as well + since the freetype code is already loaded into memory by X. + + + Note that hinting, anti-aliasing, and + sub-pixel rendering are separate concepts (see the section on Xft below for more). Again, this is not a + cure-all for ugly fonts, but one more piece in the puzzle of + font beautification. + + + + + + + + + +Configuration + + + This section pertains to installing and configuring TrueType fonts + for any freetype based font renderer. This would include + the freetype font module from XFree86-4.x, + Red Hat's xfs, and the xfsft font + server. Again, if you have used a distro supplied tool for migrating + TrueType fonts, it is likely this has been done for you already. The + steps described below would only be necessary for manual font installation. + + + + There is still more work to be done before we can actually use any TrueType + fonts. First, all font files must have lower case names. Secondly, + they shouldn't have embedded spaces. And then, we will need to create a + couple of configuration files to make things go. + + + + Su to root, and change to the directory where the TrueType fonts are. + + + + + + + # su - + # cd /usr/local/share/fonts/ttfonts + + + + + + + If there are any upper case font names, you can use the following script to + convert all names to lower case: + + + + + + + + #!/bin/sh + # + ## -------- convert upper to lower case --------- + + ls * | while read f + do + if [ -f $f ]; then + if [ "$f" != "`echo \"$f\" | tr A-Z a-z`" ]; then + #Note that 'This' will overwrite 'this'! + mv -iv "$f" "`echo \"$f\" | tr A-Z a-z`" + fi + fi + done + + ## eof + + + + + + + + + Note the punctuation -- the backquotes are important! Remove any spaces from + font names too. Once the TrueType fonts are properly installed, you must + create both fonts.dir and + fonts.scale files. The following commands do this: + + + + + + + + # ttmkfdir -o fonts.scale + # mkfontdir + + + + + + + If you don't have ttmkfdir installed, check your + distribution's repository, or it can be downloaded from: + http://www.joerg-pommnitz.de/TrueType/ttmkfdir.tar.gz. + This is necessary! + + + + As of Red Hat 7.1, the above commands are run from the xfs init script. + So restarting xfs (/etc/rc.d/init.d/xfs restart) will + accomplish the same thing for Red Hat users. Other distros may have + similar shortcuts. + + + + You should now have fonts.dir and + fonts.scale files in your TrueType font + directory. ttmkfdir is in the + Freetype RPM for Red Hat users, and must be run + before mkfontdir. With Debian based distros, there + is a similar utility called mkttfdir, and is in the + fttools Deb package. Though this apparently does not + generate as many encodings as ttmkfdir. These commands + may not always report errors, so verify that they were created and are not + empty files: + + + + + + + + $ ls -l fonts.* + -rw-r--r-- 1 root root 11657 Aug 17 10:31 fonts.dir + -rw-r--r-- 1 root root 11657 Aug 17 10:31 fonts.scale + + + + + + + + If you encounter any problems, try ttmkfdir with the + - m switch. This will discard bad characters from the + font file. Specify a number such as 50 or l00 + (ttmkfdir -m 50). The files themselves are text files. + Have a look: + + + + + + + + $ less fonts.dir + 114 + webdings.ttf -microsoft-Webdings-medium-r-normal--0-0-0-0-p-0-microsoft-symbol + verdanaz.ttf -microsoft-Verdana-bold-i-normal--0-0-0-0-p-0-ascii-0 + verdanaz.ttf -microsoft-Verdana-bold-i-normal--0-0-0-0-p-0-fcd8859-15 + verdanaz.ttf -microsoft-Verdana-bold-i-normal--0-0-0-0-p-0-iso8859-15 + verdanaz.ttf -microsoft-Verdana-bold-i-normal--0-0-0-0-p-0-iso8859-9 + verdanaz.ttf -microsoft-Verdana-bold-i-normal--0-0-0-0-p-0-iso8859-1 + [...] + + + + + + + If ttmkfdir is persistently giving problems by + not generating a proper output file, there may be one or more + bad fonts (ie fonts it can't handle). In that + case, just start with a few common ones, like Arial and Verdana. + If this works, then add a few at a time. + + + + Now be sure the new fonts are included in the FontPath. + And either restart X (Ctrl-Alt-BS), or the font server (if using one). + You could also try refreshing the FontPath: + + + + + + + # xset fp rehash + + + + + + + Red Hat 6.x/7.x users can update the FontPath and xfs: + + + + + + + # chkfontpath --add /usr/local/share/fonts/ttfonts + # /etc/rc.d/init.d/xfs restart + + + + + + + You should now be in business. You can check which fonts are available to X: + + + + + $ xlsfonts | less + + + + + or check them out further with xfontsel, or + gfontsel. If they are visible to + xlsfonts, then they are available to X and vice versa. If + they are not there, try restarting X with Ctrl-Alt-BS. + + + + This gets you as far as X knows about your new fonts. Individual applications + will need to be configured to use them. GNOME and KDE will require additional + steps as well (see the respective docs). You will also want to configure + Xft (see below), if using XFree86 v4.x or later. + + + + + + + + + + + +Font Servers + + Historically, font servers were used to serve fonts over a network. Font + resources could then reside on one host, and clients could access them as + needed. But, the developers have enhanced these to include features such as + the ability to render TrueType fonts. XFree86 4.x does have built + in support for TrueType (see ), making a font + server not a necessity, though some distros default to using a font server + for other reasons now. + + + + XFree86 3.x does not come with built in TrueType support, so you'll have to + add it yourself if you are using a 3.x version. This will mean installing a + supplemental font server that does support TrueType. And, of course, + installing the fonts themselves (see above). See the + Appendix for font server installation, + and related tips. + + + Any recent distro will have one or more font servers included, and the + important configuration should be done by the installation program. + + + + + + + + + + + +The fonts.alias File + + + fonts.alias is yet another font configuration file that + can be used to tweak how fonts are handled. Like fonts.scale + and fonts.dir, fonts.alias must be in + the same directory as the fonts you are aliasing. It is not mandatory however, + but does solve certain potential problems. Here is an example from the first + line of/usr/X11R6/lib/X11/fonts/misc/fonts.alias on + a Red Hat system: + + + + + + + fixed -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1 + + + + + + + fixed is the 'alias' here. Any time this is requested, we + actually get the font definition from the second column. Font too small? Just + change the definition. (Warning: this is a critical file, at least on Red Hat.) + The same principle applies to all fonts, including TrueType. In fact, if you + don't have TrueType, you could conceivably use this trick to have a + comparable Type 1, or other, font aliased as a TrueType. + + + + fonts.alias is important for some applications that don't + handle the data provided by fonts.scale well. Most notably + here is Netscape. Without a fonts.alias you will find that + Netscape will only show point sizes of 0 and 12 available. + fonts.alias fixes this. You might also find that if you a + specify another size with the scalable font option under + Preferences, Netscape will not remember this setting. + Annoying! This is also fixed. So we really need this file. Sample excerpt from + a fonts.scale: + + + + + + + + arial.ttf -monotype-Arial-medium-r-normal--0-0-0-0-p-0-ascii-0 + arial.ttf -monotype-Arial-medium-r-normal--0-0-0-0-p-0-fcd8859-15 + arial.ttf -monotype-Arial-medium-r-normal--0-0-0-0-p-0-iso8859-15 + arial.ttf -monotype-Arial-medium-r-normal--0-0-0-0-p-0-iso8859-1 + + + + + + + These are scalable so we don't get any predefined point sizes. We will need to + create our fonts.alias something like this excerpt for + Arial: + + + + + + + + -monotype-Arial-medium-r-normal--6-60-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--9-90-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--7-70-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--9-90-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--8-80-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--10-100-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--9-90-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--11-110-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--10-100-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--12-120-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--11-110-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--12-120-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--12-120-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--12-120-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--13-130-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--13-130-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--14-140-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--14-140-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--15-150-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--15-150-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--18-180-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--18-180-75-75-p-0-iso8859-1 + + -monotype-Arial-medium-r-normal--24-240-0-0-p-0-iso8859-1 \ + -monotype-Arial-medium-r-normal--24-240-75-75-p-0-iso8859-1 + + + + + + + + (Please note that I have split each line for readability. + There should be two columns all on one line, without the \, and + separated by at least one space.) This will keep Netscape happy. Also, if + font names should have embedded spaces, then you should enclose the filename + in quotes. You might also note the pointsize discrepancy + between the first and second columns of the first few rows. The first column + of the first entry has a '6', whereas this is aliased to a '9' in the second + column, and thus '9' point. This is by design and is an excellent way to + overcome the Netscape 'damn tiny fonts' syndrome. Adjust to suit your tastes, + resolution, and eyesight. + + + + + This file can be created manually with a text editor, or conceivably with some + fancy sed or awk scripting. There is an excellent discussion of this file, + and other font related topics at Kristin Aanestad's site at + http://home.c2i.net/dark/linux.html. There is + also a link to a python script which can reportedly automatically generate + a fonts.alias file at this same site. A perl version + of this script is re-printed in the Appendix. Thanks to Kristin whose work and insight + was the inspiration for this section! + + + + + Another potential use of fonts.alias would be to map + one font to something quite different. Say you don't have TrueType fonts, + and didn't want to install Microsoft's. You could alias nice, scalable Type 1 + fonts to a TrueType. That way when the system (or some web page) wants a + TrueType, you'd get something of comparable quality instead of bitmap that + doesn't scale well. + + + + + Note that with XFree86 4.0.2 and greater, there are new font handling + mechanisms available via the Xft extensions. Font aliasing is done + in Xft's own configuration file: XftConfig. This + is the preferred method where anti-aliasing, and the other new rendering + features are desired. See the Anti-aliasing Section + for more on this and de-mystification. This is only true where the + application (i.e. the toolkit, e.g QT) itself supports the new extensions! + At this time, not all do (yet). + + + + + + +
+ + + + + + + + + + +XFree86 4.x + + + XFree86 4.0 + introduced native support for TrueType fonts, along with other new + features. The enhanced font support is based on xfsft from Juliusz + Chroboczek, which in turn is based on the FreeType font library originally + from Mark Leisher, so the configuration is similar to xfsft and Red Hat's + patched xfs which use the same rendering engine. As of 4.0.2, XFree86 begins + to support anti-aliasing which is a technique for smoothing font outlines + (see section below). + + + + + The FontPath is still in XF86Config, as + always. For Red Hat 6/7 using a stock XFree86 4.x (i.e. NOT the Red Hat 7.x + supplied version), this will mean moving the Red Hat xfs + FontPath from /etc/X11/fs/config back + to XF86Config. A separate font server is no longer + needed just for TrueType support. You may disable it, unless it is needed to + serve fonts to other clients in a network environment. Or you may want to + still use it since there may be a very small performance gain in some + situations (at the cost of more memory utilized). See the section below for + Red Hat 7.x specific configuration issues. + + +
+ + + + + Section "Files" + FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled" + FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled" + FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled" + FontPath "/usr/X11R6/lib/X11/fonts/misc" + FontPath "/usr/X11R6/lib/X11/fonts/Type1" + FontPath "/usr/X11R6/lib/X11/fonts/Speedo" + FontPath "/usr/share/fonts/default/Type1" + FontPath "/usr/local/share/fonts/ttfonts" + FontPath "/usr/X11R6/lib/X11/fonts/100dpi" + FontPath "/usr/X11R6/lib/X11/fonts/75dpi" + EndSection + + + + +
+ + + In order to use TrueType, you must also specify which font + module the X server should be using in the "Module" + section: + + +
+ + + + + Section "Module" + Load "freetype" + Load "speedo" + Load "type1" + <load other modules....> + EndSection + + + + +
+ + + Note that there can be only one 'Module' section, so include any other + modules here as well. Again, this is the kind of configuration that your + distro should be doing during installation, and may not be + necessary, unless you are upgrading, or want to make manual changes + yourself. + + + + You also must have a fonts.scale and + fonts.dir file for each TrueType font directory, just like + for xfsft and Red Hat's xfs (see Appendix). ttmkfdir, + http://www.joerg-pommnitz.de/TrueType/ttmkfdir.tar.gz, + will come in handy for fonts.scale if it is not + already installed. See the + Configuration section above for more + details and examples. + + + + xtt is another available TrueType module that is best known + for supporting ideographic (Oriental) type fonts. You can use either, but only + one at a time. + + + + Most X server command line options are still the same as previous versions of X: + + + + + + $ startx -- -dpi 100 + + + + + + +Xft and Core Fonts + + As mentioned, the new font handling improvements are the result of the + development work behind Xft. Xft is + an on-going effort to improve and modernize X's font handling. The end + result will be radically different from the traditional X font handling + (known as core X fonts). + + + What we have now is essentially two different systems: one that has been + around since the dawn of time (or even before :), and one that is radically + new and still evolving! I emphasize this, since the + still evolving part is likely to cause some confusion until + the dust settles. + + + The initial release of Xft v1.0 with XFree86 4.0.2 is controlled by its + configuration file, XftConfig. This changes with later + versions, where the font configuration is handled by the + fontconfig library, with its main configuration typically located + /etc/fonts/fonts.conf. Of course, additional + development has brought other improvements as well. For more on the + Xft and Fontconfig, see the Fontconfig home page, + http://fontconfig.org/. + + + + What we, as end users, will notice and appreciate most, is the anti-aliasing + support and other rendering enhancements we get from Xft. Though this is not + the only benefit. + + + + + + + + +Anti-aliasing + + + Anti-aliasing is a technique for producing even smoother, crisper looking + fonts by subtly softening the sharp, jagged edges. This has long been a + feature of Apple and Microsoft font rendering, and is now making it's way + into X via the X Rendering Extension specification. The new extensions + provide other benefits as well. Distributions that support anti-aliasing with + their stable/official versions are now being released. + + + + That is the good news. The bad news is that not all drivers support + anti-aliasing yet. This is a moving target, so you will have to dig around to + find whether your chipset is supported or not. The recently released 4.2 + should have near universal support. More not-so-good news is that not all + applications are actually taking advantage of this yet. We will have + to wait for the various toolkits (TK, Xaw, etc) to catch up. KDE + is an exception, and has had strong AA support via the QT toolkit. The + recently released GNOME-2, has AA support now too. + + + + Anti-aliasing is not a cure-all, but is another piece of the font puzzle. + Some point sizes may look better if not anti-aliased, and some systems + just may not handle the various rendering enhancements as well as others. + + + + If you are reading this long after the publication date (October 2002), + hopefully most of these shortcomings will have been overcome. All hardware will + eventually be supported, mainstream distros will have shipped releases that + include the new extensions, and they will be enabled by default. Many apps + will look better since they will be AA aware, and we won't + have to jump through any configuration hoops just to make it work. In the + meantime, read on ... + + + + +Requirements + + + Minimum requirements for Anti-Aliasing: + + + + + + + + XFree86 4.0.2 or later. + + + + + + You graphic card's driver has to support anti-aliasing. If + 4.0.2 (or greater) is already installed, you can get this information + direct from the driver with xdpyinfo. Run this and + look for Number of Extensions:. If this lists RENDER among them, then you should be good to go. If not, well, it isn't going + to work, and you will have to wait for an updated driver. + + + + + + The Freetype2 library available from + http://www.freetype.org, and + also now bundled with XFree86. XFree needs to be linked against this, so + install and build first if building from scratch. Your distro should have + Freetype packages as well. Just make sure it is + freetype-2. + + + + + + TrueType fonts are best for display purposes. Type 1 is also good, + but may not render quite as well. See above sections. + + + + + + For KDE users, KDE supports anti-aliasing as of 2.x. This will require + QT-2.3.0 or later, and built with Xft support. A nice font HOWTO from + Troll Tech for KDE and QT can be found: http://trolls.troll.no/lars/fonts/qt-fonts-HOWTO.html. + + + + GNOME 1.x does not support anti-aliasing. + GNOME 2.0 has recently been released and does have native support for + anti-aliasing. + + + + + + Applications that know about anti-aliasing. Not necessarily + at the individual application level, but the libraries and toolkits (GTK, + TK, etc.) that the application are built against, must be able to use the new + features. At this time, not all do. KDE/QT is first out of the + box and has good support. Also, xterm (yes, + xterm!) supports the new + extensions. An interesting example scavenged off usenet: + + + + + Cache-Post-Path: palladium.transmeta.com!unknown@penguin.transmeta.com + Date: Tue, 23 Apr 2002 21:10:18 +0000 (UTC) + X-Trace: news.sjc.globix.net 1019596253 63.209.4.196 (Tue, 23 Apr 2002 14:10:53 PDT) + NNTP-Posting-Date: Tue, 23 Apr 2002 14:10:53 PDT + + In article , + William Park wrote: + >Peter Karlsson wrote: + >> What's wrong with "fixed"? :-) + >> + >> xterm -sb -sl 10000 -fg yellow -bg black -geometry 120x40 -fn fixed -bc + > + >This will load the default 6x13 fonts, aka. + > -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1 + >A bit too small, though it has correct proportions. If there is bigger + >size (8x16, 10x20, 12x24) of that fonts, then that would be ideal. + + If you like anti-aliased fonts, the command line I prefer happens to be + + xterm -geometry 100x40 -fa andale:size=11:charwidth=6 + + I think that font is from the MS free fontpack. + + In order for it to work for you, you need to have the anti-aliasing + truetype fonts working well, and probably a good monitor (and some + people _hate_ that rounded look from anti-aliasing, and find it fuzzy + even then). + + Linus + ]]> + + + + You might have to experiment with the size + and charwidth values to get reasonable + results. + + + + + + The new rendering extensions configuration file, + XftConfig, must be configured for the fonts you want + to use. Note that as of Xft2, this changes to + /etc/fonts/fonts.conf. + + + + + + The new extensions supplant much of what we have been doing with font + servers like xfs. fonts.alias and similar + configuration files, for instance, are not used for fonts that are + being controlled by the new extensions. Essentially, this gives us + two separate font handling engines: the traditional, core + font engine, and the new, Xft engine. The core engine is still used + in some situations. + + + + + + + + + + + + + + + +Installation + + + Keith Packard has a very brief summary of the steps required for building, + installing and configuring from source at http://www.xfree86.org/~keithp/render/aafont.txt. No need to reprint it here. + + + + + Newer distro releases are likely to have the foundation support for + anti-aliasing available now. Red Hat, for instance, has it available as of + Red Hat 7.1. + + + + To verify the necessary components, first make sure the + freetype module (and any others) are loaded. Check the X + server output: + + + + + (II) LoadModule: "freetype" + (II) Loading /usr/X11R6/lib/modules/fonts/libfreetype.a + (II) Module freetype: vendor="The XFree86 Project" + compiled for 4.0.3, module version = 1.1.9 + Module class: XFree86 Font Renderer + ABI class: XFree86 Font Renderer, version 0.2 + (II) Loading font FreeType + + + + + Then verify if the RENDER extension is available, either check + with xdpyinfo, or check the X server log, typically + /var/log/XFree86.0.log: + + + + + (II) Initializing built-in extension MIT-SHM + (II) Initializing built-in extension XInputExtension + (II) Initializing built-in extension XTEST + (II) Initializing built-in extension XKEYBOARD + (II) Initializing built-in extension LBX + (II) Initializing built-in extension XC-APPGROUP + (II) Initializing built-in extension SECURITY + (II) Initializing built-in extension XINERAMA + (II) Initializing built-in extension XFree86-Bigfont + (II) Initializing built-in extension RENDER + + + + + If RENDER is there, anti-aliasing and the other advanced + rendering extensions should be available. If not, the system should + gracefully fall back to the core X fonts engine. + + + + + + + + + + +Xft Configuration (XftConfig) + + By Danny Tholen obiwan@mailmij.org + + + + Xft is an interface to the freetype rasterizer written by Keith Packard, + member of the XFree86 Project, Inc. It allows applications to use fonts from + the new X render extension using a unified font naming scheme. In + /etc/X11/XftConfig (or + /usr/X11R6/lib/X11/XftConfig) you will find a + configuration file which can be adapted to suit your personal taste. In this + section I will explain the syntax and demonstrate some things you can do + with this file. + + + + The following information is based on 4.0.3. 4.1 is just released, and there + may be a few new wrinkles not touched on here. Future versions are sure + to bring even more radical changes. + + + + Note that Xft2 makes radical changes to Xft configuration. + XftConfig is obsoleted and replaced by the new + fontconfig libraries. Red Hat 8.x + users should read the Red Hat 8.0 Differences + section first. Many of the principles described still apply, but the + configuration is radically different. FYI. + + + + + +XftConfig Structure + + + The basic structure revolves around a 'pattern'. A pattern is a set of + name/value-list pairs, each value-list contains one or more typed values. A + certain application requests a font, for example: + + + + + + + family: "Arial" + size: 12 + encoding: "iso8859-1" + + + + + + + A size 12 arial font in latin-1 encoding. The Xft extension will now try to + patch this pattern to all of the fonts available in the system. And + selecting the one with the best score. Before the matching is done Xft looks + in XftConfig. The requested pattern can here be extended + before use. An example is: + + + + + + + match any family == "Arial" edit antialias = true; + + + + + + + This will enable anti-aliasing for all fonts of the family Arial. + + + + Also, the X server is queried to list all of its fonts; the XLFD contains + just enough information to match fonts roughly. + + + + Here's a list of attributes used in matching fonts (in priority order, this + may not be up to date anymore!): + + + + + + + foundry font foundry (string, like monotype) + encoding font encoding (string, like iso8859-1) + spacing font spacing (integers or proportional (0), mono (100), + charcell (110)) + bold is the font bold? (boolean) + italic is the font italic? (boolean) + antialias is the font anti-aliased? (boolean) + family font family (string) + size font size (double) + style font style (string, like "Bold Italic") + slant font slant (roman, italic, oblique) + weight font weight ( integers or light, medium (100), demi-bold, + bold, black) + rasterizer not yet used (probably "TrueType", "Type1", ...) + outline are outlines available? (boolean) + + + + + + + + + + + + + + + +XftConfig Syntax + + + + + + dir + + + Adds a directory to the list of places Xft will look for fonts. There is no + particular order implied by the list; Xft treats all fonts about the same. + + + + + include and includeif + + + Cause Xft to load more configuration parameters from the indicated file. + "includeif" doesn't elicit a complaint if the file doesn't exist. If the + file name begins with a ~ character, it refers to a path + relative to the home directory of the user. This is useful for + user-specific configurations. + + + + + match edit + + + If a pattern from an application matches the pattern after + match, it is edited with the instructions in + edit. The pattern match is done as follows: + + + + + match qual FIELD-NAME COMPARE CONSTANT + + + + where qual is either any (matches one specific font) + or all (matches all fonts). An example: + + + + + + + match all foundry==¨monotype¨ + + + + + + + which will match (and edit) all fonts belonging to the foundry + monotype. + + + + + + + match any family==¨arial¨ + + + + + + + will match (and edit) one specific font with the family name + arial. + + + + FIELD-NAME is any one of the properties found in the + above section Structure, or additionally: + + + + + + + + pixelsize font size in pixels (integer) + charspace character space (integer) + minspace minimal spacing (integer) + rgba color hinting (string ¨rgb¨ or ¨bgr¨ and + vertical hinting ¨vrgb¨ ¨vbgr¨), aka sub-pixel hinting + xlfd x server font (string, type xlsfonts to + see a list of your xlfd strings) + file the font file (string) + core use X core fonts? (boolean) + render use render fonts? (boolean) + index I have no idea what this does:) + scalable is the font scalable (boolean) + scale scale the font (integer) + charwidth character width (integer) + charheight character height (integer) + matrix no idea (not really at least) + + + + + + + COMPARE can be <, + >, or ==. + + + + CONSTANT is the value of the field-name in the + appropriate type (see above section Structure). + + + + You can use multiple matches before you use the edit + statement: + + + + + edit FIELD-NAME ASSIGN EXPR SEMI + + + + + Where ASSIGN can be one of =, + += or =+. With + =, the matching value in the pattern will be replaced + by the given expression. += or =+ + will prepend/append a new value to the list of values for the indicated + field. + + + + EXPR sets the FIELD-NAME to a value. + + + + SEMI is a semicolon (;). You can + use multiple instructions, separated by a semicolon. See below for + examples if this is confusing. + + + + + + + + + + + + + + + + + +XftConfig Examples + + + And now I´ll try to list a few useful configurations and explain them. Note + that it is configured for my system, and I may use different fonts than you, + so try to adapt the examples to your own needs. + + + + + + + + + How do I make fonts available to Xft? + + + + List your Type 1 and TrueType font directories with dir. On my + system (Mandrake 7.2) this becomes: + + + + + + + dir "/usr/X11R6/lib/X11/fonts/Type1" + dir "/usr/X11R6/lib/X11/fonts/drakfont" + + + + + + + + + + How do I use a user specific XftConfig file? + + + + Put an .xftconfig file in your user directory and add: + + + + + + + includeif "~/.xftconfig" + + + + + + + to your standard XftConfig. This will enable a user + specific configuration file, but it will not complain if there is no such + file. + + + + + + + How do I make aliases for my fonts? + + + + I noted that my KDE console asks for mono fonts when it is + looking for a fixed font. console is used when I select + linux in the font menu of the KDE konsole. Therefore, I used + two aliases for fonts which are also named fixed: + + + + + + + match any family == "fixed" edit family =+ "mono"; + match any family == "console" edit family =+ "mono"; + + + + + + + + + Anti-aliasing my fonts are blurry and makes me dizzy! + + + + Although there is a big fuzz around AA in X, good fonts actually look better + if they are not anti-aliased. The anti-aliasing blurs the fonts by adding + gray pixels to the edges, and this may strain your eyes if you looking at + them for a long time. (Your eyes will try to get the fonts sharper, which + of course is not working because they are blurred;) However, for very small + fonts, anti-aliasing may increase the readability of the fonts, because with + sharp edges, there are too little pixels available for your mind to figure + out what it means. And for bigger fonts, the edges become very jagged when + not anti-aliased, so here you also might want to have aliased fonts. Of course + you can also turn off the anti-aliasing for specific fonts. In other + operating systems, most truetype fonts are not anti-aliased between 8 and 12 + pixels, while only large Type1 fonts are anti-aliased. + + + + Use the following in your XftConfig to anti-alias only + fonts of specific sizes: + + + + + + + match + any size > 8 + any size < 15 + edit + antialias = false; + + + + + + + + + My fixed fonts do not appear or look _very_ wrong in the KDE konsole or + similar programs! + + + + I noted that somehow a lot of fixed font do not tell Xft that they are + fixed, and thus, mono spaced. Therefore only a part of the font is + displayed. We can manually set the spacing for these fonts (this assumes you + have fixed aliased with mono as in question 3 above): + + + + + + + match + any family == "mono" + edit + spacing = mono; + + + + + + + + + My Symbol, Webdings, etc. fonts do not show up! + + + + For some reason some (symbol) fonts are not correctly recognized, and Xft + will show your default font, or a font which has the closest match (which + is generally not what you mean at all). For Adobe Symbol and MS-webdings I + did the following to get them working: + + + + + + + match + any family == "webdings" + edit + antialias = false; + encoding += "glyphs-fontspecific"; + + + match + any family == "symbol" + edit + antialias = false; + encoding += "glyphs-fontspecific"; + + + + + + + A useful way of figuring out these things is to activate debugging with: + + + + + + + export XFT_DEBUG=1024 + + + + + + + This will generate a lot of output, especially if you have many fonts, + because it lists the properties and scores of every font available. You can + also use other values. For a nice summary of what happens (requested font, + XftConfig substitutions, X server additions and the finally matched font), + you can use XFT_DEBUG=2. + + + + + + Why do my KDE programs start now soooo slooow? + + + + The Xft mechanism in XFree prior to 4.1 had to parse the + XftConfig file each time a program was started. And the + info of all these fonts had to be re-read. As of X 4.1.0, a cache is used + and starting applications using Xft is much faster. Especially if you have + many fonts this can be very useful. So, upgrading XFree86, and related + packages, is a good idea. + + + + + + I have a LCD screen on my laptop, can I use sub-pixel hinting instead of + normal anti-aliasing? + + + Yes you can. Sub-pixel hinting uses colors instead of gray pixels to do the + AA. I do not have a LCD screen so I do not have any idea of how it looks + but you can play with the rgba setting. Try: + + + + + + + match edit rgba=bgr; + + + + + + + or use rgb if you have a different type of monitor. For vertical AA you can + try vbgr and vbgr. + + + + + + My fonts still look bad! + + + + Good quality fonts are needed to start with. If you do not have some good + TrueType fonts, it is worth it to go and look for them on the Internet. + Other reasons why your fonts still look bad can be because of your build of + freetype2. Snapshots versions before 2.0.2 were compiled with an option + that had some patent issues. Therefore, the standard 2.0.2 and 2.0.3 + compiles without this option. To fix this, download the freetype2 source + rpm and change in include/freetype/config/ftoption.h line 314: + + + + + + + #undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + + + + + + to: + + + + + + + #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + + + + + + and rebuild with this modified source. See the freetype2 + README file for details. Adobe Courier looks terrible + on my system, so I made an alias so that Lucida console is displayed + instead. If anyone can get it to display nicely I would appreciate knowing + about it. + + + + + + + + This is my XftConfig: + + + + + + +# +# XftConfig +# +# By: Danny Tholen +# +# Use with Type1 and TrueType fonts +# + +dir "/usr/X11R6/lib/X11/fonts/Type1" +dir "/usr/X11R6/lib/X11/fonts/drakfont" +dir "/usr/share/fonts/default/Type1" + +# +# alias 'fixed' and 'console' for 'mono' +# (some programs ask for 'mono' if they mean 'fixed';) +# +match any family == "fixed" edit family =+ "mono"; +match any family == "console" edit family =+ "mono"; + + +# +#Check users config file +# +includeif "~/.xftconfig" + + +# +# Use TrueType fonts for defaults +# Danny: disabled +#match any family == "serif" edit family += "Times New Roman"; +#match any family == "sans" edit family += "Verdana"; + + +# +# Use lucida console as default fixed type font +# and set the spacing of "mono" to 100, this +# fixes broken fonts which are fixed, but do not +# set mono-spacing. +match + any family == "mono" +edit + family += "lucida console"; + spacing = 100; + + +# +# Alias between XLFD families and font file family name, prefer local fonts +# +match any family == "Charter" edit family += "Bitstream Charter"; +match any family == "Bitstream Charter" edit family =+ "Charter"; + +match any family == "Lucidux Serif" edit family += "LuciduxSerif"; +match any family == "LuciduxSerif" edit family =+ "Lucidux Serif"; + +match any family == "Lucidux Sans" edit family += "LuciduxSans"; +match any family == "LuciduxSans" edit family =+ "Lucidux Sans"; + +match any family == "Lucidux Mono" edit family += "LuciduxMono"; +match any family == "LuciduxMono" edit family =+ "Lucidux Mono"; + + +# +# TrueType font aliases +# +match any family == "Comic Sans" edit family += "Comic Sans MS"; +match any family == "Comic Sans MS" edit family =+ "Comic Sans"; +match any family == "Trebuchet" edit family += "Trebuchet MS"; +match any family == "Trebuchet MS" edit family =+ "Trebuchet"; +match any family == "Monotype" edit family =+ "Monotype.com"; +match any family == "Andale Mono" edit family += "Monotype.com"; +match any family == "Monotype.com" edit family =+ "Andale Mono"; + + +# Danny: +# set the AA for different fonts +# +# most TT fonts do not need to be aliased between +# 8 and 15 points, although this might be a matter of taste. +match + any size > 8 + any size < 15 +edit + antialias = false; + + +# Danny: Courier looks terrible, and I +# cannot get most characters to fit nicely +# in their space. So I use courier 10 pitch +match + any family == "courier" +edit + family += "courier 10 pitch"; + + +# these are symbols, and for some reason this needs to be added!: + +match + any family == "webdings" +edit + antialias = false; + encoding += "glyphs-fontspecific"; + +match + any family == "symbol" +edit + antialias = false; + encoding += "glyphs-fontspecific"; + +match + any family == "Standard Symbols L" +edit + antialias = false; + encoding += "glyphs-fontspecific"; + +match + any family == "dingbats" +edit + antialias = false; + encoding += "glyphs-fontspecific"; + +match + any family == "Cursor" +edit + antialias = false; + encoding += "glyphs-fontspecific"; + + +# maybe arial looks better like this?: +match + any family == "Arial" + any size > 7 + any size < 15 +edit + antialias = false; + + +# end + + + + + + + + + + + + + + +GTK and GNOME + + As mentioned above, KDE and QT do have solid anti-aliasing support with + recent releases. GNOME-2 has just recently been released as of this writing + (as of Aug 2002), and does have support for anti-aliasing, though is + not in widespread use (yet). + + + + There is also the gdkxft project available at + http://sourceforge.net/projects/gdkxft/. + This will add anti-aliasing support to GTK+ 1.2 applications (only!). This is + a stand-alone library and not a patch. It will only effect GTK+ 1.x widgets + (many of them but not all). There are some limitations, but mostly it works + as advertized. Read the included README closely, and + follow the instructions. An initial installation provides a good starting + point. I added some font families to /etc/gdkxft.conf + and I used some of Danny's suggestions above, and it seems to work + mostly. It's a bit of a kludge, but quite a nice + kludge ;-) Note, sadly this project seems to be no longer maintained. + + + + + There is also a couple of ways to get this working with Mozilla! On the same + page above is a replacement library that can be substituted for the Mozilla + library of the same name. Just a drop in replacement. But, this did not work + here (on Red Hat 7.2), it segfaulted. But building Mozilla from source with + the patch listed, did indeed work nicely! This step requires gdkxft to + be working as well. So it's a two step process to get Mozilla working, but + worth the effort if you want the best looking pages IMHO. There are also + development versions of Mozilla available from + ftp://ftp.mozilla.org/pub/mozilla/nightly/experimental/xft/ + that have Xft/TrueType support (see the section + on Mozilla below). Native Mozilla Xft support is probably working + its way into mainstream releases. [Note: This should happen with Mozilla + 1.2.] + + + + + + + + + + + + +Afterword + + You've gone through all the steps, and verified that the + RENDER extension is available, but you don't perceive a + difference? Well, maybe the applications themselves just aren't there yet, + and are not able to utilize these new features. Netscape, for + instance, is not able to take advantage of anti-aliasing. + + + + + So how to know what does and does not make use of anti-aliasing? A quick test + is to use something like xmag, or gimp, and enlarge the text considerably. + Look for diagonal lines, and if they are clearly stair-stepped with no + softened edges. If so, then while anti-aliasing is technically available, it + is not being used. With anti-aliasing you should see gradients instead of + well defined sharp edges. You can compare this with xterm and + AA: + + + + + + $ xterm -fa charter -fs 14 + + + + + + You can also turn on Xft debugging: + + + + + + + + $ export XFT_DEBUG=2 + + + + + + + Then start apps from that same terminal. This will tell if anti-aliasing is + active for each font as its processed. This also gives some insight into + how Xft understands font names and other details. + + + + + One final point: anti-aliasing and TrueType are completely separate + issues. One does not depend on the other, though both together can can + enhance appearance significantly. Especially, with good quality TrueType + fonts! But any font can potentially be anti-aliased. + + + + + + + + + + + + + +Red Hat 7.x and 8.x Differences + + + + +Red Hat 7.x + + Red Hat 7.0 introduced some changes to X configuration over previous Red Hat + versions. It is also different from the stock XFree86 configuration as + addressed above. Notable differences: + + + + + + + + Both XFree86 3.3.6 and 4.x are included. If upgrading you may wind up + with 3.3.6. The X configuration file is XF86Config for + 3.3.6 and XF86Config-4 for 4.x. Of course, you'll need + to know which is which for editing and configuration purposes. + + + + + + + xfs is still handling all font duties. A default Red Hat 7.x installation + does not use the 'modules' section of XF86Config-4 for font handling. + Instead it relies on xfs, which has this capability built in. This is + different from a stock installation of XFree86 4.x where the X server does + all the font work -- including TrueType. + + + + + + + The socket for xfs is "unix/:7100" with RH 7.x, as opposed to "unix/:-1" in + previous versions (i.e. Red Hat 6.x). + + + + + + + As of Red Hat 7.1, the xfs init script actually runs + mkfontdir and ttmkfdir on + font directories known to xfs. So this step is not necessary when + new fonts are added. Just restart xfs. + + + + + + + + + + + + +Red Hat 8.0 + + Red Hat 8.0 still includes XFree86 4.2, but it includes some significant + changes! It is not clear at this time whether these are running changes + to 4.2, or Red Hat has ported changes that are scheduled to appear in + the soon to be released XFree86 4.3. Noteworthy changes: + + + + + + + XFree86 3.3.6 is no longer bundled. + + + + + XF86Config-4 is deprecated in favor of + XF86Config (X still uses the former if available + though). + + + + + The next generation of Xft is now used: Xft2! This means significant + changes to font configuration, i.e XftConfig is no + longer used in favor of /etc/fonts/font.conf, which + is now an xml document (with much of the same functionality). See + man fontconfig, and fc-cache. + + + + + The preferred location for fonts is now + /usr/share/fonts/ and ~/.fonts/. + The system will automatically recognize, and include, any fonts (including + TrueType) in these locations. See + /etc/fonts/fonts.conf. + + + + + Red Hat 8.0 of course includes GNOME-2, which has native anti-aliasing + support for GTK apps. + + + + + The xfs font server is still being used. + + + + + + + + + + + +
+ + + + + + + + + + +Adjusting Fonts in Specific Applications + + + + + +Netscape + + + Note that Netscape 4.x should be considered obsolete these days. There + are much better choices including Mozilla, Galeon and Konqueror. This + section is being maintained for historical reasons; for those users + who may have to use older Netscapes for one reason or another; and + because it may have relevance to other applications. + + + + + Let's face it, Netscape is an important application in Linux. We all use it, + and we all need it, so let's look at it specifically for a minute. An out of + the box Netscape installation is prone to the font problems we've discussed -- + large fonts that get pixelized, splotchy looking fonts, fonts so small they + are unreadable. In short, ugly. Maybe this is why you are here? + + + + + Hopefully, at this point you have followed the above suggestions. These steps + can help greatly. TrueType font availability is almost a necessity. Many web + pages specify font families -- like Arial -- that are not typically available + to Linux users. This is bad design, but having some of the basic TrueType + fonts available will help greatly in overcoming the short-sightedness of some + designers. Microsoft -- can't live with 'em, can't live without 'em. + + + + + Assuming you have TrueType working, from the Netscape menu select + Edit -> Preferences -> Fonts. Open the Variable + Width Font droplist on the right side of the window. Your TrueTypes + should be there along with other fonts. Choose which ever one suits your fancy + as the default. Check the Allow Scaling checkbox too. If + the available point sizes are 0 and 12, you can go down and, and enter your + desired point size in the box to the right and click on the + OK button. The down-side to this is that Netscape will not + remember these settings, and you will have to do this each time you start + Netscape. Unless -- you have + fonts.alias set up already. Then this will solve these + problems. See for more on fonts.alias. + + + + + You might consider experimenting with some ~/.Xdefaults (or + perhaps it's~/.Xresources on your system) settings too: + + +
+ + + + + Netscape*DocumentFonts.sizeIncrement: 10 + Netscape*documentFonts.maximumPoints: 240 + Netscape*documentFonts.xResolution*iso-8859-1: 120 + Netscape*documentFonts.yResolution*iso-8859-1: 120 + + + + +
+ + + The 'sizeIncrement' controls how much of a jump Netscape makes when different + 'basefont' sizes are specified ala: + + + + + + <basefont size=7> + + + + + for instance. The default is '20', which is a pretty good jump. Changing this + can help Netscape from scaling to too large and too small of a font. The x and + y resolutions are roughly equivalent to 'dpi' settings. Any random number + within reason can be used here. Experiment. Note: Mozilla does not use + this kind of configuration! + + + + + Then run: + + + + + $ xrdb -merge ~/.Xdefaults + + + + + (or .Xresources as the case may be) and restart Netscape. + There are many settings that can be tweaked or altered this way. Look at the + Netscape.ad (app defaults) file that should be included + with Netscape packages. + + + + If this approach does not get the job done as far as the 'tiny fonts' problem + in Netscape, then see the fonts.alias section above. You + can really fine tune many things with this approach. + + + +
+ + + + + + + + +Mozilla + + Mozilla configuration should be roughly the same in many respects, but + it does not use the Xresources type X configuration. You might find, however, + that Mozilla does a much better job of handling fonts, and pages will look + better overall. Highly recommended! The only caveat is, it seems to need a + fairly fast system. It may be pretty sluggish on older hardware. + + + + + Also, some user preferences can be stored in + user.js and + unix.js. Not to be confused with + prefs.js. user.js + will likely have to be created by hand. Put + it in whatever .mozilla sub-directory you find + prefs.js in (this is not a consistent location, but + typically ends like *.slt). Attempt to set a minimum + font size: + + + + + + + // Don't ever show me a font smaller than this: some samples. + user_pref("font.min-size.variable.", 12); + user_pref("font.min-size.variable.x-western", 12); + user_pref("font.min-size.fixed.x-western", 12); + + + + + + Other customizations can be made in userChrome.css + and userContent.css. Again, both should be placed in + the same directory as prefs.js. These files control + much of the UI (the skin outside the browser window). + + + + + More info is available from the Mozilla developers: + http://www.mozilla.org/unix/customizing.html. + + + + + It is also possbible to have anti-aliasing of fonts with Mozilla now. This + might be a bit of work to get going at this time (Aug 2002), but it is + possible. See the next section. + + + + + + + +Mozilla with Xft + + As mentioned above, the Xft extensions that give us anti-aliasing, and + improved font handling, are slowly being rolled into Mozilla development. + Such packages are often labeled as TrueType enabled. The + reasoning being that they include native support for TrueType from within + Mozilla. Note, that seems to be a bit of misnomer since properly installed + TrueType fonts work quite well, even with ancient versions of Mozilla (though + no anti-aliasing). The difference being that Mozilla does some of its own + TrueType work. + + + There are many builds of Mozilla available, and it is not so easy to know + which have Xft support. There are tips for knowing if your installed version + does have this support, and then how to enable it here: http://www.mozilla.org/projects/fonts/unix/enabling_truetype.html. + Worse comes to worse, you can download experimental versions from: ftp://ftp.mozilla.org/pub/mozilla/nightly/experimental/xft/. + + + For whatever reason, Mozilla has its own Xft configuration, that is + independent of other system components. You must turn it on, and configure + it (unless your vendor has done this already)! I know what you are saying, + one more place to configure fonts, sigh .... + + + The above page explains rather tersely how to do this. The highlights: + + + Requirements: + + + + +   ·  XFree86 4.x with Xft support. + + +   ·  FreeType2 libraries. + + +   ·  Mozilla with Xft support. + + +   ·  TrueType fonts. + + + + + + Configuration: + + + You will need to hand edit the relevant unix.js + file, which is typically installed as + /usr/lib/mozilla-*/defaults/pref/unix.js, or + a similar location. + + + You will need to enable FreeType2 (and possibly + define the version), and then list the directories that contain your TrueType + fonts (each listing must be uniquely identified, see example). Sample + excerpt: + + + + // TrueType /////////////////////////////////////////// + pref("font.FreeType2.enable", true); + pref("font.freetype2.shared-library", "libfreetype.so.6"); + + // if libfreetype was built without hinting compiled in + // it is best to leave hinting off. try it both ways to see. + pref("font.FreeType2.autohinted", true); + pref("font.FreeType2.unhinted", false); + + // below a certian pixel size anti-aliased fonts produce poor results + pref("font.antialias.min", 10); + pref("font.embedded_bitmaps.max", 1000000); + pref("font.scale.tt_bitmap.dark_text.min", 64); + pref("font.scale.tt_bitmap.dark_text.gain", "0.8"); + + // sample prefs for TrueType font dirs + //pref("font.directory.truetype.1", "/u/sam/tt_font"); + //pref("font.directory.truetype.2", "/u/sam/other/tt_font"); + pref("font.directory.truetype.1", "/usr/share/fonts/truetype"); + + + + The // characters are comments. Then restart + Mozilla. You should see it processing each font in the directories + you specified (if started from the command line). You then need to + go into the Mozilla font configuration (Edit -> Preferences + -> Appearance -> Fonts), and select the appropriate fonts — these + must be the ones that are listed with the first letter as upper + cased: + + + + Afga-monotype-arial-iso8859-1 + + + + This should now give you TrueType fonts with + anti-aliasing! Quite nice! + + + You should experiment with the hinting preferences. Having + hinting enabled made a significant improvement here. + + + + +
+ + + + + + + + + + +Odds and Ends + + + +Notes + + + + + Unfortunately there is no unified font handling system for Linux. You will have + to configure each individual program so you can use TrueType, Type 1 or fonts + that pique your fancy. And each program may well have its own way of doing + this so you will have to RTFM. Desktop Environments like GNOME and KDE may + provide much of this functionality however for apps that are under their + control. + + + + + + Most GUI apps should be able to use TrueType, and Type 1 fonts too. + Wordperfect for Linux, however, cannot use TrueType. (See the + links section below for more on Wordperfect.) Text editors, terminal programs + and the like need fixed width fonts, and do not play well with TrueType or + other proportional fonts. + + + + + + + Though not discussed here, Type 1 fonts provide many of the same benefits + as TrueType and are historically better supported in the Unix world, + especially for printing. XFree86 still seems to render TrueType somewhat + better than Type 1. You likely have many of these installed already. + Unfortunately however, Type 1 are not a web standard like TrueType. But + they are suitable for many other purposes. They are where it's at for + printing. See ghostscript + for more on this. + + + + + + While it is possible to specify a default point size for the xfs font + server, very few applications will actually use this value. + + + + + + Abiword comes with a suite of fonts, called 'Abisuite'. Apparently, + some of these fonts have the same names as some of the well known MS + TrueType fonts: Arial, etc. And apparently, these are not as good + quality. And because of the way X searches for fonts, it may find these + first and use these, even if the 'real' ones are installed and may be the + preferred choice. The solution is to either make sure your preferred fonts + come first in the FontPath or maybe to uninstall 'Abisuite' if it's not + needed. + + + + + + The new Xft rendering extensions of XFree86 4.x will mostly supplant + similar features as provided by xfs, and older XFree86 extensions. For + instance, font aliasing should be done in XftConfig + if the new extensions are being used. This would only be true where + the application is built against a toolkit (like QT or GTK) that supports + the new extensions. This is still not universally supported. + + + + + + + + + + + + + + + +Links + + + + + XFree86 Project, the guys and gals + who do an incredible amount of work to give us a killer GUI environment. An + overview of XFree86 fonts: + XFree86 4.x. + And an explanation of Xft: + http://www.keithp.com/~keithp/render/Xft.tutorial. + + + + + + The Fontconfig home page is http://fontconfig.org, for all the + latest news on Xft and fontconfig (the future of X font handling). + + + + + The + Video + Timings HOWTO, the ins and outs of getting the most from your monitor. + (Applicable only to XFree86 v.3.x for the most part.) + + + + + + Font HOWTO + Many good tips for installing fonts and for applications such as StarOffice, + Applixware, Wordperfect, Ghostscript, TeX/LaTeX. + + + + + + A TrueType HOWTO, good tips for printing, and a few application specific tips. + + + + + + xfsft Homepage, + TrueType font support for X. This is the origin of the "freetype" font module + for XFree86 4.x, and Red Hat's xfs. Good site, and good links to other + information related to fonts and TrueType. + + + + + + Some Linux for Beginners. Great font site, and other Linux topics. Covers many of the topics + discussed here in more detail. Some font and other tips for + Mozilla: http://home.c2i.net/dark/My_Mozilla_FAQ.html. + + + + + + + Two guides specifically for Debian from Paul D. Smith: + http://www.paulandlesley.org/linux/xfree4_tt.html and for 3.3.x: + http://www.paulandlesley.org/linux/debian_tt.html. + + + + + + X-TrueType Homepage, and yet + another TrueType Font server, especially good for Japanese, Chinese and Korean + character sets. [Note: link is bad 08/18/02.] + + + + + + Tips on font size problems from + Netscape. + + + + + + Wordperfect for Linux -- Fonts + and Printers by Rod Smith, the author of + Using Corel Wordperfect 8 for Linux + from Que. Excellent information on Wordperfect and where TrueType fits in. + + + + + + + + http://sourceforge.net/projects/font-tool/, + contains the core MS TrueTyep fonts suitable for web browsing. + http://packages.debian.org/unstable/graphics/msttcorefonts.html is a similar package for Debian. + + + + + + Sebastiano Vigna's + http://gongolo.usr.dsi.unimi.it/~vigna/webFonts4Linux/ automates the downloading, + extracting and installation of the Microsoft fonts all in one neat + package. + + + + + + + + + Freeware Connection + -- Free Fonts Sites lots of links to lots of sites. + + + + + + Bitstream's + Geometric Slabserif TrueType Font. + + + + + + Two converters for converting a Mac Font suitcase to a *nix + compatible font: http://www.macinsearch.com/infomac2/font/util/tt-converter-15.html + and + http://www.netmagic.net/~evan/shareware/#TTFontConvert + + + + + + The Unicode HOWTO: http://linuxdoc.org/HOWTO/Unicode-HOWTO.html + + + + + + + + Two sources of 'free' TrueType fonts with large Unicode support are + Bitstream Cyberbit, which covers Roman, Cyrillic, Greek, Hebrew, Arabic, + combining diacritical marks, Chinese, Korean, Japanese, and more, and is + available from ftp://ftp.netscape.com/pub/communicator/extras/fonts/windows/Cyberbit.ZIP. + And Lucida Sans Unicode, which is included in IBM's JDK 1.3.0beta for + Linux, and covers Roman, Cyrillic, Greek, Hebrew, combining diacritical + marks. This can be downloaded from ftp://ftp.maths.tcd.ie/Linux/opt/IBMJava2-13/jre/lib/fonts/ + as LucidaSansRegular.ttf and LucidaSansOblique.ttf. Thanks to Tzafrir Cohen + for these references. He also has a nice page on Hebrew fonts and related + topics at http://www.iglu.org.il/faq/?file=133. + + + + + + + + + + + + + + + + + +Appendix: Font Servers + + + There are several font servers available that handle TrueType: xfstt, xfsft, + and Red Hat's patched version of xfs based on xfsft. While these names are all + too similar, these are different packages. One, or more, of these should be + included with any recent Linux distribution, and you may have one installed + already. If so, use which ever one your distribution is set up to use. + + + + + + +
+xfstt + + + One such font server is xfstt. xfstt was designed specifically with TrueType + fonts in mind. + + + + + + +
+Installation + + + xfstt is very easy to install and configure. If it isn't + already installed, you'll want to download the tarball, or check your CD. The + most current version can be found at http://metalab.unc.edu/pub/Linux/X11/fonts/ + + + + + Once you have the tarball, unpack it: + + + + + + + $ tar -zxvf xfstt-*tgz + + + + + + + Then build and install it. Read the INSTALL file for + quick instructions, but it's a no brainer. + + + + + From the xfstt directory is all you have to do. + + + + + + + # make + # make install + + + + + + + Then start xfstt with: + + + + + + + # xfstt --sync # updates xfstt's font database + # xfstt & # runs xfstt in the background. + + + + + + + xfstt should be started before the X server starts. Once you have this working + correctly, you can add the above lines to + /etc/rc.d/rc.local, or other suitable start up file. Then + type: + + + + + + + $ xset +fp unix/:7101 # tells X about xfstt, and where to look for fonts. + + + + + + + or add: + + +
+ + +FontPath "unix/:7101" + + +
+ + + to your XF86Config to tell X about the font + server. Rerun xfstt --sync any time the FontPath, or + contents, change. + + +
+ + + + + + +
+Adjusting the Default Font Size + + + If your TrueType fonts appear to be very tiny, the following commands + may help. + + + + Add the -dpi switch to your X server command + line (see above to do this.) + + + + Use the --res switch to tell xfstt to increase + the default resolution. Use the following command line. + + + + + + + # xfstt --res 120 + + + + + +
+ +
+ + + + + + + +
+Red Hat's xfs + + + As of Red Hat Linux 6.0, Red Hat based distributions (Mandrake, etc) have + included a specially patched version of xfs, the XFree86 Font Server, and + patched X servers as well. Red Hat's xfs includes the xfsft patch set which in + turn is built upon the FreeType Font library. Red Hat's xfs provides similar + functionality to xfstt. xfs is able to serve both TrueType and Type 1 fonts, + as well as legacy X fonts. + + + + If you are using a Red Hat based distro, you should have xfs installed + already. If not, it is in the XFree86-xfs*rpm. To make + sure it runs as one of the default services, either use + ntsysv or: + + + + + # chkconfig --add xfs + + + + + Now xfs will start every time you boot. + + + + + + + + +
+Setting the xfs FontPath + + + The default Red Hat installation of xfs serves fonts via a Unix Domain Socket. + We'll need to tell the X server where to look for xfs, and thus fonts. The + FontPath in /etc/X11/XF86Config must include for Red Hat + 6.x: + + +
+ + + + + FontPath "unix/:-1" + + + + +
+ + + This is changed for Red Hat 7.x to: + + + + +
+ + + + + FontPath "unix/:7100" + + + + +
+ + + + + At least for a default configurations. This is a reference to the socket where + xfs is listening. You may include additional FontPaths, but these will be + handled by the X server, and not xfs. A clean install of Red Hat 6/7 should + have this already set up, but if you are upgrading from an older version, you + may have to change this yourself! + + + + + xfs then has its own, separate FontPath stored in + /etc/X11/fs/config. This is where it will look to find + fonts. This is over and above the X server's FontPath in + XF86Config. You can either add the new path(s) with a text + editor, or use the chkfontpath command: + + + + + + # chkfontpath --add /new/font/path + + + + + The FontPath must exist before running chkfontpath. The + relevant section of /etc/X11/fs/config should now look + something like this: + + +
+ + + + + +catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled, + /usr/X11R6/lib/X11/fonts/100dpi:unscaled, + /usr/X11R6/lib/X11/fonts/75dpi:unscaled, + /usr/X11R6/lib/X11/fonts/Type1, + /usr/X11R6/lib/X11/fonts/Speedo, + /usr/X11R6/lib/X11/fonts/misc, + /usr/X11R6/lib/X11/fonts/100dpi, + /usr/X11R6/lib/X11/fonts/75dpi, + /new/font/path + + + + + +
+ + + When adding a new FontPath for TrueType fonts, you will want to do this + step after installing and preparing the fonts. See the next section. + + + +
+ + + + + + +
+Getting the Fonts Ready + + + Installation and configuration is the same as for other + freetype based font renderers (e.g. XFree86-4.x + freetype module). See the above Configuration section for details. + Actually, you should just be able to install the fonts, include + the new font directory to the FontPath with + the chkfontpath utility, and then reload + xfs: + + +
+ + + + + # service xfs reload + + + + +
+ +
+
+ + + + + + + +
+xfsft + + + xfsft + is a TrueType solution from Juliusz Chroboczek. xfsft is based on the + FreeType font library as developed by Mark Leisher and others. It is + essentially is a patch for XFree86's xfs and related libraries -- xfs + ft. + Red Hat's xfs is essentially xfsft with a few minor modifications. Also, + XFree86 4.x includes the freetype font module which is also + the result of Juliusz's work, and is one of the TrueType solutions available + for XFree86 4.x. + + + + + Building xfsft requires having at least some of the XFree86 source available, + in addition to xfsft itself, so this is not for the faint of heart. + Instructions for building and configuring xfsft are in the tarball, so I won't + go into details here. They are pretty straight forward. There are links to + binaries available at the xfsft home page (see above). + + + + Note that you must also create + fonts.scale and fonts.dir files for + xfsft. fonts.scale can be created manually (ugh!), or with + the ttmkfdir utility. This is not included with xfsft but + you can get it here: http://www.joerg-pommnitz.de/TrueType/ttmkfdir.tar.gz, + or probably on many Linux archives sites too. Red Hat has this as part of the + Freetype RPM. And for Debian it is called + mkttfdir and is in the fttools + package. + + + + + + You will also need a configuration file. Here is a sample: + + + +
+ + + + +----------------------------------------------------- + +clone-self = off +use-syslog = off + +client-limit = 20 + +catalogue = /usr/local/share/font/ttfonts + +error-file = /home/jec/fonts/xfs.errors + +# in decipoints +default-point-size = 120 + +# x,y +default-resolutions = 100,100,75,75 + +----------------------------------------------------- + + + + + +
+ + + You can then run start xfsft: + + + + + + # xfs -port 7100 -config /path/to/your/config/file & + + + + + + You can then add xfsft to the X server's FontPath: + + + + + + $ xset +fp tcp/localhost:7100 + + + + + If all goes well, you could then add this FontPath to + XF86Config. + + +
+ +
+ + + + + + + +Appendix: <filename>fonts.dir</filename> to <filename>fonts.alias</filename> + + + Thanks to Aristotle Pagaltzis for providing this perl + version of a script to convert a fonts.scale + file to fonts.dir. + + + + + 9, 7 => 9, 8 => 9); + +my @font_sizes = (6..16, 18, 24); + +my %font_map = ( + "Arial" => "Arial", + "Times New Roman" => "Times New Roman", + "Verdana" => "Verdana", + "Tahoma" => "Tahoma", + "Impact" => "Impact", + "Arial Black" => "Arial Black", + "Comic Sans MS" => "Comic Sans MS", + "Georgia" => "Georgia", + "Trebuchet MS" => "Trebuchet MS", + "Courier New" => "Courier New" +); + +# Read in the fonts. +open(THEFILE, "<", $infile) or die "Cannot read $infile: $! - are you sure you are in the fonts directory?\n"; +my @fontdir = splice @{[ ]}, 1; # Strip the first line +close THEFILE; + +# Now, create the output +my @aliases; +foreach (@fontdir) { + # Get rid of the first entry, but mind that other may have + # spaces in them + my $font = join(" ", splice @{[ split ]}, 1) or die "Cannot parse $infile line: $_\n"; + + my @entries = split "-", $font; + + die "Invalid font: $font\n" unless @entries == 15; + + my $mapped_font = $font_map{$entries[2]} or next; + + # Create a bunch of aliases, for each size + for my $size (@font_sizes) { + # Do the "cheating" - fallback to size if not in the cheat map + my $real_size = $cheat_map{$size} || $size; + + # Add the entry to the aliases + push @aliases, join( + " ", + join("-", @entries[0..6], $real_size, $real_size * 10, @entries[9..14]), + join("-", @entries[0..1], $mapped_font, @entries[3..6], $size, $size * 10, @res, @entries[11..14]) + ); + } +} + +# Boast +print "Created ", scalar(@aliases), " aliases\n"; + +# Backup the existing file +if(-e $outfile) { + my $bakfile = "$outfile.bak"; + my $errormsg = "Cannot backup $outfile to $bakfile:"; + die "$errormsg file exists\n" if -e $bakfile; + rename $outfile, $bakfile or die "$errormsg $!\n" +} + +# Ok, write the file +open(THEFILE, ">", $outfile) or die "Cannot open $outfile for writing: $!\n"; +print THEFILE map "$_\n", @aliases; +close THEFILE; + +print "Wrote ", scalar(@aliases), " aliases to $outfile\n"; + +]]> + + + + +
diff --git a/LDP/retired/Game-Server-HOWTO.sgml b/LDP/retired/Game-Server-HOWTO.sgml new file mode 100644 index 00000000..c9d4d0ed --- /dev/null +++ b/LDP/retired/Game-Server-HOWTO.sgml @@ -0,0 +1,2339 @@ + + +
+ + + + Game Server HOWTO + + + Anders + Jensen-Urstad + +
+ anders@unix.se +
+
+
+ +$Id: Game-Server-HOWTO.sgml,v 1.5 2003/04/08 20:49:11 andersju Exp $ + + + +This document explains how to install, configure and maintain servers for various popular multiplayer games. + + + +
+ + + Introduction + + +This document describes how to install, configure and maintain dedicated servers for various popular multiplayer games, such as the Quake series, Half-Life/Counter-Strike and other first-person shooters. Linux makes a great operating system for game servers because of its stability and speed (not to mention it's Free). + + + + Copyright and License + + + This document is (c) 2001-2002 Anders Jensen-Urstad. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html. + + + + + + + History + + +I wrote this document because I couldn't find any decent documents covering more than one game. Wading through piles of readmes, guides, howtos and webpages can be quite tedious. + + + + + + + 1.0 + 2002-12-16 + aju + + + Added KTeams Pro to QW. Updated most version numbers and links. Removed the actual GFDL from the document. Many minor changes. + + + + + 0.99 + 2001-07-08 + aju + + + Changed license, minor fixes. + + + + + 0.23 + 2001-03-03 + aju + + + Revised and changed Half-Life/Counter-Strike. + + + + + 0.22 + 2001-01-28 + aju + + + Added Rocket Arena 3 and Alliance to Quake3. + + + + + + 0.22 + 2001-01-26 + aju + + + Added Security and permissions, revised QuakeWorld; added QuakeForge. Revised LMCTF. Added Lithium II, L-Fire DM and L-Fire CTF. Revised Q2Admin. + + + + + 0.21 + 2001-01-15 + aju + + Updated Half-Life/Counter-Strike. Added Rocket Arena to QuakeWorld. + + + + + 0.20 + 2001-01-14 + aju + + First draft. + + + + + + + + + + New versions + + + The newest version of this document can be found at its homepage http://x.unix.se/howto/ (both HTML and its SGML source). + Other versions may be found in different formats at the Linux Documentation Project. + + + + + + Credits + + + I've gathered information from lots and lots of different READMEs, HOWTOs, web pages, and of course personal experience. + The Unreal Tournament section was written by Knight Walker kwalker@aros.net. + + + + + + + Christer vendor@nfn.net helped with some parts about QuakeWorld. + + + + + + The Quake-HOWTO by Bob Zimbinski bobz@mr.net gave info about various things. + + + + + + The Q2 Server FAQ. + + + + + + http://www.atomicage.com:80/quake/server/server_cfg/. + + + + + + http://www.planethalflife.com/server/. + + + + + + Lots of Counter-Strike info from http://server.counter-strike.net. + + + + + + #nucdawn@EFnet, unix.se, #unix.se@freenode + + + + + + id Software for making the best multiplayer games. + + + + + + Dave "Zoid" Kirsch for making Threewave CTF for all the Quake games and for the Linux ports! + + + + + + Loki Entertainment Software for their work on Quake3 and for everything they contributed to the Linux and open-source community. + + + + + + + + + + Feedback + + If you have any questions, comments, suggestions, corrections or whatever, please mail them to anders@unix.se. + + + + + + + + Basics + + +Game servers can consume a lot of CPU and bandwidth (depending on the game and the number of connected players). If you don't own the machine and want to run a server from your account, ask the system administrator first. + + + + Security and permissions + + + All dedicated servers are strongly recommended to be run from another user than root. I recommend that you create a new user that handles all the game servers. You may not have permission to create certain directories mentioned in this document as a normal user, for example /usr/local/games/quake3. If so, create it as root and then chown user:group /usr/local/games/quake, where user is your username and group your group, or simply create it in your home directory. + + + + + + Keeping the server running + + If your game server crashes, a shell script like the one below might come in handy so you won't have to restart it manually. It can easily be modified for whatever server(s) you're running. + + + +#!/bin/sh + +quake3dir="/usr/local/games/quake3" +process=`ps auxw | grep linuxq3ded | grep -v grep | awk '{print $11}'` + +if [ -z "$process" ]; then + + echo "Couldn't find Quake3 running, restarting it." + cd "$quake3dir" + nohup ./linuxq3ded +exec ffa.cfg & + echo "" + +fi + + + +Put the script somewhere, name it sv_up or whatever you like, and make cron run it every 5-10 minutes: + + + +*/10 * * * * /usr/local/games/quake3/sv_up.sh >/dev/null 2>&1 + + +Put this in crontab (crontab -e). It will execute sv_up.sh (the shell script above) every 10 minutes and its output is sent to /dev/null (in other words, it disappears instead of being mailed to you). + + + + + + + + QuakeWorld + + + QuakeWorld is a multiplayer-only version of Quake with optimized network code. id Software released the source code for Quake/QuakeWorld in 1999, spawning a number of projects set out to improve, optimize and add more features to the code and make it more secure. QuakeForge is quite well-developed on the client side, but mvdsv (part of the qwextended project) seems to be the most popular server in the QW community. It's famous for its ability to record demos from each player's POV (Point of View) and store them for retrieval by the players. + + + System requirements + + +Here are the minimum system requirements for the QW (QuakeWorld) server. Remember that the requirements vary depending on the number of clients. + + + + + + + + Pentium 90 or better + + + + + + 16 MB RAM + + + + + + The *.pak files from the Quake CD-ROM + + + + + + Kernel 2.0.24 or later + + + + + + Enough free space on your HDD (depends on what you want to install; at least 40-70 MB) + + + + + + + + + Installing + + + id Software's old qwsv is quite dated and should not be used (nor can it be used in most cases, since it's built for the ancient libc5). So, use either mvdsv or QuakeForge. + + + + Note: Both mvdsv QuakeForge are actively being developed (more or less), and it's highly possible that newer versions than the ones linked below have been released, so check http://qwex.does.it/ or http://quakeforge.net/files.php before you proceed further. + + + + + + + + mvdsv 0.165b source + + + + + + mvdsv 0.165b binary (glibc 2.1.3) + + + + + + QuakeForge 0.5.2 source + + + + + + + + +Create a directory for the QW server in your home directory: + + + +$ mkdir quake + + + + If you downloaded the mvdsv source: + + + +$ tar zxvf qwex_src-0.165b.tar.gz +$ cd mvdsrc +$ make build_sv +$ cp releasei386-glibc/mvdsv ../quake + + + + If you downloaded the mvdsv binary: + + + +$ gunzip mvdsv.0.165b.linux.glibc2.1.3.gz +$ mv mvdsv.0.165b.linux.glibc2.1.3 mvdsv +$ chmod +x mvdsv +$ mv mvdsv quake/ + + + + If you downloaded the QuakeForge source: + + + +$ tar zxvf quakeforge-0.2.99beta6.tar.gz +$ cd quakeforge-0.2.99beta6 +$ ./configure --prefix=$HOME/quake --bindir=$HOME/quake; make; make install + + + + This will at least build qf-server, nq-server (RealQuake) and some client binaries. We don't need the latter; you can choose not to compile them, or simply remove them later. Anyway, if the compilation went fine you should now have a binary called qf-server in $HOME/quake, where $HOME is your home directory (usually /home/user). + + + +You might want to rename mdsv or qw-server to qwsv, since that's what I'll call it in the rest of this document. Now create the directory id1 in the quake directory and copy the pak0.pak and pak1.pak files from your Quake CD or wherever you have them into that directory: + + + +$ cd ~/quake +$ mkdir id1 +$ cp /some/where/id1/pak*.pak id1 + + + +You also need the qw files: + + + + + +qwsv230.zip + + + + + +Unzip it in your quake directory: + + + +$ cd ~/quake +$ unzip qwsv230.zip + + + +Now you're ready to run qwsv. Start it by running ./qwsv in the quake directory. It should work fine (if not, make sure all the filenames are in lower-case). Try connecting to your server with a client. + + + + + Configuring + + + Now it's time to configure your QW server. Make a server.cfg file in the id1 directory containing the following: + + +sv_gamedir qw +deathmatch 1 +hostname "QW testserver" +serverinfo admin "webmaster@xyz.com" +serverinfo url "http://url.net" +rcon_password xxxx +timelimit 35 +fraglimit 150 +noexit 1 +pausable 0 +samelevel 2 +maxclients 16 +map dm3 +floodprot 4 8 30 +floodprotmsg "You have activated the flood protection and will be silenced for 30 seconds" +maxspectators 2 +allow_dowload 1 +allow_download_skins 1 +allow_download_models 1 +allow_download_sounds 1 +allow_download_maps 1 + + + +As you can see the server.cfg file contains all kinds of variables the server uses. + + + + +-master IP-address - Command line parameter. Connects to the specified master server. QWSV starts in masterless mode by default. + +-port - Specifies which port the server will listen to, default is 27500. +gamedir - Which game directory you want to use. Change it if you want to run a mod. The QW directory is used by default. +deathmatch - Can be set to 1, 2 or 3. 1 = Normal deathmatch; Weapons/items can be picked up and respawned (30 sec respawn time). 2 = Weapon stay. You can only pick up a weapon once, ammo & armor doesn't respawn. 3 = Combination between 1 and 2. You can only pick up a weapon once, ammo respawns after 15 seconds, everything else respawns normally. +hostname - Servername. +serverinfo admin - The admin's e-mail address. +serverinfo url - Server URL. +timelimit - Match ends when timelimit (specified in minutes) is reached. +fraglimit - Match ends when fraglimit is reached. +maxclients - Max number of players. +map mapname - Map that will be played. +maxspectators - Max number of spectators. +password - Password protect the server. Clients must set a matching password to be able to connect. +rcon_password - Password used for remote administration. +allow_download - Set this to 1 to allow clients to download files they don't have from the server. + + + + +$ ./qwsv > /dev/null & + + + +The above command runs the qwsv server in the background and sends the output to /dev/null (if you want to log the output, just replace /dev/null with /blah/qw.log or whatever). -port specifies the port the server will use; QW's default is 27500. +For a complete list of commands and the official QW manual, see QuakeWorld.net. For a list of special commands that can be used with mvdsv, see the qwex readme. + + + + +Threewave CTF (Capture The Flag) + + +Capture The Flag, or CTF for short, is - or was, at least - the most popular Quake modification. There are many different CTF variants. Threewave CTF is the original and most popular CTF modification for QW. +You need the following files: + + + + +ftp://ftp.sunet.se/planetquake/threewave/ctf/server/3wave42.zip - All the server files. +ftp://ftp.sunet.se/planetquake/threewave/ctf/server/3wave421.zip - Some bugs fixed (4.2 is required). +ftp://ftp.sunet.se/planetquake/threewave/ctf/client/3wctfc.zip - All the CTF maps. + + + +Create a ctf directory and extract all the files you downloaded to it: + + + +$ cd ~/quake +$ mkdir ctf +$ unzip 3wave42.zip -d ctf +$ unzip 3wave421.zip -d ctf +$ unzip 3wctfc.zip -d ctf + + + +Now try to start the server (if you don't specify a map it'll default to an interesting modified version of Quake's start level): + + + +$ ./qwsv +gamedir ctf +map ctf1 + + + +For more information, read ctf/server.txt. + + + + + + +Kombat Teams Pro + + +Kombat Teams is a very popular mod that's been around for a long time. Most QW servers run it. KTeams greatly simplifies all forms of DM games by supplying commands to set teams, timer, readiness and much more. + + + +Download the following: + + + + +http://www.wsb.poznan.pl/~pawel/q/q/ktpro/ktpro.1.57.tar.gz + + + +Extract it in your quake directory: + + + +$ tar zxvf ktpro.1.57.tar.gz + + + +Start the server: + + + +$ ./qwsv +gamedir ktprosrv + + + +Default is a 1on1 server. To start a 2on2 server you'd add +exec 2on2.cfg, or +exec 4on4.cfg for a 4on4 server, or +exec free.cfg for a free for all server. KTPro comes with a bunch of scripts which do this; ktpro1on1, ktpron2on2, etc. in the quake directory. Check out all the configuration examples in ktprosrv/ and the documentation in ktpro.doc/. + + + + + + + Rocket Arena + + + Rocket Arena is a very exciting modification. It's one-on-one games with the simple rule "winner stays, loser goes". Each player waits for his/her turn to fight in the arena. Every player gets full armor (200), 100 health and all weapons when they enter the arena. The winner stays to fight again, the loser goes back to the line. Simple? Yes. Boring? Not at all! + + + + Now, on to installing this modification. Get the following files: + + + + +ftp://ftp.sunet.se/pub/games/PC/idgames2/planetquake/servers/arena/fasrv12.zip - All the server files. +ftp://ftp.sunet.se/pub/games/PC/idgames2/planetquake/servers/arena/farena12.zip - The required client files (maps and sounds). + + + + +Create a directory called arena in your quake directory and unzip the above files to it: + + + +$ cd quake +$ mkdir arena +$ unzip ~/fasrv12.zip -d arena +$ unzip ~/farena12.zip -d arena + + + +Start the server: + + + +$ ./qwsv +gamedir arena +setmaster 204.182.161.2 +exec rotate.cfg +maxclients 6 +timelimit 20 +fraglimit 15 + + + +For the map rotation you can choose one of the following (of course you can edit these or make your own, remember that the last map must loop to the first): + + + + +rotate.cfg - All the Final Arena maps. +newmaps.cfg - The new Final Arena and the TF arena maps. +classic.cfg - The most popular older Arena maps. + + + + + + + + +Quake II + + + Quake II is the sequel to Quake, featuring great multiplayer capabilities just like its prequel. + + + + System requirements + + + As always, the minimum system requirements vary depending on the number of clients. + + + + +A Pentium-class processor or better is recommended. More players = more CPU. +At least 16 MB RAM. 1 MB per player is recommended. +Some maps require more CPU/RAM than others. +The *.pak files from the Quake II CD-ROM. +Enough free space on your HDD, at least ~500 MB. +If you're going to run a Q2 server on the Internet, make sure you have enough bandwidth. The more players the more bandwidth you need. + + + + + + + Installing + + +To start a Q2 server you need the Q2 client package and the pak files from the Q2 CD. Download the one that suits your system (glibc, unless your distribution is really ancient): + + + + + ftp://ftp.sunet.se/pub/pc/games/idgames2/idstuff/quake2/unix/quake2-3.20-glibc-i386-unknown-linux2.0.tar.gz + ftp://ftp.sunet.se/pub/pc/games/idgames2/idstuff/quake2/unix/quake2-3.20-i386-unknown-linux2.0.tar.gz + + + + +Create a directory for Q2 and extract the Q2 client package to it: + + + +$ mkdir quake2 +$ tar zxvf quake2-3.20-glibc-i386-unknown-linux2.0.tar.gz -C quake2 + + + +Now create a baseq2 directory inside the quake2 directory and copy the pak files to it from the Q2 CD-ROM: + + + +$ mkdir quake2/baseq2 +$ cp /mnt/cdrom/baseq2/*.pak quake2/baseq2 + + + +Go to the Quake2 directory and start the server: + + +$ cd quake2 +$ ./quake2 +set dedicated 1 +set deathmatch 1 + + + +It should work fine and people should be able to connect to it. + + + + + + Configuring + + +You'll want to create a server config (cfg) file. Put the following in a file called server.cfg in the baseq2 directory and modify it as you like: + + + +set hostname "Q2 testserver" +set deathmatch "1" +set rcon_password "xxxx" +set timelimit "30" +set fraglimit "100" +set maxclients "16" +set allow_download "1" +set allow_download_players "0" +set allow_download_models "1" +set allow_download_sounds "1" +set allow_download_maps "1" + + + +Settings: + + + +dmflags - A bitflag, controls gameplay options. +fraglimit - Next map is loaded when fraglimit is reached. +timelimit - Next map is loaded when timelimit is reached. +map - Which map to start. +maxclients - Max number of players. +hostname - Name of the server. +deathmatch - If you want to play DM (deathmatch), set this to 1. +game - Which mod directory to use, if you want to play a mod. +port - Which port you want the server to listen to. + + + +Now start the server with ./quake2 +set dedicated 1 +exec server.cfg. Your config file will be read and the variables in it will be used. +You can have different config files for different game types, for example ffa.cfg, ctf.cfg, etc. with customized settings. They should all be in the baseq2 directory. + + + +To have your server listed on the master servers (so people using GameSpy, XQF and similar programs can see your server), type set public 1 in the server console or in the config file. +With the command set setmaster 'master server' you can change master server (default is id Software's master server). + + + + + + Q2CTF (Capture The Flag) + + + Download one of the following (you'll most likely want the glibc one, unless your distribution is ancient). + + + + + ftp://ftp.sunet.se/pub/pc/games/idgames2/idstuff/quake2/ctf/unix/q2ctf150-glibc-i386-unknown-linux.tar.gz + ftp://ftp.sunet.se/pub/pc/games/idgames2/idstuff/quake2/ctf/unix/q2ctf150-i386-unknown-linux.tar.gz + + + + +It only contains the file gamei386.so. Create a ctf directory in your Q2 directory and extract the q2ctf archive: + + + +$ mkdir quake2/ctf +$ tar zxvf q2ctf150-glibc-i386-unknown-linux.tar.gz -C quake2/ctf + + + +You'll also want the Q2CTF package with the CTF maps, ftp://ftp.sunet.se/pub/pc/games/idgames2/idstuff/quake2/ctf/q2ctf150.zip (9.1 MB). Unzip it to the ctf directory. +To start a CTF server, run ./quake2 +set dedicated 1 +set game ctf +exec server.cfg, where server.cfg is a file you should create in the ctf directory, containing this: + + + +deathmatch 3 +maxclients 12 +rcon_password password +fraglimit 0 +timelimit 30 +set hostname "Q2CTF Testserver" +set admin "admin@xyz.com" +map q2ctf1 + + + + + + LMCTF (Loki's Minions CTF) + + +LMCTF, Loki's Minions CTF, is a popular CTF modification for Q2. You need all the following files: + + + + +ftp://ftp.sunet.se/planetquake/lmctf/lm520-linux_bin.zip +ftp://ftp.sunet.se/pub/games/PC/idgames2/planetquake/lmctf/lmctf456.zip +ftp://ftp.sunet.se/pub/games/PC/idgames2/planetquake/lmctf/lmctf50.zip + + + + +Create a lmctf directory in your Q2 directory and unzip all the files to it. +Go to the Q2 root directory and start with the following command: + + + +$ ./quake2 +set dedicated 1 +set deathmatch 1 +set game lmctf +exec server.cfg + + + +There are some files in the lmctf directory that you'll probably want to edit: server.cfg is the main cfg file containing many standard server options. maplist.txt contains the list of maps the server cycles through. +To alter the map list, create a file in your root Q2 directory called maplist.txt containing the names of the maps and add +map mapname to the command line when you start the server, where mapname is the name of the first map in the maplist.txt you just created. +The file motd.txt contains the "message of the day" clients will see when joining the server. + + + +For more information on LMCTF, see its homepage. + + + + + + Rocket Arena 2 + + +To run a Rocket Arena 2 server you need the following files: + + + + +ftp://ftp.sunet.se/pubi/pc/games/idgames2/planetquake/servers/arena/ra2250sv.zip +ftp://ftp.sunet.se/pubi/pc/games/idgames2/planetquake/servers/arena/ra2250cl.exe - required client files (maps and such). + + + + +Create a directory called arena in your quake2 directory and extract the above files: + + + +$ cd quake2 +$ mkdir arena +$ unzip ra2250sv.zip -d arena +$ unzip ra2250cl.exe -d arena + + + +Edit server.cfg to your liking. Another file that you may want to edit is arena.cfg, which is used to customize settings on a per arena basis as well as map rotation information. Start the server: + + + +$ ./quake2 +set dedicated 1 +set game arena +exec server.cfg + + + + + + + + Lithium II + + + Lithium II is a very popular and configurable server-side deathmatch mod, adding things like the grappling hook and letting you configure pretty much everything; see its readme.txt file for more information. Download the following file: + + + + +ftp://ftp.sunet.se/pub/games/PC/idgames2/planetquake/lithium/lithium2_1.24-i386-unknown-linux2.0.tar.gz + + + + +Extract the file in your quake2 directory. All the files will be placed in a new directory called lithium: + + + +$ cd quake2 +$ tar zxvf lithium2_1.24-i386-unknown-linux2.0.tar.gz + + + +Lithium II comes with four different config files, copy one of them to server.cfg and modify it to your liking: + + + + +lithium.cfg - default Lithium II server. +stock.cfg - stock Quake2 server. +lithctf.cfg - default Lithium II CTF server. +stockctf.cfg - stock CTF server. + + + + +Start a deathmatch server with the following command: + + + +$ ./quake2 +set dedicated 1 +set game lithium +exec server.cfg + + + +To start a CTF server, you must have Q2CTF installed. Extract the lithium archive to your ctf directory and start with the following command: + + + +$ ./quake2 +set dedicated 1 +set game ctf +set ctf 1 +exec server.cfg + + + + + + + L-Fire DM + + + L-Fire DM is a server-side mod that adds many features to Q2, such as organized match support, anti-spam, highscore lists for each level, profanity filtering, etc. What you need: + + + + +ftp://ftp.sunet.se/pub/games/PC/idgames2/planetquake/lfire/LFireDM_v1_11_Linux.tar.gz +ftp://ftp.sunet.se/planetquake/lfire/LFireDM_v1_11_Config.tar.gz + + + + +You can run L-Fire DM from either the baseq2 directory (in that case it'll show up as a standard DM mod in GameSpy and similar tools, or you can give it its own directory (lfiredm or whatever you prefer). Extract the archive (actually, it only contains two files, gamei386.so and readme.txt), or in other words place gamei386.so in your directory of choice. + + + +$ cd quake2 +$ mkdir lfiredm +$ tar zxvf LFireDM_v1_11_Linux.tar.gz -C lfiredm + + + +LFireDM_v1_11_Config.tar.gz contains many config files which you may want to edit. Extract it to the directory where you put gamei386.so: + + + +$ tar zxvf ~/LFireDM_v1_11_Config.tar.gz -C lfiredm + + + +Start the server: + + + +$ ./quake2 +set dedicated 1 +game lfiredm + + + + + + L-Fire CTF + + +L-Fire CTF is like L-Fire DM a server-side mod that adds many features to Q2CTF like match support, anti-spam, highscore lists for each level, rocket arena/sudden death overtime, etc. What you need: + + + + +ftp://ftp.sunet.se/pub/games/PC/idgames2/planetquake/lfire/LFireCTF_v1_20_Linux.tar.gz +ftp://ftp.sunet.se/pub/games/PC/idgames2/planetquake/lfire/LFireCTF_v1_20_Config.tar.gz + + + + +Extract the archive to your Q2CTF directory: + + + +$ cd quake2 +$ tar zxvf LFireCTF_v1_20_Linux.tar.gz -C ctf + + + +LFireCTF_v1_20_Config.tar.gz contains a bunch of configuration files which you may want to edit. Extract it to the Q2CTF directory: + + + +$ tar zxvf LFireCTF_v1_20_Config.tar.gz -C ctf + + + +Start the server just as you normally would: + + + +$ ./quake2 +set dedicated 1 +game ctf + + + + + + Q2Admin + + +Q2Admin is a very good transparent proxy modificatiom that adds many admin functions, and the most important, ZBot/Ratbot (among other things) detection to preven cheating. +Q2Admin works with all Q2 mods transparently by filtering communication between the server and the mod it's running on top of. +I recommend that you install Q2Admin if you're going to run a public server. Download this file: + + + + +ftp://ftp.sunet.se/planetquake/q2admin/q2admin18src.tar.gz + + + + +Now extract the archive and compile it: + + + +$ cd quake2 +$ mkdir q2admin +$ tar zxvf q2admin18src.tar.gz -C q2admin +$ cd q2admin; make + + + +Now you should have a file called q2admin.so in the q2admin directory. For each mod you want to protect with Q2Admin, copy the install and q2admin.so files to each mod directory and optionally the *.txt files if you want to customize the Q2Admin settings for different mods. +Run install, ./install (chmod +x install if it's not executable) and start the server as usual. The install script moves gamei386.so to gamei386.real.so and q2admin.so to gamei386.so. Run install again to move the files back to their original names. +There's a huge number of commands; See readme.txt included in the q2admin package for everything you need to know. + + + + + + + + Quake III Arena + + + Quake III is the latest game in the Quake series, designed as a multiplayer deathmatch game. + + + + System requirements + + + As always, the system requirements vary depending on the number of players on your server. + + + + +Pentium II 266MHz. More CPU = more players. +At least 64 MB RAM. +Kernel 2.2.9 or higher, glibc 2.1. +The *.pk3 files from the Quake III Arena CD-ROM. +At least ~500 MB free space on your HDD. +Enough bandwidth if you're going to run an Internet server. More players = more bandwidth. + + + + + + + Installing + + +First download the latest Q3A Linux point release. As of this version of the HOWTO it's v1.32b, but that may have changed when you read this. + + + + +ftp://ftp.sunet.se/pub/pc/games/idgames2/idstuff/quake3/linux/linuxq3apoint-1.32b.x86.run + + + + +Run the installer: + + + +$ sh linuxq3apoint-1.32b.x86.run + + + +The default installation directory is /usr/local/games/quake3. Copy the *.pk3 files from the Q3A CD-ROM to the baseq3 directory. + + + +$ cp /mnt/cdrom/Quake3/baseq3/*.pk3 /usr/local/games/quake3/baseq3 + + + +Go to the Q3 directory and test the dedicated server, ./q3ded. + + + + + + Configuring + + +Now it's time to write some config files. They contain all the variables the server will use (maps to be played, gametype, etc..). All cfg's must be in the baseq3 directory. The file q3config.cfg is always executed. +I recommend that you have different cfg's for different gametypes, for example ctf.cfg, ffa.cfg, and so on. You can use q3config.cfg for general settings, and then another cfg on top of it. +Run ./linuxq3ded +exec configfile.cfg to start the dedicated server and execute the specified config file. +This is what my FFA (Free For All) config file looks like: + + + +set sv_hostname "Foofighters FFA DM" +set sv_maxclients 10 +set g_motd "To be or not to be..." +set g_forcerespawn 15 +set rconpassword "password" +set g_gametype 1 +set fraglimit 50 +set timelimit 20 + +//Here's the map-cycle. When fraglimit or timelimit is reached, the map is automatically changed. +//Otherwise it would just play the same map again. +set m1 "map q3dm1; set nextmap vstr m2" +set m2 "map q3dm2; set nextmap vstr m3" +set m3 "map q3dm3; set nextmap vstr m4" +set m4 "map q3tourney1; set nextmap vstr m5" +set m5 "map q3dm4; set nextmap vstr m6" +set m6 "map q3dm5; set nextmap vstr m7" +set m7 "map q3dm6; set nextmap vstr m8" +set m8 "map q3tourney2; set nextmap vstr m9" +set m9 "map q3dm7; set nextmap vstr m10" +set m10 "map q3dm8; set nextmap vstr m11" +set m11 "map q3dm9; set nextmap vstr m12" +set m12 "map q3tourney3; set nextmap vstr m13" +set m13 "map q3dm10; set nextmap vstr m14" +set m14 "map q3dm11; set nextmap vstr m15" +set m15 "map q3dm12; set nextmap vstr m16" +set m16 "map q3tourney4; set nextmap vstr m17" +set m17 "map q3dm13; set nextmap vstr m18" +set m18 "map q3dm14; set nextmap vstr m19" +set m19 "map q3dm15; set nextmap vstr m20" +set m20 "map q3tourney5; set nextmap vstr m21" +set m21 "map q3dm16; set nextmap vstr m22" +set m22 "map q3dm17; set nextmap vstr m23" +set m23 "map q3dm18; set nextmap vstr m24" +set m24 "map q3dm19; set nextmap vstr m25" +set m25 "map q3tourney6; set nextmap vstr m1" + + + + +sv_maxclients - Max number of players. +g_motd - The message people will see on the bottom of the screen when they connect. +g_forcerespawn - Number of seconds until a client is automatically respawned, if the client doesn't do it by itself. Set it to 0 to disable force respawn. +g_gametype - Gametype. 1 = DM, 2 = Tourney (1on1), 3 = Team DM, 4 = CTF. + + + + +Start the server with ./q3ded +exec configfile.cfg. You can execute cfg's directly from the server console with the command exec configfile.cfg. +If you want to run the server in the background, immune to hangups, start using nohup ./q3ded +exec ffa.cfg &. + + + + + + Q3CTF (Capture The Flag) + + +CTF is built into Q3A (Q3CTF). Four CTF maps are included with Q3A, but you will want to download Dave 'Zoid' Kirsch's (the author of CTF for Q1/Q2/Q3) excellent Q3WCTF maps - ftp://ftp.sunet.se/pubi/pc/games/idgames2/planetquake/mappacks/q3wctf.zip (7.8 MB). +Here's a CTF cfg which includes all CTF maps in the mapcycle. Paste it in a new file, ctf.cfg, in the baseq3 directory: + + + +set sv_hostname "Foofighters CTF" +set sv_maxclients 16 +set g_motd "To be or not to be.." +set g_forcerespawn 10 +set rconpassword "password" +set g_gametype 4 + +set m1 "capturelimit 8; map q3ctf1; set nextmap vstr m2" +set m2 "capturelimit 8; map q3ctf2 ; set nextmap vstr m3" +set m3 "capturelimit 8; map q3ctf3 ; set nextmap vstr m4" +set m4 "capturelimit 8; map q3wctf1 ; set nextmap vstr m5" +set m5 "capturelimit 8; map q3wctf2 ; set nextmap vstr m6" +set m6 "capturelimit 8; map q3wctf3 ; set nextmap vstr m1" + +vstr m1 + + + +Start with ./q3ded +exec ctf.cfg. + + + + + + Rocket Arena 3 + + +Rocket Arena 3 is the popular Quake3 version of Rocket Arena. You need the following files: + + + + +ftp://ftp.sunet.se/pube/os/FreeBSD/ports/distfiles/ra315sv.zip +ftp://ftp.sunet.se/pube/os/FreeBSD/ports/distfiles/ra315cl_linuxmac.zip - required client files (maps). + + + + +Create a directory for RA3 and extract the files: + + + +$ cd /usr/local/games/quake3 +$ mkdir arena +$ unzip ~/ra315sv.zip -d arena +$ unzip ~/ra315cl_linuxmac.zip -d arena + + + +Edit server.cfg to your liking. Start the server with the following command: + + + +$ ./q3ded +set fs_game arena +set sv_pure 0 +bot_enable 0 +set dedicated 2 +set net_port 27960 +exec server.cfg + + + +Use +set dedicated 1 to run a private server or +set dedicated 2 to run a public. For more info on RA3 configuration options, read readsrv.txt in your arena directory. + + + + + + Alliance + + +Alliance is a popular CTF/DM mod. It offers three different game styles: + + + + +Alliance - Enhanced CTF with offhanded grappling hook (players can use the grapple and shoot their weapons at the same time). +Combat - Resembles the mod Expert Q2. Players spawn with all weapons plus health and ammo regenerate. Slightly different weapons balance, physics and grappling hook style. +Instagib - An interesting (and very entertaining) game type where players spawn with an enhanced rail gun with an infinite ammount of ammo. When you shoot your enemy they are instantly gibbed (killed), so health is not an issue here (also, the rail gun is the only weapon). + + + + +All the above game styles can be played as CTF, FFA, Team DM or Tourney. Note that the mod was made with CTF in mind. Anyway, you need the following files: + + + + +http://www.hlrs.de/people/frenzel/actf/alliance30.zip +http://www.planetquake3.net/download.php?op=viewdownloaddetails&lid=731&ttitle=Alliance_3.3_Upgrade_from_3.0_(.ZIP) - 3.0 to 3.3 upgrade. + + + + +Extract the files: + + + +$ cd /usr/local/games/quake3 +$ unzip ~/alliance30.zip +$ unzip ~/alliance30-33.zip + + + +Now start the server running your desired gametype. Alliance: + + + +$ ./q3ded +set dedicated 2 +set fs_game alliance30 +g_gametype 4 +exec sv_alliance.cfg +map actf13 + + + +Combat: + + + +$ ./q3ded +set dedicated 2 +set fs_game alliance30 +g_gametype 4 +exec sv_combat.cfg +map actf13 + + + +Instagib: + + + +$ ./q3ded +set dedicated 2 +set fs_game alliance30 +g_gametype 4 +exec sv_instagib.cfg +set fs_basepath $(/bin/pwd) +map actf13 + + + +Edit maplist.cfg to change the map rotation. Two large Alliance map packs can be downloaded from its homepage. + + + + + + + + Half-Life + Half-Life is the most popular multiplayer first-person shooter on the Internet as of this version of the HOWTO - mainly thanks to the modification Counter-Strike, hereafter referred to as CS. + + + + System requirements + + + The system requirements vary depending on how many players you have on your server. + + + + +CPU - Depends on the number of clients. At least P2 266 for hosting a full game, the more the better. 400MHz recommended. +RAM - Minimum 64 MB, 128 MB recommended. +Bandwidth - Also depends on the number of clients. At least 512kbps upstream recommended. + + + + + + + Installing + +You need the HLDS (dedicated server) package to run a Half-Life server: + + + + +ftp://3dgamers.in-span.net/pub/3dgamers2/games/halflife/hlds_l_3110_full.bin + + + + +When you've downloaded the above file, create a directory for HLDS and run the downloaded file (specify $HOME/hlds as the directory to install to, if that's what you want): + + + +$ mkdir hlds +$ sh hlds_l_3110_full.bin + + + +Now we want hlds to see its dynamically linked libraries (*.so files). If you're running bash, which you most probably are, run: + + + +$ export LD_LIBRARY_PATH=$HOME/hlds:$LD_LIBRARY_PATH + + + +This adds $HOME/hlds to the directories ld checks for libraries in. + + + + + + Configuring + +Now you can start hlds; ./hlds_l to start a dedicated Half-Life server. It should work with the default settings, so try it: + + + +$ hlds_l +maxplayers 12 +map crossfire + + + +At the end you should see something like this: + + + +WON Auth Server + . . . + + + +If the 'Auth' is missing it's probably because your server is using an incorrect IP address. Type status in the server console and it will spit out some info. +If your IP isn't what it should be, quit the server with the exit command and start it again with this command: + + + +$ ./hlds_l +ip xx.xx.xx.xx +maxplayers 12 +map crossfire + + + +If it doesn't work now, you might be behind a firewall. If that's the case, let's just hope the network admin is friendly - make him open the port(s) you need. 27015 is the default port. + + + +If you want to run a modification instead of regular DM or teamplay, pass the -game modname argument to hlds. Example: ./hlds_l -game tfc +maxplayers 12 +map 2fort. + + + +The server reads autoexec.cfg, server.cfg, motd.txt and mapcycle.txt. Edit these to your liking. Autoexec.cfg is only executed when you start the server. Server.cfg is executed at every map change. Motd.txt contains the text that players will see when they join your server; a good idea is to put your server name, homepage (server stats page?) and contact info in it. Mapcycle.txt contains the list of maps you want rotated on your server. Type in all the maps you want there, each on its own line, without the ".bsp" extension. + + + + +sv_aim - Setting this to 1 causes the crosshairs to turn red when placed over a player. +pausable - Clients are allowed to pause the server. +mp_timelimit - Server changes map when timelimit (in minutes) is reached. +mp_fraglimit - Server changes map when fraglimit is reached. +mp_footsteps - Setting this to 0 turns off footsteps. +mp_flashlight - Clients can use flashlights (useful on dark maps). +mp_falldamage - Realistic fall damage. +mp_friendlyfire - Allows players to kill people on the same team. More realistic, but this can be very problematic without active admins playing on the server, so on public servers it might be a good idea to set this to 0 to avoid lamers killing their own team members. + + + + +Min/max rates - The commands sv_maxrate xxxx and sv_minrate xxxx force clients to use the specified rate. +This is useful if you, for example, don't want LPB's stealing bandwidth (which makes HPW's annoyed) - type sv_maxrate 6000 to do this. If you on the other hand want to run a server for LPB's, +set the minimum rate to something around 9000 with sv_minrate 9000. + + + +Kicking/Banning - Each player is assigned an userid by the server. Type users in the server console to see the players id's. Usually you can kick people simply by typing kick nick, but this can be difficult if a client has a long nick or is using strange characters. +If this is the case, you can kick clients by their id with kick # . +If you want to ban a client, preventing them from coming back to the server, find their uniqueid with the users command and then ban with banid minutes uniqueid, where minutes is the number of minutes you want to ban the player (0 makes the ban permanent), and uniqueid the player's uniqueid. +To keep players banned even after restarting the server, type writeid before you quit the server, and add exec banned.cfg to your server.cfg so that the next time you start your server, it will read the uniqueid's in banned.cfg. +You can also kick and ban a client at the same time with banid uniqueid kick. +Remove a ban with removeid id, and don't forget to remove it from server.cfg if it's there too. + + + +RCON - RCON lets clients on your server execute server commands remotely. Add the line rcon_password "password" to server.cfg. Clients type rcon_password password in the console and can then execute server commands, like rcon kick, rcon mapchange, etc. This is good if you want to deal with abusive players directly when you're playing on the server, or maybe let a few other trustworthy persons do it. +To use rcon when playing on your server, type rcon_password password in the in-game console. You can now execute several commands if the password was correct, but remember that you must add rcon before every command, for example rcon kick player. + + + + + + Counter-Strike + +First you need, of course, a working Half-Life server. Download the latest CS package. As of this revision of the HOWTO it's 1.5, but that may have changed when you read this. + + + + +ftp://ftp.gamesdomain.co.uk:21/pub/games/halflife/mods/counterstrike/linux/cs_15_full.tar.gz + + + + +Extract it to your HLDS directory: + + + +$ tar zxvf cs_15_full.tar.gz -C $HOME/hlds + + + +Now run the CS server: + + + +$ hlds_l -game cstrike +maxplayers 12 +map de_dust + + + +Edit the /usr/local/games/hlds/cstrike/server.cfg file to change it to your liking and optimize the server. The file mapcycle.txt contains the list of maps to be included in the map cycle, and motd.txt contains the MOTD - Message Of The Day. + + + +Maps - By typing mp_timelimit 1 in the console, the server will go to the next map in the cycle. The command changelevel followed by the mapname makes the server change to the specified map. +The maps must be in your cstrike/maps directory. + + + +For more information on CS servers, see http://server.counter-strike.net. + + + + + + + Unreal Tournament + + Unreal Tournament is a very addictive first person shooter which is designed to be run in one of several modes; DeathMatch, Capture the Flag, Last Man Standing and Assault are the most popular. It features bots, a bevy of weapons and plenty of community support. It was originally ported as an in-house development effort at Epic but later releases are handled by +Loki Software. Current version as of this writing is 436. + + + + System requirements + +As always, the system requirements will vary slightly depending on the +number of players on the server. Here are the basics: + + + + + + + +Pentium 266 (For more than 8 users, a faster server is recommended) + + + + + +At least 32 MB RAM (For a VERY dedicated machine. The more maps, + skins, mutators, bots, and players that are online, the more RAM the + server will use.) 64 MB is highly recommended. + + + + + +Linux kernel 2.2.14 or later, Glibc 2.1 or later. + + + + + +The retail Unreal Tournament CD (Just the first one is necessary). + + + + + +At least 500 MB disk space. Maps, skins, and mods will require a bit more. + + + + + +Enough bandwidth if you're going to run an Internet server. Epic recommends about 20kbps per player. + + + + + + + + + +Installing + + +First, download the latest ut-install file from Loki's website. As of +this version of the HOWTO, that is 436. + + + + + + + + http://www.lokigames.com/products/ut/updates.php3 + + + + + + +Mount the Unreal Tournament CD (Usually /cdrom or /mnt/cdrom), and run +the ut-install*.run file. It will verify the archive, check the CD for +the appropriate files, and begin installing. It will ask you where you +want to install UT to, as well as a few other questions. It is actually +fairly painless. + + + +Once you have it installed, you will want to change ownership of the +files to the user ID that they will be running under (See Security and +permissions). + + + + + + Configuring + + +Now it's time to write a config file. Unreal Tournament uses an INI-style +config file format which is exactly like Windows INI files. This config +file will contain ALL the variables the server will use, including game +types, defaults for those types, number of players, bots, etc. The cfg's +should be kept in the System/ directory (either $UTROOT/System/ or +~/.loki/ut/System/). If you have an UnrealTournament.ini and/or User.ini +in that System/ directory, it will be loaded and can override settings in +the server's cfg file. This is a sanitized copy of my server's cfg file +(called ucc.ini): + + +----[snip]----- +[URL] +Protocol=unreal +ProtocolDescription=Unreal Protocol +Name=Player +Map=Index.unr +LocalMap=DM-Deck16][.unr +Host= +Portal= +MapExt=unr +SaveExt=usa +Port=7777 +Class=Botpack.TMale1 + +[FirstRun] +FirstRun=428 + +[PackageRemap] +UnrealShare=UnrealI + +[Engine.Engine] +GameRenderDevice=NullDrv.NullRenderDevice +WindowedRenderDevice=NullDrv.NullRenderDevice +RenderDevice=NullDrv.NullRenderDevice +AudioDevice=NullDrv.NullRenderDevice +NetworkDevice=IpDrv.TcpNetDriver +DemoRecordingDevice=Engine.DemoRecDriver +Console=UTMenu.UTConsole +Language=int +GameEngine=Engine.GameEngine +EditorEngine=Editor.EditorEngine +DefaultGame=Botpack.DeathMatchPlus +DefaultServerGame=Botpack.DeathMatchPlus +ViewportManager=SDLDrv.SDLClient +Render=Render.Render +Input=Engine.Input +Canvas=Engine.Canvas + +[Core.System] +PurgeCacheDays=30 +SavePath=../Save +CachePath=../Cache +CacheExt=.uxx +Paths=../System/*.u +Paths=/path/to/ut/Maps/*.unr +Paths=/path/to/ut/Textures/*.utx +Paths=/path/to/ut/Sounds/*.uax +Paths=/path/to/ut/Music/*.umx +Suppress=DevLoad +Suppress=DevSave +Suppress=DevNetTraffic +Suppress=DevGarbage +Suppress=DevKill +Suppress=DevReplace +Suppress=DevSound +Suppress=DevCompile +Suppress=DevBind +Suppress=DevBsp + +[Engine.GameEngine] +CacheSizeMegs=4 +UseSound=False +ServerActors=IpDrv.UdpBeacon +ServerActors=IpServer.UdpServerQuery +;ServerActors=IpServer.UdpServerUplink MasterServerAddress=unreal.epicgames.com MasterServerPort=27900 +;ServerActors=IpServer.UdpServerUplink MasterServerAddress=master0.gamespy.com MasterServerPort=27900 +;ServerActors=IpServer.UdpServerUplink MasterServerAddress=master.mplayer.com MasterServerPort=27900 +ServerActors=UWeb.WebServer +ServerPackages=SoldierSkins +ServerPackages=CommandoSkins +ServerPackages=FCommandoSkins +ServerPackages=SGirlSkins +ServerPackages=BossSkins +ServerPackages=Botpack + +[Engine.Player] +ConfiguredInternetSpeed=20000 +ConfiguredLanSpeed=20000 + +[IpDrv.TcpNetDriver] +AllowDownloads=True +ConnectionTimeout=15.0 +InitialConnectTimeout=300.0 +AckTimeout=1.0 +KeepAliveTime=0.2 +MaxClientRate=20000 +SimLatency=0 +RelevantTimeout=5.0 +SpawnPrioritySeconds=1.0 +ServerTravelPause=4.0 +NetServerMaxTickRate=20 +LanServerMaxTickRate=35 +DownloadManagers=IpDrv.HTTPDownload +DownloadManagers=Engine.ChannelDownload + +[Engine.DemoRecDriver] +DemoSpectatorClass=Botpack.CHSpectator +MaxClientRate=25000 +ConnectionTimeout=15.0 +InitialConnectTimeout=500.0 +AckTimeout=1.0 +KeepAliveTime=1.0 +SimLatency=0 +RelevantTimeout=5.0 +SpawnPrioritySeconds=1.0 +ServerTravelPause=4.0 +NetServerMaxTickRate=60 +LanServerMaxTickRate=60 + +[Engine.GameReplicationInfo] +ServerName=Generic UT Server +ShortName=UT Server +AdminName=Lamer +AdminEmail=root@localhost +Region=0 +MOTDLine1= +MOTDLine2= +MOTDLine3= +MOTDLine4= + +[IpDrv.TcpipConnection] +SimPacketLoss=0 +SimLatency=0 + +[IpServer.UdpServerUplink] +DoUpLink=False +UpdateMinutes=1 +MasterServerPort=27900 + +[IpServer.UdpServerQuery] +GameName=ut + +[IpDrv.UdpBeacon] +DoBeacon=True +BeaconTime=0.50 +BeaconTimeout=5.0 +BeaconProduct=ut + +[UMenu.UnrealConsole] +RootWindow=UMenu.UMenuRootWindow +UWindowKey=IK_Esc +ShowDesktop=False + +[UMenu.UMenuMenuBar] +ShowHelp=True +GameUMenuDefault=UTMenu.UTGameMenu +MultiplayerUMenuDefault=UTMenu.UTMultiplayerMenu +OptionsUMenuDefault=UTMenu.UTOptionsMenu +ModMenuClass=UMenu.UMenuModMenu + +[Botpack.ChallengeBotInfo] +Difficulty=1 + +[Botpack.DeathMatchPlus] +bNoviceMode=True +bHardCoreMode=False +bUseTranslocator=True +bCoopWeaponMode=False +MinPlayers=8 +AirControl=0.350000 +bChangeLevels=True +bMegaSpeed=False +bAltScoring=False +bTournament=False +NetWait=10 +RestartWait=15 +InitialBots=10 +FragLimit=30 +TimeLimit=0 +bMultiWeaponStay=False +bForceRespawn=False +MaxCommanders=0 +bNoMonsters=False +bHumansOnly=False +bClassicDeathMessages=False + +[Botpack.CTFGame] +bUseTranslocator=True +bCoopWeaponMode=True +GoalTeamScore=3.000000 +bNoTeamChanges=False +FriendlyFireScale=0.000000 +MaxTeams=2 +MaxTeamSize=16 +FragLimit=0 +TimeLimit=0 +bMultiWeaponStay=True +bForceRespawn=False +MaxCommanders=0 +bNoMonsters=False +bHumansOnly=True +bClassicDeathMessages=False + +[Botpack.Domination] +bDumbDown=True +bUseTranslocator=True +bCoopWeaponMode=True +GoalTeamScore=100.000000 +bNoTeamChanges=False +FriendlyFireScale=0.000000 +MaxTeams=2 +MaxTeamSize=16 +FragLimit=30 +TimeLimit=0 +bMultiWeaponStay=True +bForceRespawn=False +MaxCommanders=0 +bNoMonsters=False +bHumansOnly=False +bClassicDeathMessages=False + +[Botpack.Assault] +bUseTranslocator=False +bCoopWeaponMode=True +Defenses=3 +SavedTime=0.000000 +NumDefenses=0 +CurrentDefender=0 +bDefenseSet=False +bTiePartOne=False +GameCode= +Part=1 +bNoTeamChanges=False +FriendlyFireScale=0.000000 +MaxTeams=2 +GoalTeamScore=0.000000 +MaxTeamSize=16 +FragLimit=0 +TimeLimit=7 +bMultiWeaponStay=False +bForceRespawn=False +MaxCommanders=2 +bNoMonsters=False +bHumansOnly=False +bClassicDeathMessages=False + +[Botpack.TeamGamePlus] +bBalanceTeams=True +GoalTeamScore=30 +bPlayersBalanceTeams=True + +[Engine.GameInfo] +bLowGore=False +bVeryLowGore=False +bMuteSpectators=False +bNoCheating=True +bAllowFOV=False +AutoAim=0.930000 +GameSpeed=1.000000 +MaxSpectators=2 +AdminPassword= +GamePassword= +MaxPlayers=16 +IPPolicies[0]=ACCEPT,* +IPPolicies[1]= +IPPolicies[2]= +IPPolicies[3]= +IPPolicies[4]= +IPPolicies[5]= +IPPolicies[6]= +IPPolicies[7]= +IPPolicies[8]= +IPPolicies[9]= +IPPolicies[10]= +IPPolicies[11]= +IPPolicies[12]= +IPPolicies[13]= +IPPolicies[14]= +IPPolicies[15]= +IPPolicies[16]= +IPPolicies[17]= +IPPolicies[18]= +IPPolicies[19]= +IPPolicies[20]= +IPPolicies[21]= +IPPolicies[22]= +IPPolicies[23]= +IPPolicies[24]= +IPPolicies[25]= +IPPolicies[26]= +IPPolicies[27]= +IPPolicies[28]= +IPPolicies[29]= +IPPolicies[30]= +IPPolicies[31]= +IPPolicies[32]= +IPPolicies[33]= +IPPolicies[34]= +IPPolicies[35]= +IPPolicies[36]= +IPPolicies[37]= +IPPolicies[38]= +IPPolicies[39]= +IPPolicies[40]= +IPPolicies[41]= +IPPolicies[42]= +IPPolicies[43]= +IPPolicies[44]= +IPPolicies[45]= +IPPolicies[46]= +IPPolicies[47]= +IPPolicies[48]= +IPPolicies[49]= +ServerLogName=server.log +bLocalLog=True +bWorldLog=True +bBatchLocal=False +DemoBuild=0 +DemoHasTuts=0 +bExternalBatcher=False +bNoMonsters=False +bHumansOnly=False +bCoopWeaponMode=False +bClassicDeathMessages=False + +[UnrealShare.UnrealGameOptionsMenu] +bCanModifyGore=True + +[UWeb.WebServer] +Applications[0]=UTServerAdmin.UTServerAdmin +ApplicationPaths[0]=/ServerAdmin +Applications[1]=UTServerAdmin.UTImageServer +ApplicationPaths[1]=/images +DefaultApplication=0 +bEnabled=True +ListenPort=5080 +MaxConnections=30 + +[UTServerAdmin.UTServerAdmin] +AdminUsername=utadmin +AdminPassword=utpasswd +MenuPage=menu +RootPage=root +CurrentPage=current +CurrentMenuPage=current_menu +CurrentIndexPage=current_index +CurrentPlayersPage=current_players +CurrentGamePage=current_game +CurrentConsolePage=current_console +CurrentConsoleLogPage=current_console_log +CurrentConsoleSendPage=current_console_send +DefaultSendText=say +CurrentMutatorsPage=current_mutators +CurrentRestartPage=current_restart +DefaultsPage=defaults +DefaultsMenuPage=defaults_menu +DefaultsMapsPage=defaults_maps +DefaultsRulesPage=defaults_rules +DefaultsSettingsPage=defaults_settings +DefaultsBotsPage=defaults_bots +DefaultsServerPage=defaults_server +DefaultsIPPolicyPage=defaults_ippolicy +DefaultsRestartPage=defaults_restart +MessageUHTM=message.uhtm +DefaultBG=#aaaaaa +HighlightedBG=#ffffff +AdminRealm=UT Remote Admin Server + +[IpDrv.HTTPDownLoad] +UseCompression=True + +[Engine.StatLog] +LocalBatcherURL=../NetGamesUSA.com/ngStats/ngStatsUT +LocalBatcherParams= +LocalStatsURL=../NetGamesUSA.com/ngStats/html/ngStats_Main.html +WorldBatcherURL=../NetGamesUSA.com/ngWorldStats/bin/ngWorldStats +WorldBatcherParams=-d ../NetGamesUSA.com/ngWorldStats/logs -g UT +WorldStatsURL=http://www.netgamesusa.com +LocalLogDir=../Logs +WorldLogDir=../NetGamesUSA.com/ngWorldStats/logs +bWorldBatcherError=False + +[Botpack.TrainingDM] +FragLimit=3 +TimeLimit=0 +bMultiWeaponStay=True +bForceRespawn=False +bUseTranslocator=False +MaxCommanders=0 +bNoMonsters=False +bHumansOnly=False +bCoopWeaponMode=False +bClassicDeathMessages=False + +[Botpack.TrainingDOM] +bDumbDown=True +bNoTeamChanges=False +FriendlyFireScale=0.000000 +MaxTeams=2 +GoalTeamScore=100.000000 +MaxTeamSize=16 +FragLimit=0 +TimeLimit=0 +bMultiWeaponStay=True +bForceRespawn=False +bUseTranslocator=True +MaxCommanders=0 +bNoMonsters=False +bHumansOnly=False +bCoopWeaponMode=True +bClassicDeathMessages=False + +[UTMenu.UTServerSetupPage] +bLanPlay=True + +[UTMenu.UTStartGameCW] +Map=DM-Deck16][.unr +GameType=BotPack.DeathMatchPlus +MutatorList= +bKeepMutators=False + +[Botpack.TDMmaplist] +Maps[0]=DM-Liandri.unr +Maps[1]=DM-Codex.unr +Maps[2]=DM-Grinder.unr +Maps[3]=DM-Pressure.unr +Maps[4]=DM-HyperBlast.unr +Maps[5]=DM-Peak.unr +Maps[6]=DM-KGalleon.unr +Maps[7]=DM-Turbine.unr +Maps[8]=DM-StalwartXL.unr +Maps[9]=DM-Curse][.unr +Maps[10]=DM-Deck16][.unr +Maps[11]=DM-Phobos.unr +Maps[12]= +Maps[13]= +Maps[14]= +Maps[15]= +Maps[16]= +Maps[17]= +Maps[18]= +Maps[19]= +Maps[20]= +Maps[21]= +Maps[22]= +Maps[23]= +Maps[24]= +Maps[25]= +Maps[26]= +Maps[27]= +Maps[28]= +Maps[29]= +Maps[30]= +Maps[31]= +MapNum=0 + +[Botpack.TrainingCTF] +bNoTeamChanges=False +FriendlyFireScale=0.000000 +MaxTeams=2 +GoalTeamScore=3.000000 +MaxTeamSize=16 +FragLimit=0 +TimeLimit=0 +bMultiWeaponStay=True +bForceRespawn=False +bUseTranslocator=True +MaxCommanders=0 +bNoMonsters=False +bHumansOnly=True +bCoopWeaponMode=True +bClassicDeathMessages=False + +[UTMenu.UTMenuBotmatchCW] +Map=DM-Gothic.unr +GameType=BotPack.DeathMatchPlus +MutatorList= +bKeepMutators=False + +[Botpack.ASMapList] +Maps[0]=AS-Hispeed.unr +Maps[1]=AS-Frigate.unr +Maps[2]=AS-Rook.unr +Maps[3]=AS-Mazon.unr +Maps[4]=AS-OceanFloor.unr +Maps[5]=AS-Overlord.unr +Maps[6]=AS-Guardia.unr +Maps[7]= +Maps[8]= +Maps[9]= +Maps[10]= +Maps[11]= +Maps[12]= +Maps[13]= +Maps[14]= +Maps[15]= +Maps[16]= +Maps[17]= +Maps[18]= +Maps[19]= +Maps[20]= +Maps[21]= +Maps[22]= +Maps[23]= +Maps[24]= +Maps[25]= +Maps[26]= +Maps[27]= +Maps[28]= +Maps[29]= +Maps[30]= +Maps[31]= +MapNum=0 + +-----[snip]----- + + + +A few things of note here. + + + +The following values should be changed before the server is launched for +the first time: + + + +[Core.System] +Paths=../System/*.u +Paths=/path/to/ut/Maps/*.unr +Paths=/path/to/ut/Textures/*.utx +Paths=/path/to/ut/Sounds/*.uax +Paths=/path/to/ut/Music/*.umx + + + +Should all be set to where Unreal Tournament is installed. + + + +[Engine.GameEngine] +;ServerActors=IpServer.UdpServerUplink + + + +Should be uncommented if you wish to link your Unreal Tournament server +into an existing Unreal Tournament league and have it accessible over the +Internet. + + + +[IpServer.UdpServerUplink] +DoUpLink=False + + + +Additionally, if you do want to link your UT server with an Internet +league, you will need to allow UpLinking. + + + +[Engine.Player] +ConfiguredInternetSpeed=20000 + + + +This should be set to the allocated bandwidth (in bytes per second) for +each player. Leaving it at the recommended 20000 is good. + + + +[Engine.GameReplicationInfo] +ServerName=Generic UT Server +ShortName=UT Server +AdminName=Lamer +AdminEmail=root@localhost +Region=0 +MOTDLine1= +MOTDLine2= +MOTDLine3= +MOTDLine4= + + + +All of that should be changed. + + + +[Engine.GameInfo] +AdminPassword= +MaxPlayers=16 + + + +An admin password should be set, and the Max Players should be set to a +sane value (See ConfiguredInternetSpeed). + + + +[UWeb.WebServer] +bEnabled=True +ListenPort=5080 + + + +One of the most interesting aspects of running a UT server is the +web-server interface for admins. By setting bEnabled to True and +specifying a ListenPort, you can administer an UnrealTournament server via +a normal Web Browser. + + + +[UTServerAdmin.UTServerAdmin] +AdminUsername=utadmin +AdminPassword=utpasswd +AdminRealm=UT Remote Admin Server + + + +If you do decide to run the UT Webserver interface (Recommended), the +above values should be set. AdminRealm is less important, but will be +used by your browser to know when to ask for the administrator username +and password. + + + +All other values should be checked and seasoned to taste. + + + + + +Starting the server + + +To start the Unreal Tournament server, you will need to use the +command "ucc server" and specify a few things on the command line. These +being: + + + +Mapname - Name of the map to start from the Maps/ directory, minus the + .unr extension. +Gametype - One of Botpack.DeathMatchPlus, Botpack.Domination, + Botpack.CTFGame. +INI - The config file to use to start the server. +LOG - the log file the server should use. +Port - (Optional) the port the UT server should use. + + + + +Most of this is specified in the config file, but the mapname and Gametype +are required. + + + +Here is an example: + + + +$ ucc server "DM-Turbine?game=Botpack.DeathMatchPlus" ini=ucc.ini log=ucc.log + + + +I quoted the mapname and gametype because of the presence of the ? (Linux +shells use that as a wild card) and because a lot of Unreal Tournament +maps have odd characters in their name (DM-Deck16][ anyone?). I recommend +they always be quoted. + + + +Once the server starts, it will load the settings specified in the +System/ucc.ini file and load the game. + + + +I also recommend the server be started with the nohup command and placed +in the background. All the configuration will take place in the web +interface. + + + + + +Administrating the server + +Administering the server is as easy as browsing a website. When you +started the server, you should have seen something like this toward the +end: + + + +Spawning: IpDrv.UdpBeacon +Spawning: IpServer.UdpServerQuery +Spawning: UWeb.WebServer +Bound to UWeb.so + + + +Notice the UWeb.Webserver and UWeb.so sections? Those are the webserver, +and since it didn't give any errors, we know it's running. + + + +Now, in the configuration section, you told it what port to listen on: + + + +[UWeb.WebServer] +bEnabled=True +ListenPort=5080 + + + +So, to connect to the administration server, you would need to browse to +http://utserver:5080/ServerAdmin + + + +The first thing that will happen is that your browser will ask you for +authentication. Back in the configuration file, we specified that: + + + +[UTServerAdmin.UTServerAdmin] +AdminUsername=utadmin +AdminPassword=utpasswd +AdminRealm=UT Remote Admin Server + + + +So in this case, you would sign in as utadmin with a password of utpasswd +(You had better change these before you actually start the server). + + + +Once you are authenticated, you are presented with an interface that +allows you to specify the game type, map, number of bots and connections +as well as kick and ban users. It's all very point-n-click. + + + + + +
diff --git a/LDP/retired/HOWTO-HOWTO/HOWTO-HOWTO.sgml b/LDP/retired/HOWTO-HOWTO/HOWTO-HOWTO.sgml new file mode 100644 index 00000000..1472cc4a --- /dev/null +++ b/LDP/retired/HOWTO-HOWTO/HOWTO-HOWTO.sgml @@ -0,0 +1,12 @@ + +
HOWTO-HOWTO +v1.4 12 Jun, 2000 +Mark +F. +Komarinski +List the tools, procedures, and hints to get HOWTO +authors up to speed and writing. Replaced by the +LDP Author Guide + + +
diff --git a/LDP/retired/HOWTO-HOWTO/docbook_template.jpg b/LDP/retired/HOWTO-HOWTO/docbook_template.jpg new file mode 100644 index 00000000..26478f51 Binary files /dev/null and b/LDP/retired/HOWTO-HOWTO/docbook_template.jpg differ diff --git a/LDP/retired/HOWTO-HOWTO/document_layout.jpg b/LDP/retired/HOWTO-HOWTO/document_layout.jpg new file mode 100644 index 00000000..63f97b53 Binary files /dev/null and b/LDP/retired/HOWTO-HOWTO/document_layout.jpg differ diff --git a/LDP/retired/HOWTO-HOWTO/lyx_screenshot.jpg b/LDP/retired/HOWTO-HOWTO/lyx_screenshot.jpg new file mode 100644 index 00000000..5edd972f Binary files /dev/null and b/LDP/retired/HOWTO-HOWTO/lyx_screenshot.jpg differ diff --git a/LDP/retired/HOWTO-HOWTO/sgeditscreenshot.jpg b/LDP/retired/HOWTO-HOWTO/sgeditscreenshot.jpg new file mode 100644 index 00000000..b01b0394 Binary files /dev/null and b/LDP/retired/HOWTO-HOWTO/sgeditscreenshot.jpg differ diff --git a/LDP/retired/IP-Subnetworking.sgml b/LDP/retired/IP-Subnetworking.sgml new file mode 100644 index 00000000..e968b605 --- /dev/null +++ b/LDP/retired/IP-Subnetworking.sgml @@ -0,0 +1,630 @@ + + +
+ + + +IP Sub-Networking Mini-Howto + +<author>Robert Hart, <tt/hartr@interweft.com.au/ +<date>v1.1, 30 August 2001 + +<!-- correct typos reported by users, 30 August 2001 --> +<!-- Greg Ferguson / linux-howto@metalab.unc.edu --> + +<abstract> +This document describes why and how to subnetwork an IP network - that +is using a single A, B or C Class network number to function correctly on +several interconnected networks. </abstract> + +<!-- Copyright 1997, Robert Hart --> + +<sect>Copyright +<p> +This document is distributed under the terms of the GNU Public License (GPL). + +<p> +This document is directly supported by InterWeft IT Consultants +(Melbourne, Australia). + +<p> +The latest version of this document is available at the InterWeft WWW +site at <url url="http://www.interweft.com.au/" name="InterWeft IT +Consultants"> and from <url url="http://sunsite.unc.edu/LDP" name="The +Linux Documentation Project">. + +<sect>Introduction +<p> +With available IP network numbers rapidly becoming an endangered +species, efficient use of this increasingly scarce resource is +important. + +<p> +This document describes how to split a single IP network number up so +that it can be used on several different networks. + +<p> +This document concentrates on C Class IP network numbers - but the +principles apply to A and B class networks as well. + +<sect1>Other sources of information +<p> +There are a number of other sources of information that are of +relevance for both detailed and background information on IP numbers. +Those recommended by the author are:- + +<itemize> + +<item><url url="http://sunsite.unc.edu/LDP/LDP/nag/nag.html" name="The +Linux Network Administrators Guide">. + +<item><url url="http://linuxwww.db.erau.edu/SAG/" name="The Linux System +Administration Guide">. + +<item><url url="http://www.ora.com/catalog/tcp/noframes.html" +name="TCP/IP Network Administration by Craig Hunt, published by O'Reilly +and Associates">. + +</itemize> + +<sect>The Anatomy of IP numbers +<p> +Before diving into the delight of sub-networking, we need to establish +some IP number basics. + +<sect1>IP numbers belong to Interfaces - <bf/NOT/ hosts! +<p> +First of all, let's clear up a basic cause of misunderstanding - IP +numbers are <bf/not/ assigned to hosts. IP numbers are assigned to +network interfaces on hosts. + +<p> +Eh - what's that? + +<p> +Whilst many (if not most) computers on an IP network will possess a +single network interface (and have a single IP number as a consequence), +this is not the only way things happen. Computers and other devices can +have several (if not many) network interfaces - and each interface has +its own IP number. + +<p> +So a device with 6 active interfaces (such as a router) will have 6 IP +numbers - one for each interface to each network to which it is connected. The +reason for this becomes clear when we look at an IP network! + +<p> +Despite this, most people refer to <em/host addresses/ when referring to an +IP number. Just remember, this is simply shorthand for <em/the IP number +of this particular interface on this host/. Many (if not the majority) +of devices on the Internet have only a single interface and thus a +single IP number. + +<sect1>IP Numbers as &dquot;Dotted Quads&dquot; +<p> +In the current (IPv4) implementation of IP numbers, IP numbers consist +of 4 (8 bit) bytes - giving a total of 32 bits of available information. +This results in numbers that are rather large (even when written in +decimal notation). So for readability (and organisational reasons) IP +numbers are usually written in the 'dotted quad' format. The IP number + +<tscreen><verb> + 192.168.1.24 +</verb></tscreen> + +is an example of this - 4 (decimal) numbers separated by (.) dots. + +<p> +As each one of the four numbers is the decimal representation of an 8 +bit byte, each of the 4 numbers can range from 0 to 255 (that is take on +256 unique values - remember, zero is a value too). + +<p> +In addition, part of the IP number of a host identifies the network on +which the host resides, the remaining 'bits' of the IP number identify +the host (oops - network interface) itself. Exactly how many bits are +used by the network ID and how many are available to identify hosts +(interfaces) on that network is determined by the network 'class'. + +<sect1>Classes of IP Networks +<p> +There are three classes of IP numbers + +<itemize> + +<item>Class A IP network numbers use the leftmost 8 bits (the leftmost +of the dotted quads) to identify the network, leaving 24 bits (the +remaining three dotted quads) to identify host interfaces on that +network.<newline> +Class A addresses <bf/always/ have the leftmost bit of the leftmost +byte a zero - that is a decimal value of 0 to 127 for the first dotted +quad. So there are a maximum of 128 class A network numbers +available, with each one containing up to 33,554,430 possible +interfaces. + +<newline><newline> + +However, the networks 0.0.0.0 (known as the default route) and 127.0.0.0 +(the loop back network) have special meanings and are not available for +use to identify networks. So there are only 126 <em/available/ A class +network numbers. + +<item>Class B IP network numbers use the leftmost 16 bits (the leftmost two +dotted quads) to identify the network, leaving 16 bits (the last two +dotted quads) to identify host interfaces. Class B addresses always have +the leftmost 2 bits of the leftmost byte set to 1 0. This leaves 14 bits +left to specify the network address giving 32767 available B class +networks. B Class networks thus have a range of 128 to 191 for the first +of the dotted quads, with each network containing up to 32,766 possible +interfaces. + +<item>Class C IP network numbers use the leftmost 24 bits (the leftmost +three bytes) to identify the network, leaving 8 bits (the rightmost +byte) to identify host interfaces. Class C addresses always start with +the leftmost 3 bits set to 1 1 0 or a range of 192 to 255 for the +leftmost dotted quad. There are thus 4,194,303 available C class network +numbers, each containing 254 interfaces. (C Class networks with the +first byte greater than 223 are however reserved and unavailable for use). +</itemize> + +In summary: + +<tscreen><verb> + Network class Usable range of first byte values (decimal) + A 1 to 126 + B 128 to 191 + C 192 to 254 +</verb></tscreen> + +<p> +There are also special addresses that are reserved for 'unconnected' +networks - that is networks that use IP but are not connected to the +Internet, These addresses are:- + +<itemize> +<item>One A Class Network<newline> +10.0.0.0 +<item>16 B Class Networks<newline> +172.16.0.0 - 172.31.0.0 +<item>256 C Class Networks +192.168.0.0 - 192.168.255.0 +</itemize> + +<p> +You will note that this document uses these sequences throughout to avoid +confusion with 'real' networks and hosts. + +<sect1>Network numbers, interface addresses and broadcast addresses +<p> +IP numbers can have three possible meanings:- + +<itemize> + +<item>the address of an IP network (a group of IP devices sharing common +access to a transmission medium - such as all being on the same Ethernet +segment). A network number will always have the interface (host) bits of +the address space set to 0 (unless the network is sub-networked - as we +shall see); + +<item>the broadcast address of an IP network (the address used to 'talk', +simultaneously, to all devices in an IP network). Broadcast +addresses for a network always have the interface (host) bits of the the +address space set to 1 (unless the network is sub-networked - again, as +we shall see). + +<item>the address of an interface (such as an Ethernet card or PPP interface +on a host, router, print server etc). These addresses can have any value +in the host bits <bf/except/ all zero or all 1 - because with the host bits all +0, the address is a network address and with the host bits all 1 the +address is the broadcast address. + +</itemize> + +<p> +In summary and to clarify things + +<tscreen><verb> +For an A class network... +(one byte of network address space followed by three bytes of host +address space) + + 10.0.0.0 is an A Class network number because all the host + bits of the address space are 0 + 10.0.1.0 is a host address on this network + 10.255.255.255 is the broadcast address of this network + because all the host bits of the address space are 1 + +For a B class network... +(two bytes of network address space followed by two bytes of host +address space) + + 172.17.0.0 is a B Class network number + 172.17.0.1 is a host address on this network + 172.17.255.255 is the network broadcast address + +For a C Class network... +(three bytes of network address space followed by one byte of host +address space) + + 192.168.3.0 is a C Class network number + 192.168.3.42 is a host address on this network + 192.168.3.255 is the network broadcast address +</verb></tscreen> + +<p> +Almost all IP network numbers remaining available for allocation at +present are C Class addresses. + +<sect1>The network mask +<p> +The network mask is more properly called the subnetwork mask. However, +it is generally referred to as the network mask. + +<p> +It is the network mask and its implications on how IP addresses are +interpreted <em/locally/ on an IP network segment that concerns us most +here, as this determines what (if any) sub-networking occurs. + +<p> +The standard (sub-) network mask is all the network bits in an address +set to '1' and all the host bits set to '0'. This means that the +standard network masks for the three classes of networks are:- + +<itemize> +<item>A Class network mask: 255.0.0.0 +<item>B Class network mask: 255.255.0.0 +<item>C Class network mask: 255.255.255.0 +</itemize> + +<p> +There are two important things to remember about the network mask:- +<itemize> +<item>The network mask affects only the <bf/local/ interpretation of +<bf/local/ IP numbers (where local means on this particular network segment); +<item>The network mask is <bf/not/ an IP number - it is used to modify +how local IP numbers are interpreted locally. +</itemize> + +<sect>What are subnets? +<p> +A subnet is a way of taking a single IP network address and <bf/locally/ +splitting it up so that this single network IP address can actually be +used on several interconnected local networks. Remember, a single IP +network number can only be used on a single network. + +<p> +The important word here is <bf/locally/: as far as the world outside the +machines and physical networks covered by the sub-netted IP network are +concerned, nothing whatsoever has changed - it is still just a single IP +network. This is important - sub-networking is a <bf/local/ configuration +and is invisible to the rest of the world. + +<sect>Why subnetwork? +<p> +The reasons behind sub-networking date back to the early specification of +IP - where just a few sites were running on Class A network numbers, +which allow for millions of connected hosts. + +<p> +It is obviously a huge traffic and administration problem if all IP +computers at a large site need to be connected to the same network: +trying to manage such a huge beast would be a nightmare and the network +would (almost certainly) collapse under the load of its own traffic +(saturate). + +<p> +Enter sub-networking: the A class IP network address can be split up to +allow its distribution across several (if not many) separate networks. +The management of each separate network can easily be delegated as well. + +<p> +This allows small, manageable networks to be established - quite +possibly using different networking technologies. Remember, you cannot mix +Ethernet, Token Ring, FDDI, ATM etc on the same physical network - they +can be interconnected, however! + +<p> +Other reasons for sub-networking are:- +<itemize> +<item>Physical site layout can create restrictions (cable run lengths) +in terms of the how the physical infrastructure can be connected, +requiring multiple networks. Sub-networking allows this to be done in an +IP environment using a single IP network number. +<newline><newline> +This is in fact now very commonly done by ISPs who wish to give their +permanently connected clients with local networks static IP numbers. + +<item>Network traffic is sufficiently high to be causing significant +slow downs. By splitting the network up using subnetworks, traffic that +is local to a network segment can be kept local - reducing overall +traffic and speeding up network connectivity without requiring more +actual network bandwidth; +<item>Security requirements may well dictate that different classes of +users do not share the same network - as traffic on a network can always +be intercepted by a knowledgeable user. Sub-networking provides a way to +keep the marketing department from snooping on the R & D network traffic +(or students from snooping on the administration network)! +<item>You have equipment which uses incompatible networking technologies +and need to interconnect them (as mentioned above). +</itemize> + +<sect>How to subnetwork a IP network number +<p> +Having decided that you need to subnetwork your IP network number, how +do you go about it? The following is an overview of the steps which will +then be explained in detail:- + +<itemize> +<item>Set up the physical connectivity (network wiring and network +interconnections - such as routers; +<item>Decide how big/small each subnetwork needs to be in terms of the +number of devices that will connect to it - ie how many usable IP +numbers are required for each individual segment. +<item>Calculate the appropriate network mask and network addresses; +<item>Give each interface on each network its own IP address and the +appropriate network mask; +<item>Set up the routes on the routers and the appropriate gateways, +routes and/or default routes on the networked devices; +<item>Test the system, fix problems and then relax! +</itemize> + +<p> +For the purpose of this example, we will assume we are sub-networking a single C +class network number: 192.168.1.0 + +<p> +This provides for a maximum of 254 connected interfaces (hosts), plus +the obligatory network number (192.168.1.0) and broadcast address +(192.168.1.255). + +<sect1>Setting up the physical connectivity +<p> +You will need to install the correct cabling infrastructure for all the +devices you wish to interconnect designed to meet your physical layout. + +<p> +You will also need a mechanism to interconnect the various segments +together (routers, media converters etc.). + +<p> +A detailed discussion of this is obviously impossible here. Should you +need help, there are network design/installation consultants around who +provide this sort of service. Free advice is also available on a number of +Usenet news groups (such as comp.os.linux.networking). + +<sect1>Subnetwork sizing +<p> +There is a play off between the number of subnetworks you create and 'wasted' +IP numbers. + +<p> +Every individual IP network has two addresses unusable as interface +(host) addresses - the network IP number itself and the broadcast +address. When you subnetwork, each subnetwork requires its own, unique +IP network number and broadcast address - and these have to be valid +addresses from within the range provided by the IP network that you are +sub-networking. + +<p> +So, by sub-networking an IP network into two separate subnetworks, there +are now <bf/two/ network addresses and <bf/two/ broadcast addresses - +increasing the 'unusable' interface (host) addresses; creating 4 +subnetworks creates <bf/eight/ unusable interface (host) addresses and +so on. + +<p> +In fact the smallest usable subnetwork consists of 4 IP numbers:- +<itemize> +<item>Two usable IP interface numbers - one for the router interface on +that network and one for the single host on that network. +<item>One network number. +<item>One broadcast address. +</itemize> + +<p> +Quite why one would want to create such a small network is another +question! With only a single host on the network, any network +communication must go out to another network. However, the example does +serve to show the law of diminishing returns that applies to +sub-networking. + +<p> +In principle, you can only divide your IP network number into 2^n (where +n is one less that the number of host bits in your IP network number) +equally sized subnetworks (you can subnetwork a subnetwork and combine +subnetworks however). + +<p> +So be realistic about designing your network design - you want the +<bf/minimum/ number of separate local networks that is consistent with +management, physical, equipment and security constraints! + +<sect1>Calculating the subnetwork mask and network numbers +<p> +The network mask is what performs all the <bf/local/ magic of dividing +an IP network into subnetworks. + +<p> +The network mask for an un-sub-networked IP network number is simply a +dotted quad which has all the 'network bits' of the network number +set to '1' and all the host bits set to '0'. + +<p> +So, for the three classes of IP networks, the standard network masks +are:- +<itemize> +<item>Class A (8 network bits) : 255.0.0.0 +<item>Class B (16 network bits): 255.255.0.0 +<item>Class C (24 network bits): 255.255.255.0 +</itemize> + +<p> +The way sub-networking operates is to <em/borrow/ one or more of the +available host bits and make then make interfaces <bf/locally/ interpret +these borrowed bits as part of the network bits. So to divide a network +number into two subnetworks, we would borrow one host bit by setting the +appropriate bit in the network mask of the first (normal) host bit to '1'. + +<p> +For a C Class address, this would result in a netmask of +<newline> +11111111.11111111.11111111.10000000 +<newline> +or 255.255.255.128 + +<p> +For our C Class network number of 192.168.1.0, these are some of the +sub-networking options you have:- + +<code> +No of No of +subnets Hosts/net netmask +2 126 255.255.255.128 (11111111.11111111.11111111.10000000) +4 62 255.255.255.192 (11111111.11111111.11111111.11000000) +8 30 255.255.255.224 (11111111.11111111.11111111.11100000) +16 14 255.255.255.240 (11111111.11111111.11111111.11110000) +32 6 255.255.255.248 (11111111.11111111.11111111.11111000) +64 2 255.255.255.252 (11111111.11111111.11111111.11111100) +</code> + +<p> +In principle, there is absolutely no reason to follow the above way of +subnetworking where network mask bits are added from the most +significant host bit to the least significant host bit. However, if you +do not do it this way, the resulting IP numbers will be in a <em/very/ +odd sequence! This makes it extremely difficult for us humans to decide +to which subnetwork an IP number belongs as we are not too good at thinking +in binary (computers on the other hand are and will use whatever scheme +you tell them with equal equanimity). + +<p> +Having decided on the appropriate netmask, you then need to work out +what the various Network and broadcast addresses are - and the IP number +range for each of these networks. Again, considering only a C Class IP +Network number and listing only the <em/final/ (host part) we have:- + +<code> +Netmask Subnets Network B'cast MinIP MaxIP Hosts Total Hosts +-------------------------------------------------------------------------- + 128 2 0 127 1 126 126 + 128 255 129 254 126 252 + + 192 4 0 63 1 62 62 + 64 127 65 126 62 + 128 191 129 190 62 + 192 255 193 254 62 248 + + 224 8 0 31 1 30 30 + 32 63 33 62 30 + 64 95 65 94 30 + 96 127 97 126 30 + 128 159 129 158 30 + 160 191 161 190 30 + 192 223 193 222 30 + 224 255 225 254 30 240 +</code> + +<p> +As can be seen, there is a very definite sequence to these numbers, +which make them fairly easy to check. The 'downside' of sub-networking is +also visible in terms of the reducing total number of available host +addresses as the number of subnetworks increases. + +<p> With this information, you are now in a position to assign host and +network IP numbers and netmasks. + +<sect>Routing +<p> +If you are using a Linux PC with two network interfaces to route between +two (or more) subnets, you need to have IP Forwarding enabled in your +kernel. Do a + +<code> + cat /proc/ksyms | grep ip_forward +</code> + +<p> +You should get back something like... +<code> +00141364 ip_forward_Rf71ac834 +</code> + +<p> +If you do not, then you do not have IP-Forwarding enabled in your kernel +and you need to recompile and install a new kernel. + +<p> +For the sake of this example, let us assume that you have decided to +subnetwork you C class IP network number 192.168.1.0 into 4 subnets +(each of 62 usable interface/host IP numbers). However, two of these +subnets are being combined into a larger single network, giving three +physical networks. + +<p> +These are :- +<code> +Network Broadcast Netmask Hosts +192.168.1.0 192.168.1.63 255.255.255.192 62 +192.168.1.64 192.168.1.127 255.255.255.192 62 +192.168.1.128 192.168.1.255 255.255.255.128 124 (see note) +</code> + +<p> +Note: the reason the last network has only 124 usable network addresses +(not 126 as would be expected from the network mask) is that it is +really a 'super net' of two subnetworks. Hosts on the other two networks +will interpret 192.168.1.192 as the <em/network/ address of the 'non-existent' +subnetwork. Similarly, they will interpret 192.168.1.191 +as the broadcast address of the 'non-existent' subnetwork. + +<p> +So, if you use 192.168.1.191 or 192 as host addresses on the third +network, then machines on the two smaller networks will not be able to +communicate with them. + +<p> +This illustrates an important point with subnetworks - the usable +addresses are determined by the <bf/SMALLEST/ subnetwork in that address +space. + +<sect1>The routing tables +<p> +Let us assume that a computer running Linux is acting as a router for +this network. It will have three network interfaces to the local LANs +and possibly a fourth interface to the Internet (which would be its +default route. + +<p> +Let us assume that the Linux computer uses the lowest available IP +address in each subnetwork on its interface to that network. It would +configure its network interfaces as + +<code> +Interface IP Address Netmask +eth0 192.168.1.1 255.255.255.192 +eth1 192.168.1.65 255.255.255.192 +eth2 192.168.1.129 255.255.255.128 +</code> + +<p> +The routing it would establish would be + +<code> +Destination Gateway Genmask Iface +192.168.1.0 0.0.0.0 255.255.255.192 eth0 +192.168.1.64 0.0.0.0 255.255.255.192 eth1 +192.168.1.128 0.0.0.0 255.255.255.128 eth2 +</code> + +<p> +On each of the subnetworks, the hosts would be configured with their own +IP number and net mask (appropriate for the particular network). Each host +would declare the Linux PC as its gateway/router, specifying the Linux +PCs IP address for its interface on to that particular network. + + +<p> +Robert Hart +Melbourne, Australia March 1997. + +</article> diff --git a/LDP/retired/ISP-Connectivity.sgml b/LDP/retired/ISP-Connectivity.sgml new file mode 100644 index 00000000..4fd2b87c --- /dev/null +++ b/LDP/retired/ISP-Connectivity.sgml @@ -0,0 +1,299 @@ +<!doctype linuxdoc system> +<article> +<title> +ISP-Connectivity-mini-HOWTO +<author>Michael Strates, <tt>mstrates@croftj.net</tt> +<date>v2.0.1, 2001-11-28 +<abstract> +This document describes how to setup PPP, connect up to your +ISP, configure mail and news, get a permanent IP (if available), +get a domain name, and have a bonda fide system running +in a little over thirty minutes. +<p> +<bf>Archived Document Notice:</bf> This document has been archived by the LDP +because it does not apply to modern Linux systems. It is no longer +being actively maintained. +</p> +</abstract> +<toc> +<p> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<sect> Introduction +<p> +The main goal of this document obviously is to make the new user +friendly with the many terms of connecting your Linux PC up to +the Internet, obtaining IP addresses, domain names, and setting things +up. This guide is intended for the intermediate user in mind, although +intelligent newbies shouldn't have any problems. +<p> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<sect1> New versions of this document +<p> +New versions of this document will be periodically posted to +<it>comp.os.linux.answers</it>. They will also be added to the +various anonymous FTP sites who archive such information, +including: +<p> +<tt> +<htmlurl url="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO" +name="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO"> +</tt> +<p> +In addition, you should generally be able to find this document +on the Linux Documentation Project page via: +<p> +<tt> +<htmlurl url="http://sunsite.unc.edu/LDP/" +name="http://sunsite.unc.edu/LDP/"> +</tt> +<p> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<sect1> Feedback +<p> +I certaintly welcome any feedback about this HOWTO, spelling mistakes, +how it all worked out, thankyou notes and critisisms. I hope I helped +a few people with this HOWTO, and if I did, I'd be really happy to +hear from you. +<p> +<tt> +<htmlurl url="mailto:mstrates@croftj.net" +name="mstrates@croftj.net"> +</tt> +<p> +<tt> +<htmlurl url="http://linloft.home.ml.org/" +name="http://linloft.home.ml.org/"> +</tt> +<p> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<sect1> Standard Disclaimer +<p> +No liability for the contents of this documents can be accepted. +Use the concepts, examples and other content at your own risk. +As this is a new edition of this document, there may be errors +and inaccuracies, that may of course be damaging to your system. +Proceed with caution, and although this is highly unlikely, +I don't take any responsibility for that. +<p> +Naturally, there are probably better and easier ways to do things +in this document. There will always be another way in the Linux +World. This is the way I've done things, and that's the way I'll +be presenting them in this HOWTO. +<p> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<sect1> Copyright Information +<p> +This document is copyrighted (c)1997 Michael Strates and +distributed under the terms of the GNU Free Documentation License, +which can be obtained from +<a href="http://www.fsf.org/licenses/fdl.html">http://www.fsf.org/licenses/fdl.html</a>. + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<sect> Connecting to the Outside World +<p> +In this document, we'll explain how to do this using PPP (Point +to Point Protocol), a popular protocol nearly always used over the +Internet. It allows your modem to <tt>speak</tt> to the outside +world. This is what applications like Trumpet Winsock in Windows +3.x did, and many other programs that you've probably have never +seen. +<p> +In Linux, we use a thing called chat to do the dialing up to the +ISP and then use a utility called pppd to 'use' the connection. In +a sense, chat is your dialer, and pppd is your protocol. We'll +describe how to setup both below. +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<sect1> Talking and Communicating with pppd and chat +<p> +Probably the easiest way to go about things is to make a shell +script in root's home directory called <tt>ppp-connect</tt> and +involke the script whenever you wish to make your connection. We'll +discuss this method. +<p> +Open up your favourite editor as root on ~/ppp-connect. You'll +then have to decide on your parameters. +<p> +<it>pppd connect 'chat -v "" "your_init_string" "" ATDTisp_number +CONNECT "" ogin: your_username word: your_passwd' /dev/tty(0/1/2) speed +modem</it> +<p> +pppd involkes /usr/sbin/pppd on my system, then loads up chat to do the +dialing. Chat sends <it>your_init_string</it> to the modem, then +dials <it>isp_number</it>. It then waits for CONNECT, then waits for +ogin: (l removed as the first character is sometimes lost), sends +<it>your_passwd</it>, chat then terminates and hands the show over to +pppd. +<p> +The last of the command specifies your modem port (mine's /dev/ttyS1). In +most cases it will be ttyS1 (COM2: in DOS), ttyS0 (COM1: in DOS), or if +your using Slackware, cua1 or cua0. The speed is the speed of the modem. I +use 115200 for my modem (a 33.6k). If you have got a fairly recent +computer (one with a 16550 UART), then I wouldn't go any lower than 57600. +Otherwise, for 14.4k 38400. Modem just tells pppd that it's a serial/modem +based connection. Remove the -v option if you don't want verbose logging +to your logfiles. +<p> +The scenario below is one of a person who dials up an ISP that +automatically starts PPP for them, ie; they don't have a shell that +actually starts. This is his command in his ~/ppp-connect: +<p> +<it>pppd connect 'chat "" "ATZ" "" ATDT555-1800 +CONNECT "" ogin: johnny word: blackjak' /dev/ttyS1 115200 +modem</it> +<p> +But for some people, they're ISP starts up a shell and doesn't +automatically start PPP this may be a problem. Luckily, chat can deal with +that too. You just add another command to your chat script. For example, +below this johnny character is using an ISP that just dumps him to a +shell, requiring him to type ppp to get a ppp connection. His shell prompt +ends with a $. +<it>pppd connect 'chat "" "ATZ" "" ATDT555-1800 +CONNECT "" ogin: johnny word: blackjak $ ppp' /dev/ttyS1 115200 +modem</it> +<p> +If it's more than one word, ensure you quote it. I hope you can see the +drift of this, and are able to create your own script up to suit your +connection. Simply modify either the first johnny or the second johnny +script to suit your taste, port, server, etc and save the file. +<p> +Now you've made your file, ensure that only root can execute, read or +write to it. This is extreemly important. Also make sure nobody can +read your logfiles, if you decide to leave the -v option in, as your +password is seen in cleartext in the logs (I don't see much need for -v, +if you don't know what I'm talking about, leave -v out). +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<sect1> IP's, Domain Names and Subnets +<p> +For most people using the options above, a changing IP address won't +bother them. These people include basic, easy going users, that just have +dialup accounts, and aren't very technically minded. For those people, +skim read this section, I'll come to important things you need to do to +setup your system properly. Newbies, skip the sections dealing with +permanent IP, Domain Names, Subnets, and just read the last bit of this +section.<p> +Getting a permanent IP address might be free for your ISP, so if in doubt +ask them. Personally, I'd pay for a permanent IP address. It lets you send +e-mail to and from using a unique IP or domain, etc. If you want to get +yourself a permanent IP, write an e-mail to root@yourisp.com, and ask him +nicely if he can arrange a permanent IP for you. +<p> +When you get your permanent IP address, grep through your /etc directory +to find where your old IP addresses are. I had to change files in my +sendmail directory and /etc/hosts. There are some other key files that you +will only discover with grepping. Open up /etc/hosts, and add your new IP +address in the standard format. Reboot your computer, and you should be +ready to go. +<p> +You'll now need to change your chat script to reflect your new settings. +If you are forced into PPP as soon as you start your connection, you'll +need to tell your System Administrator of your ISP to ensure their PPP +system recognises that you have a permanent IP address and allocates you +that instead of a changing one. If you get dumped at a shell prompt, and +you need to type ppp or something to start the connection, instead of +typing that, change your ~/ppp-connect script to send this instead of just +ppp or whatever when it sees $ or whatever your shell prompt is. +<p> +<it>/usr/sbin/pppd :Your_IP_Address</it> +<p> +Substitute your IP address for the IP address your ISP gave to you. Be +sure you encapsulate the thing in " " marks when you put it into your chat +script. If this doesn't work, consult your ISP where your PPP daemon is +located, and ask him for the command to give. You could just try leaving +it as is and seeing if the server will recognise you and give you your +rightful address. +<p> +The next thing probably to do is to get yourself a domain name. I know +that in Australia, .asn.au and .org.au are free. In the United States, you +can get a .us domain for free, but they tend to be long. If your in +Australia, you must go to +<htmlurl url="http://www.aunic.net/" name="http://www.aunic.net/"> +to register your domains. In the United States, it is +<htmlurl url="http://www.internic.net/" name="http://www.internic.net/"> . +<p> +To register domains you need to be able to provide DNS services, and gorey +stuff like that. If your ISP can't provide these, throw out an official +.asn.au or whatever domain out the window, and get a Monolith Internet +Domain. +<p> +Monolith offer free domains to anybody and anyone all around the world. +Everything is done without human interaction, via a web forms interface +with your browser. Your domain comes in the form of Your_Choice.ml.org. +Monolith will then host the DNS locally for you. If you want to send and +receive mail from that domain, ask your ISP to become a mail exchanger for +you. +<p> +Go to +<htmlurl url="http://www.ml.org/" name="http://www.ml.org/"> +and fill out an application, enter the NIC with your username and +password, and make a FREED domain. You'll need to enter your IP address, +so have that ready. Your domain will be in the DNS in a couple of days. +<p> +Okay now, we'll move onto the newbies section, or for those people who +can't get a permanent IP address or a domain name. All you have to do is +edit /etc/hosts as root, call your site something that won't clash, give +it a 10.10.10 or something for an IP address and reboot your computer. +<p> +There you go, you've just setup your computer with pppd and chat in just +ten minutes. Now let's move onto the next section, which deals with +Electronic Mail. +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<sect> Electronic Mail on your Linux Box +<p> +One of the most important aspects of the Internet, is it's fasinating +capaiblity to transfer mail to and from countries, or more locally +perhaps. Linux is extreemly strong in easy mail packages for the console. +The one we're going to document today is called Pine (Program for Internet +Mail and News), made by the University of Washington, and to download the +mail, a program called Fetchmail, made by Eric S. Raymond. Both should be +included in your Linux distribution. +<p> +Fetchmail is a program that downloads your e-mail from your server using +POP, transfers the mail onto your computer and then deletes it off the +server, much like programs like Eudora or Microsoft Internet Mail/Exchange +do. To configure and automate fetchmail, you use a file in your home +directory called .fetchmailrc. Simply open up ~/.fetchmailrc +(Remember: your doing this bit as yourself, not as root) with your +favourite editor and observe the command lin eoptions below: +<p> +<EM>poll mail.yourisp.com proto pop3 user login_name password your_passwd</EM> +<p> +<EM>user login_name with pass your_passwd is login_name here</EM> +<p> +All you have to do is replace <EM>mail.yourisp.com</EM> with the name of +the mail server of your ISP, <EM>your_passwd</EM> with your password, and +<EM>login_name</EM> with your login name. +<p> +An important thing to note. For Pine and this procedure to work correctly, +your login name must corrospond with the login name you use on your ISP. +That is your local login name must match the one you use on your server, +and your e-mail address. +<p> +Next, ensure that .fetchmailrc has the correct permissions (user +read/write only) and your laughing. Fetchmail can be started in two ways, +in standard mode (where it'll fetch messages from the server and +terminate), or in daemon mode (where it will stay active, and +check/download mail every X seconds). To use daemon mode, type +<it>fetchmail -a -d(Seconds between Polls)</it>. -a ensures it downloads +all mail. To use the standard mode, just type <it>fetchmail -a</it>. +<p> +Next, you need to setup Pine. Open up Pine, by typing pine at your prompt, +choose Setup - Configuration. Setup your userdomain as the domain in your +e-mail address, for example jack@linux.org, would be linux.org. Next, +setup smtp-server as your POP mail server (the same you used in the +fetchmail setup). So we enter www.linux.org. If you want news, setup your +nntp server to your ISP's news server. +<p> +So there you have it folks, everything should be working now. To connect +up to your ISP, just run ~/ppp-connect as root. Then, to get your e-mail +run fetchmail -a as yourself. To browse your e-mail and news, use +Pine. Install a text-based browser such as Lynx to browse the web if you +like. +<p> +<it>Send any comments questions and suggestions to +mstrates@croftj.net</it> +<p> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +</article> diff --git a/LDP/retired/KDE-Kiosk-Mode.sgml b/LDP/retired/KDE-Kiosk-Mode.sgml new file mode 100755 index 00000000..ef90ad7d --- /dev/null +++ b/LDP/retired/KDE-Kiosk-Mode.sgml @@ -0,0 +1,674 @@ +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> + +<article id="index"> + +<!-- Header --> + + <artheader> + + <!-- title of HOWTO, include the word HOWTO --> + + <title>KDE Kiosk Mode HOWTO + + + Roland + Fehrenbacher + +
+ rfehrenb@transtec.de +
+
+
+ + + Peter + Kruse + +
+ Peter.Kruse@wolnet.de +
+
+
+ + + + 1.4 + 2002-09-26 + gjf + Archived. + + + $Revision: 1.1 $ + $Date: 2002/09/26 15:20:35 $ + $Author: gferg $ + + + + $Log: KDE-Kiosk-Mode.sgml,v $ + Revision 1.1 2002/09/26 15:20:35 gferg + archived + + Revision 1.3 2001/08/14 07:44:07 kruse + nicer formatting. + + Revision 1.2 2001/08/14 07:42:50 pkruse + . + + Revision 1.1 2001/08/03 13:56:20 pkruse + almost published. + + Revision 1.4 2001/07/31 14:15:21 pkruse + prepare to check in linuxdoc cvs. + + Revision 1.3 2001/07/31 13:39:12 pkruse + variable and filename docbook tags added. + + Revision 1.2 2001/07/31 11:05:51 pkruse + first revision. + + Revision 1.1 2001/07/31 10:49:51 pkruse + Initial revision + + + + + + + + + + + +The requirements for the desktop environment of users in a large +network environment is often very different to a typical homeuser. The +number of applications that these users need to run is usually very +limited, and the users themselves are not very experienced in solving +computing related problems. The administrators of the network +therefore need to ensure that the required applications run reliably, +and can be started by the users with a minimum of hassle. For +security, stability, and also administrative reasons it is then +advisable to provide only the absolutely necessary applications and +functionality. + + + +With the advent of modern desktop technology like KDE, this goal has become +harder to achieve. Interoperability between different desktop programs, ease +of configuration by configuration engines, etc. allow the user a great deal +of control over her/his desktop, which is great when needed. The above large +network scenario, however, is not addressable in standard KDE. This is where +the restricted mode tries to fill in the gap. + + + + + + Archived Document Notice: + This document has been archived by the LDP because it does not apply + to modern Linux systems. It is no longer being actively maintained. + Further information on this topic can be found at + http://www.brigadoon.de/peter/kde/. + + + + + + + + + + + + Introduction + + +This document describes a by-product of a project, in which a large +number of Linux based workstations were provided. Although a +kiosk-mode patch exists for KDE 1, this document assumes KDE 2 and the +patches apply to KDE version 2.1.1(2). + + + + + + Copyright Information + + + This document is copyrighted (c) 2001 Peter Kruse and Roland + Fehrenbacher and is distributed under the terms of the Linux + Documentation Project (LDP) license, stated below. + + + + Unless otherwise stated, Linux HOWTO documents are + copyrighted by their respective authors. Linux HOWTO documents may + be reproduced and distributed in whole or in part, in any medium + physical or electronic, as long as this copyright notice is + retained on all copies. Commercial redistribution is allowed and + encouraged; however, the authors would like to be notified of any + such distributions. + + + + All translations, derivative works, or aggregate works + incorporating any Linux HOWTO documents must be covered under this + copyright notice. That is, you may not produce a derivative work + from a HOWTO and impose additional restrictions on its + distribution. Exceptions to these rules may be granted under + certain conditions; please contact the Linux HOWTO coordinator at + the address given below. + + + + In short, we wish to promote dissemination of this + information through as many channels as possible. However, we do + wish to retain copyright on the HOWTO documents, and would like to + be notified of any plans to redistribute the HOWTOs. + + + + If you have any questions, please contact + linux-howto@metalab.unc.edu + + + + + + + Disclaimer + + + No liability for the contents of this documents can be accepted. + Use the concepts, examples and other content at your own risk. + As this is a new edition of this document, there may be errors + and inaccuracies, that may of course be damaging to your system. + Proceed with caution, and although this is highly unlikely, + the authors do not take any responsibility for that. + + + + All copyrights are held by their by their respective owners, unless + specifically noted otherwise. Use of a term in this document + should not be regarded as affecting the validity of any trademark + or service mark. + + + + Naming of particular products or brands should not be seen + as endorsements. + + + + You are strongly recommended to take a backup of your system + before major installation and backups at regular intervals. + + + + + + + New Versions + + + This document and the patches are available at + http://www.brigadoon.de/peter/kde. + + + + + + + + Credits + + + Werner.Westerkamp (at) lbbw.de for giving useful + tips, and proof-reading this HOWTO + + + + remalone (at) sympatico.ca for first-time testing + the instructions given here + + + + + + + + Feedback + + + Please send any comments, corrections or additions to one of the authors. + + + + + + + + + + Motivation + + + The following requirements had to be met: + + + + + + The user should not be able to open an interactive shell + (Terminal), or run arbitrary commands, + + + + + + The user should not have a view to the filesystem, so no + filemanager, + + + + + The user should not be able to modify or create files + directly by means provided by KDE (no editor, menuedit, etc.). + + + + + +Note that these are not requirements for the applications that run under KDE. +Every application should make sure by itself, that these requirements are met. +It is known, that of course many applications have an Open File Dialog, and +thus could modify Files under .kde and so make it possible to run arbitrary +commands. + + + +The restrictions should only apply when an environment variable +KDE_MODE is +set to ``restricted''. If it is not set, a normal KDE Desktop should open. + +It follows, that the user can only run applications that are found in +the Application menu. So the administrator must be able to provide the +applications. A tool is needed to add, remove and modify entries in +the menu. + + + + + + + + + + + Implementation + + + Source Code Patches + + +Some files in kdebase-2.1.1 have to be patched: + + + + + + +appletop_mnu.cpp.patch: Applets on the panel can be moved and removed, but +the Preferences dialog is disabled. + + + + + +k_mnu.cpp.patch: Run Command... and +Configure Panel entries are + removed from the standard K Menu + + + + + +khc_man.cc.patch: Online Help is completely disabled. This would + open konqueror. + + + + + +konq_popupmenu.cc.patch: right-mouse menu on icons on the desktop + are reduced to Cut, +Copy, Paste, +Delete, ... but no Open With +..., + no Edit File Type... and no +Poperties... dialogs. + + + + + +pagerapplet.cpp.patch: on minipager selection of type +(Preview, +Number, + Name) is disabled. this caused trouble in +multihead environment. + + + + + +panel.cpp.patch: right mouse menu on Panel is disabled. + + + + + + + + Global modifications + + + +Instead of a dcop call, a program screensaver is +executed, which must be found in the PATH. Just create +a script called screensaver +with the following contents: + + +#!/bin/bash + +dcop kdesktop KScreensaverIface lock + + +make it executable and put it in $KDEDIR/bin. + + + + + +Instead of the normal procedure, a program klogout +is called, which must be found in the PATH. Create a +script called klogout with the following contents: + + +#!/bin/bash + +dcop kdesktop KDesktopIface logout + +make it executable and put it in $KDEDIR/bin, +where $KDEDIR is the install directory of KDE and +$KDEDIR/bin is found in your +PATH. + + + + + + +krootwm.cc.patch: klogout is executed instead of a dcop call + + + + +systemtrayapplet.cpp.patch: again call of klogout and screensaver + instead of dcop calls. + + + + + +workspace.cpp.patch: call of klogout instead of dcop call. + + + + + + +Everything else can be done with normal configuration, that is: + +(Configuration files can be found in $KDEDIR/share/config) + +Remove Trash, Templates and Autostart Icons from the desktop and disable +AltF2 +by modifying kdeglobals. Make sure the following +entries exist: + + +[Paths] + +Trash=$HOME/.kde2/Trash/ + +Autostart=$HOME/.kde2/Autostart/ + +Templates=$HOME/.kde2/Templates/ + +Desktop=$HOME/.kde2/Desktop/ + + +[Global Keys] + +Execute command= + + +(it may be .kde instead of .kde2) + + + + +disable Desktop menu and tips on start. Make sure the following entry +exists in kdesktoprc: + + +[Mouse Buttons] + +Right= + +[General] + +TipsOnStart=false + + +You could also login as the special user, and configure it only for +him, then the config files are found in $KDEHOME/share/config where +$KDEHOME is normally $HOME/.kde. + + + + + + + How to set the variable KDE_MODE + + +To answer this, you must understand what happens after you +successfully authorized yourself to the system: Depending on your +distribution, some scripts are executed, from which one should be +modified to set KDE_MODE. There is a script called +Xsession under /etc/X11/xdm or +/usr/X11R6/lib/xdm, which you could modify, or +startkde, that is located under +$KDEDIR/bin. Note however, that the variable +must be set prior to calling the kde processes. + + + +Since we had the need to make a setup for a big environment (now +reaching 300 users) we wrote an application that enables us to +administer. It also creates the KDE Menus. It writes a file called +.env.sh in a user's home directory, that will be +sourced in Xsession. That is what you could do. So +you could put in .env.sh of that specific user's +home directory: + + + +#!/bin/sh + +KDE_MODE="restricted" + +export KDE_MODE + + + +and add to Xsession, somewhere prior to calling startkde: + + + +if [ -f $HOME/.env.sh ]; then + + . $HOME/.env.sh + +fi + + + +We also have two kdedirs that looks like to separate installations of +KDE, this was neccessary so "normal" users could still have a +full-featured KDE. So we have an original kdedir, and a restricted +kdedir, in which we removed entries under +share/applnk and set the variable +KDEDIR (under KDE 2 the variable KDEDIRS +was introduced but KDEDIR is still used). The files +under share/applnk make up the menu. Caution, you +cannot just remove all files there, because some are needed to +initialize KDE. + + + +You also set the Variable KDEDIR in +Xsession, after sourcing +.env.sh like this: + + + +case "$KDE_MODE" in + + restricted) + + KDEDIR=/usr/local/kde/restricted_kdedir + + ;; + + *) + + KDEDIR=/usr/local/kde + +esac + +export KDEDIR + + + +Replace /usr/local/kde with the install directory +of your KDE. The contents of +/usr/local/kde/restricted_kdedir looks like: + + + +bin -> ../bin + +cgi-bin -> ../cgi-bin + +etc -> ../etc + +lib -> ../lib + +share + + + + + + +only share is a real directory, every other directory is a symbolic +link pointing to original +kdedir. /usr/local/kde/restricted_kdedir/share +has the following contents: + + + +aclocal -> ../../share/aclocal + +applnk + +apps -> ../../share/apps + +autostart -> ../../share/autostart + +config -> ../../share/config + +doc -> ../../share/doc + +fonts -> ../../share/fonts + +icons -> ../../share/icons + +locale -> ../../share/locale + +mimelnk -> ../../share/mimelnk + +services -> ../../share/services + +servicetypes -> ../../share/servicetypes + +sounds -> ../../share/sounds + +templates -> ../../share/templates + +wallpapers -> ../../share/wallpapers + + + + + + +only applnk is a real directory. As a minimal requirement remove +everything except: + + + +Settings/Peripherals/mouse.desktop + +Settings/LookNFeel/background.desktop + + /colors.desktop + + /kwinoptions.desktop + + /style.desktop + + /virtualdesktops.desktop + + + +under /usr/local/kde/restricted_kdedir/share/applnk + + + + + + + +
+ + diff --git a/LDP/retired/KickStart-HOWTO.sgml b/LDP/retired/KickStart-HOWTO.sgml new file mode 100644 index 00000000..ac65edf6 --- /dev/null +++ b/LDP/retired/KickStart-HOWTO.sgml @@ -0,0 +1,1184 @@ + + +
+RedHat Linux KickStart HOWTO + +<author>Martin Hamilton <tt/<martinh@gnu.org>/ +<date>v0.2, 11 January 1999 + +<abstract> +Archived: 2004-05-17 at the request of the author by Emma Jane Hogbin +(Technical Review Coodinator). Additional information +can be obtained from: <url name="Red Hat Linux Customization Guide" +url="http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/part-install-info.html"> + +<p> +This HOWTO briefly describes how to use the RedHat Linux +<em>KickStart</em> system to rapidly install large numbers of +identical Linux boxes. For advanced users, we describe how to modify +the KickStart installation procedure to do your own thing, and give a +quick guide to building RPM packages of your own. +</abstract> + +<toc> + + +<sect>Copyright<p> + +Copyright (c) 1998 Martin Hamilton, All rights reserved. This is free +documentware; you can redistribute it and/or modify it under the terms of +version 2 or later of the <url name="GNU General Public License" +url="http://www.gnu.org/copyleft/gpl.html">.<p> + + +<sect>Homepage<p> + +If you got this document from a Linux HOWTO mirror site or a CD-ROM, +you might want to check back to the <url name="KickStart HOWTO home +page" url="http://wwwcache.ja.net/dev/kickstart/"> to see if there's a +newer version around.<p> + + +<sect>Introduction<p> + +RedHat Linux version 5 comes with a a little-known (and until now, not +hugely documented) feature called <em>KickStart</em>. This lets you +automate most/all of a RedHat Linux installation, including:<p> + +<itemize> +<item> Language selection +<item> Network configuration and distribution source selection +<item> Keyboard selection +<item> Boot loader installation (e.g. lilo) +<item> Disk partitioning and filesystem creation +<item> Mouse selection +<item> X Window system server configuration +<item> Timezone selection +<item> Selection of an (initial) root password +<item> Which packages to install +</itemize><p> + +Eagle eyed RedHat users will probably have realised by now that these +are essentially the main steps involved in the manual installation of +a RedHat Linux system. KickStart makes it possible for you to script +the regular installation process, by putting the information you would +normally type at the keyboard into a configuration file.<p> + +<em>But wait - there's more :-)</em><p> + +Having finished the normal installation process, KickStart also lets +you specify a list of shell level commands which you would like to be +executed. This means that you can automatically install extra local +software not distributed as part of RedHat Linux (yes, there are even +more free software programs than the ones you get with the RedHat +distribution. Some can't be distributed by RedHat on legal grounds, +e.g. the <tt>ssh</tt> and <tt>PGP</tt> encryption systems) and carry +out any tidying up you may need to do in order to get a fully +operational system.<p> + + +<sect>Prerequisites<p> + +There are two approaches to a KickStart install - one is to simply +copy your KickStart configuration file to a RedHat boot floppy. The +other is to use a regular boot floppy and get your KickStart config +file off the network.<p> + +In both cases, you'll need: + +<enum> +<item> Intel (i386) class machines - KickStart appears to only work + on these at the time of writing. +<item> KickStart config file - we'll talk about this in the next + section. +<item> RedHat boot disk - preferably from the <em>updates</em> + directory, to take advantage of any fixes/driver updates. +<item> DNS entries for the IP addresses you'll be using - optional, + but will stop the installation from prompting you for your + machine's domain name. +</enum><p> + +If you want to fetch your config file over the network, you'll need to +export it via NFS - this is the only access method supported at the +moment. The config file lets you specify a different NFS server to +fetch the RedHat distribution itself from.<p> + +You can configure a static IP address for your machine - e.g. a special +one reserved for KickStart installations. Alternatively, if you don't +want to hard code an IP address in the config file you can tell KickStart +to use a BOOTP/DHCP server to fetch this. Some servers will allocate new +addresses in a given range automatically, e.g. <url name="the CMU BOOTP +server with dynamic addressing extensions" + url="ftp://ftp.ntplx.net/pub/networking/bootp">.<p> + +More information on NFS and BOOTP/DHCP is in Appendix A.<p> + + +<sect>Setting up a boot floppy<p> + +Essentially, all you have to do is copy your KickStart config file +to <em>/ks.cfg</em> on the RedHat boot floppy, e.g.<p> + +<tscreen><verb> + mcopy ks.cfg a: +</verb></tscreen><p> + +However - the RedHat boot floppy is pretty full, and you may find that +you have to delete some of the other files to make room for the +KickStart config file. I was able to make enough room for mine by +deleting the various message files normally displayed by the +<tt>SYSLINUX</tt> boot loader, e.g.<p> + +<tscreen><verb> + mdel a:\*.msg +</verb></tscreen><p> + +Another approach would be to throw away the drivers for some of the +hardware you don't have - see the section on modifying the boot +floppy below.<p> + +You may also want to edit <em>syslinux.cfg</em>, the <tt>SYSLINUX</tt> +config file. This also lives in the top level directory of the RedHat +boot floppy. For instance, the following <em>syslinux.cfg</em> will +cause KickStart mode to be entered into automatically as the machine +boots up, without the normal delay:<p> + +<tscreen><verb> + default ks + prompt 0 + label ks + kernel vmlinuz + append ks=floppy initrd=initrd.img +</verb></tscreen><p> + +Note that you almost probably want to base your boot and supplementary +floppies on the most recent disk images available in the +<em>updates/i386</em> on your local RedHat mirror site. Older images +may be buggy or have driver support for less hardware.<p> + + +<sect>The KickStart config file<p> + +There are three main sections to the config file:<p> + +<enum> +<item> System info, e.g. disk partitioning and network config +<item> RedHat packages to install +<item> Post-installation shell commands to run +</enum<p> + +There are some other possibilities which we won't talk about here, but +<bf>might</bf> work. For more information check out the sample +KickStart config in <em>misc/src/install/ks.samp</em> and +<em>doc/README.ks</em> under the top level <em>i386</em> RedHat +distribution directory on your CD-ROM or local RedHat mirror site.<p> + + +<sect1>System info<p> + +The available directives which I've been using are:<p> + +<descrip> +<tag/lang/Language configuration, e.g. for English +<tscreen><verb> +lang en +</verb></tscreen> +<tag/network/Network configuration, e.g. to use BOOTP/DHCP +<tscreen><verb> +network --bootp +</verb></tscreen> +<tag/nfs/NFS server and directory to install from, e.g. +<tscreen><verb> +nfs --server chicken.swedish-chef.org /mnt/cdrom +</verb></tscreen> +to use the NFS server <em>chicken.swedish-chef.org</em> and try to +mount the RedHat distribution from the directory <em>/mnt/cdrom</em>. +<tag/keyboard/Select keyboard type, e.g. for UK keyboards +<tscreen><verb> +keyboard uk +</verb></tscreen> +<tag/zerombr/Clear the Master Boot Record - removes any existing +operating system boot loader from your disk +<tag/clearpart/Clear existing partitions - e.g. to remove all existing +disk partitions prior to installation +<tscreen><verb> +clearpart --all +</verb></tscreen> +<tag/part/Partition the disk, e.g. to make a root filesystem of + 500MB +<tscreen><verb> +part / --size 500 +</verb></tscreen> +<tag/install/Make a fresh installation of RedHat Linux. +<tag/mouse/Set the mouse being used, e.g. for a PS/2 or compatible +"bus mouse" +<tscreen><verb> +mouse ps/2 +</verb></tscreen> +<tag/timezone/Set the timezone, e.g. for local time in the UK +<tscreen><verb> +timezone --utc Europe/London +</verb></tscreen> +<tag/rootpw/Set the initial root password, based on a previously +derived encrypted password +<tscreen><verb> +rootpw --iscrypted XaacoeGPmf/A. +</verb></tscreen> +<tag/lilo/Install the LILO boot loader, e.g. in the Master Boot Record +<tscreen><verb> +lilo --location mbr +</verb></tscreen> +<tag/%packages/Packages to install - see below. +<tag/%post/Post-installation shell commands - see below. +</descrip><p> + +Note that the directory where KickStart is looking for the RedHat +distribution should have a subdirectory <em>RedHat</em>, which +contains the RedHat distribution tree for the platform in question. +In the above example, we should see something like the following files +and directories:<p> + +<tscreen><verb> +/mnt/cdrom/RedHat +/mnt/cdrom/RedHat/base +/mnt/cdrom/RedHat/contents +/mnt/cdrom/RedHat/i386 +/mnt/cdrom/RedHat/instimage +/mnt/cdrom/RedHat/RPMS +/mnt/cdrom/RPM-PGP-KEY +</verb></tscreen><p> + +If you're installing off a CD-ROM rather than off the network, the +contents should look something like this:<p> + +<tscreen><verb> +RedHat +RedHat/base +RedHat/contents +RedHat/i386 +RedHat/instimage +RedHat/RPMS +RPM-PGP-KEY +</verb></tscreen><p> + +If you have the RedHat distribution for multiple architectures (e.g. +on an NFS server - they're too big to fit more than one architecture's +version onto a single CD-ROM), you'll notice that each distribution +has the same files and directories under a subdirectory, e.g.<p> + +<tscreen><verb> +alpha/RPM-PGP-KEY +i386/RPM-PGP-KEY +sparc/RPM-PGP-KEY +</verb></tscreen><p> + +There should be a file <tt>architecture</tt>/Redhat/<tt>architecture</tt>, +e.g. <em>i386/Redhat/i386</em>.<p> + +If you want to create your own encrypted passwords, it's very easy +using Perl, e.g.<p> + +<tscreen><verb> +% perl -e 'print crypt("schmurrdegurr", "Xa") . "\n";'p +</verb></tscreen><p> + +Other options (or mooted options), which I've not tried:<p> + +<descrip> +<tag/cdrom/Install off CD-ROM rather than network. +<tag/device/Explicitly declare device details, e.g. +<tscreen><verb> +device ethernet 3c509 --opts "io=0x330, irq=7" +</verb></tscreen> +Alternative values of <tt>device</tt> include <tt>scsi</tt> for SCSI +controllers and <tt>cdrom</tt> for proprietary CD-ROM drives. +<tag/upgrade/Upgrade an existing installation rather than make + a fresh installation. +<tag/xconfig/Configure X Window server, graphics card and monitor. +e.g. +<tscreen><verb> +xconfig --server "Mach64" --monitor "tatung cm14uhe" +</verb></tscreen> +</descrip><p> + +I've not delved too deeply into this last one, because I'm not ever +planning to run X on the console of any of my KickStarted machines. +I'm told that running <tt>xconfig</tt> within KickStart itself is a +bit flaky, but the same functionality is also available from the +command line via <tt>Xconfigurator</tt> - so you might be best off +leaving this to the post-installation script.<p> + +Here's how this first part of a KickStart config file looks when we +put all the bits together:<p> + +<tscreen><verb> +lang en +network --static --ip 198.168.254.253 --netmask 255.255.255.0 + --gateway 198.168.254.1 --nameserver 198.168.254.2 +nfs --server chicken.swedish-chef.org /mnt/cdrom +keyboard uk +zerombr yes +clearpart --all +part / --size 500 +part swap --size 120 +install +mouse ps/2 +timezone --utc Europe/London +rootpw --iscrypted XaacoeGPmf/A. +lilo --location mbr +</verb></tscreen><p> + +Note that some of the RedHat documentation refers to an invocation +of the <tt>network</tt> directive which doesn't actually work in +practice: <tt>network --option</tt>. The correct invocation is to +put <tt>network</tt> followed by <tt>--static</tt>, <tt>--bootp</tt> +or <tt>--dhcp</tt>. Be aware that the BOOTP and DHCP options are +different - to the extent that they even use different code.<p> + +You can add the <tt>--grow</tt> parameter to a <tt>part</tt> +directive to indicate that it's OK to grow the partition beyond +the size you specify. It probably only makes sense to have one +partition tagged with <tt>--grow</tt>.<p> + + +<sect1>Packages to install<p> + +The start of the packages section of the KickStart config file is +indicated by the presence of a <tt>%packages</tt> directive on a line +of its own. This is followed by one or both of two types of package +specifier - individual packages may be installed by giving the name of +their RPM (excluding the version and platform information), and groups +of packages may be installed by giving their group name.<p> + +Here's a sample <tt>packages</tt> section for a KickStart config file: + +<tscreen><verb> +%packages +@ Base +netkit-base +bind-utils +ncftp +rdate +tcp_wrappers +traceroute +cmu-snmp +</verb></tscreen><p> + +So, what are these groups ? Well, there are a number of groups +defined by default in a file called <em>base/comps</em> under the +RedHat distribution's top level directory. Here are the ones which +were current at the time of writing:<p> + +<itemize> +<item> Base +<item> Printer Support +<item> X Window System +<item> Mail/WWW/News Tools +<item> DOS/Windows Connectivity +<item> File Managers +<item> Graphics Manipulation +<item> X Games +<item> Console Games +<item> X multimedia support +<item> Console Multimedia +<item> Print Server +<item> Networked Workstation +<item> Dialup Workstation +<item> News Server +<item> NFS Server +<item> SMB (Samba) Connectivity +<item> IPX/Netware(tm) Connectivity +<item> Anonymous FTP/Gopher Server +<item> Web Server +<item> DNS Name Server +<item> Postgres (SQL) Server +<item> Network Management Workstation +<item> TeX Document Formatting +<item> Emacs +<item> Emacs with X windows +<item> C Development +<item> Development Libraries +<item> C++ Development +<item> X Development +<item> Extra Documentation +</itemize><p> + +You'll notice that they correspond to the various configurations which +you're prompted for during a manual installation. Note that some of +the packages in a given package group are duplicated in other groups, +and that you can install multiple groups of packages without this +causing problems. Each group's entry in the <em>comps</em> listing +looks similar to this:<p> + +<tscreen><verb> +0 Extra Documentation +sag +lpg +howto +faq +man-pages +end +</verb></tscreen><p> + +It seems that groups with a <em>1</em> next to their name (the first +line above) are selected for installation by default. You can customise +the Linux installation process even further by creating your own groups +or redefine existing ones by editing this file.<p> + + +<sect1>Post-installation shell commands<p> + +This is probably the best feature of all, and something which there is +no direct equivalent to in the manual installation process. What we +can do here is specify a sequence of shell level commands which should +be executed after the main installation (disk partitioning, package +installation, and so on) is complete.<p> + +The beginning of this section is signified by the <tt>%post</tt> +directive in the KickStart config file. In what follows you can take +advantage of all of the utilities which have been installed on your +newly built Linux system, e.g.<p> + +<tscreen><verb> +%post +ln -s /etc/rc.d/init.d /etc/init.d +ln -s /etc/rc.d/rc.local /etc/rc.local +ln -s /usr/bin/md5sum /usr/bin/md5 +ln -s /usr/bin/perl /usr/local/bin/perl +chmod ug-s /bin/linuxconf +mkdir /var/tmp/tmp +perl -spi -e 's!image=/boot/vmlinuz-.*!image=/boot/vmlinuz!' /etc/lilo.conf +rm /etc/rc.d/rc*.d/*sendmail +</verb></tscreen><p> + +You can also use I/O redirection and here documents:<p> + +<tscreen><verb> +cat <<EOF >>/etc/passwd +squid:*:102:3500:Squid Proxy:/usr/squid:/bin/bash +EOF + +cat <<EOF >>/etc/group +cache:x:3500: +EOF +</verb></tscreen><p> + +Modify the run-time startup scripts:<p> + +<tscreen><verb> +cat <<EOF >>/etc/rc.local +echo 8192 > /proc/sys/kernel/file-max +echo 32768 > /proc/sys/kernel/inode-max + +[ -x /usr/sbin/sshd ] && /usr/sbin/sshd +[ -x /usr/sbin/cfd ] && /usr/sbin/cfd + +EOF +</verb></tscreen><p> + +Set up <em>crontab</em> entries:<p> + +<tscreen><verb> +cat <<EOF >/tmp/crontab.root +# Keep the time up to date +0,15,30,45 * * * * /usr/sbin/ntpdate -s eggtimer 2>&1 >/dev/null +# Recycle Exim log files +1 0 * * * /usr/exim/bin/exicyclog +# Flush the Exim queue +0,15,30,45 * * * * /usr/exim/bin/exim -q +EOF + +crontab /tmp/crontab.root +rm /tmp/crontab.root +</verb></tscreen><p> + +And even install other RPMs which you made yourself:<p> + +<tscreen><verb> +rpm -i ftp://chicken.swedish-chef.org/rpms/squid.rpm +rpm -i ftp://chicken.swedish-chef.org/rpms/ssh.rpm +rpm -i ftp://chicken.swedish-chef.org/rpms/exim.rpm +rpm -i ftp://chicken.swedish-chef.org/rpms/cfengine.rpm +rpm -i ftp://chicken.swedish-chef.org/rpms/linux.rpm + +ssh-keygen -b 1024 -f /etc/ssh_host_key -N "" +depmod -a +</verb></tscreen><p> + +Note that you can achieve the same effect by making your own RPMs +containing the commands you want executed - see below for more +information. Give them a carefully chosen name and you can force them +to be installed first (e.g. name starts with 'aaa') or last (e.g. +name starts with 'zzz').<p> + +Be aware that a less painful way of doing root crontab entries is to +create them as files in one or more of the directories +<em>/etc/cron.hourly</em>, <em>/etc/cron.daily</em>, +<em>/etc/cron.weekly</em> and <em>/etc/cron.monthly</em>.<p> + +More information about making your own RPMs is available in Appendix B.<p> + + +<sect>Installation itself<p> + +Boot the to-be-installed machine off your RedHat boot floppy as usual, +but instead of pressing <tt>RETURN</tt> at the <tt>SYSLINUX</tt> +prompt, type <tt>linux ks</tt>.<p> + +If you're lucky, this will be all you have to type!<p> + +If you customised your RedHat boot floppy as outlined above, you won't +even need to do this bit :-)<p> + +Since we're really just automating the normal steps involved in a +RedHat installation, the normal dialogs may appear if/when KickStart +gets confused about what to do next. The most likely case is that +your network interface won't be detected automatically, and you'll be +prompted for its IRQ and I/O address space. KickStart tends to need +help for ISA bus cards, but detects PCI bus cards automatically.<p> + +You can keep an eye on what KickStart is doing by by switching virtual +consoles as usual:<p> + +<itemize> +<item> Alt-F1 - installation dialog +<item> Alt-F2 - shell prompt +<item> Alt-F3 - install log (messages from install program) +<item> Alt-F4 - system log (messages from kernel, etc.) +<item> Alt-F5 - other messages +</itemize><p> + + +<sect>Mounting the boot/supp disks<p> + +The RedHat boot disk <em>boot.img</em> is in MS-DOS format, using the +<tt>SYSLINUX</tt> program to boot up. The supplementary disk +<em>supp.img</em> is a Linux <tt>ext2</tt> filesystem. If you have +support for the loopback filesystem in your Linux kernel, you can mount +both of these files in your filesystem and hack at them:<p> + +<tscreen><verb> +# mkdir -p /mnt/boot /mnt/supp +# mount -o loop -t msdos boot.img /mnt/boot +# mount -o loop supp.img /mnt/supp +</verb></tscreen><p> + +Now you should be able to see and manipulate the files on the boot and +supplementary disk under <em>/mnt/boot</em> and <em>/mnt/supp</em> +respectively. Phew! Note that older versions of <tt>mount</tt> may +not be able to handle the <tt>-o loop</tt> option. In these cases +you'll need to explicitly use <tt>losetup</tt> to configure the +loopback device for each file, e.g.<p> + +<tscreen><verb> +# losetup /dev/loop0 boot.img +# mount -t msdos /dev/loop0 /mnt/boot +</verb></tscreen><p> + +You might also need to explicitly use the <tt>-t ext2</tt> option when +mounting an <tt>ext2</tt> filesystem like the one on the supplementary disk. +But, it looks like people with modern Linux distributions shouldn't have to +worry about this.<p> + +Of course, if you don't want to mess around too much, you can cut a +corner and manipulate actual floppy disks rather than these floppy +disk images. If time is important, you'll probably prefer to use the +loopback devices, since you can hack around with the disk images +without incurring the latency associated with a genuine floppy disk +read/write.<p> + + +<sect>Modifying the RedHat installer<p> + +If you want to mess around with the installation procedure itself, the +source code can be found on the RedHat CD-ROM or your local RedHat +mirror site. It's in <em>misc/src/install</em> under the +<em>i386</em> distribution top level directory.<p> + +If you examine the RedHat boot disk you'll see that, in addition to +the Linux kernel <em>vmlinuz</em>, there's a large file +<em>initrd.img</em>:<p> + +<tscreen><verb> +- -rwxr-xr-x 1 root root 559 May 11 15:48 boot.msg +- -rwxr-xr-x 1 root root 668 May 11 15:48 expert.msg +- -rwxr-xr-x 1 root root 986 May 11 15:48 general.msg +- -rwxr-xr-x 1 root root 968842 May 11 15:48 initrd.img +- -rwxr-xr-x 1 root root 1120 May 11 15:48 kickit.msg +- -r-xr-xr-x 1 root root 5352 May 11 15:48 ldlinux.sys +- -rwxr-xr-x 1 root root 875 May 11 15:48 param.msg +- -rwxr-xr-x 1 root root 1239 May 11 15:48 rescue.msg +- -rwxr-xr-x 1 root root 402 May 11 15:48 syslinux.cfg +- -rwxr-xr-x 1 root root 444602 May 11 15:48 vmlinuz +</verb></tscreen><p> + +You guessed it, this is another <tt>ext2</tt> filesystem saved as a file +- - but with a twist. It's actually compressed as well. You can uncompress +it and then mount the result, e.g.<p> + +<tscreen><verb> +# gzip -dc /mnt/boot/initrd.img >/tmp/initrd.ext2 +# mkdir /mnt/initrd +# mount -o loop /tmp/initrd.ext2 /mnt/initrd +</verb></tscreen><p> + +Probably the most important part of this filesystem is the collection +of loadable kernel modules which are included with the boot disk. If +you need to merge in a new version of a driver, you'll need to either +replace <em>vmlinuz</em> with a new kernel which has this statically +linked, or replace it in the modules collection. What's more, you may +need to throw other modules away to make room.<p> + +The modules collection is the file <em>modules/modules.cgz</em>. +Wondering what that might be ? It's actually a compressed +<tt>cpio</tt> archive, believe it or not! And you thought nobody used +<tt>cpio</tt> any more... Actually RPM itself uses <tt>cpio</tt> +internally, too. Here's how to hack around with it:<p> + +<tscreen><verb> +# gzip -dc /mnt/initrd/modules/modules.cgz >/tmp/modules.cpio +# cpio -itv <modules.cpio >modules.listing +# mkdir modules +# cpio -idumv <../modules.cpio +</verb></tscreen><p> + +I don't believe that there is currently a way under Linux (at least in +mainstream distributions) to transparently access compressed +filesystems. Let me know if you know better!<p> + +If you change anything, remember to:<p> + +<enum> +<item> Use <tt>cpio</tt> to recreate the archive. How to do this is + left as an exercise for the reader... +<item> Use <tt>gzip</tt> to compress the resulting archive. +<item> Copy it to <em>/mnt/initrd</em>, or wherever you put the + uncompressed <em>initrd.img</em> archive. +<item> Unmount <em>/mnt/initrd</em> (or whatever you called it). +<item> Compress the new <em>initrd.img</em> using <tt>gzip</tt> + again. +<item> Copy the resulting archive onto the boot disk image - + <em>/mnt/boot/initrd.img</em> in our example. +<item> Unmount the boot disk image, e.g. <em>/mnt/boot</em>. +</enum><p> + +Finally, you can now create new boot floppies using this modified boot +disk setup, e.g.<p> + +<tscreen><verb> +# cat boot.img >/dev/fd0 +</verb></tscreen><p> + + +<sect>FAQs/Wish list<p> + +<bf>Q:</bf> After KickStart installation, my machine won't boot up. +The BIOS complains with a message like <tt>Missing operating system</tt>.<p> + +<bf>A:</bf> Sounds like the partition with the root filesystem on isn't +bootable. Use <tt>fdisk</tt> to toggle its bootable status.<p> + +<bf>Q:</bf> After the floppy boots, I get the message: + <tt>Error opening files for kickstart copy: File exists</tt>.<p> + +<bf>A:</bf> Use a more recent version of <em>boot.img</em> and +<em>supp.img</em> - look in the <em>updates</em> directory of your +local RedHat mirror site. There was a bug in some older versions +of these for RedHat 5.1.<p> + +<bf>Q:</bf> Can you have all outstanding patches (update RPMs) applied +automatically too ? How ?<p> + +<bf>A1:</bf> Copy the RPMs you want installing to the RPMS directory +from which the installation is going to take place, get rid of the +older RPMs, and update the file <em>RedHat/base/hdlist</em> with the +new RPM details. See Appendix C for a script from Eric Doutreleau to do +this for you. If you do this yourself, remember to run <em>genhdlist</em> +afterwards!<p> + +<bf>A2:</bf> Try this Perl script: <url name="patchup" +url="http://wwwcache.ja.net/dev/patchup/">. This compares the RPMs +your system has installed with those in a nominated directory and +reports on the ones it thinks need updating. It can even install them +for you if you trust it to.<p> + +<bf>A3:</bf> <url name="rpm2hml" url="http://rufus.w3.org/linux/rpm2html/"> +has a much more powerful (12MB of C code vs. a page of Perl!) version of A2.<p> + +<bf>Q:</bf> A single config file on the install server for all of the clients, +perhaps as a fallback after trying <em>IPADDR-kickstart</em> ?<p> + +<bf>A1:</bf> Use the BOOTP/DHCP 'boot file' parameter <em>bf</em> to set +the filename.<p> + +<bf>A2:</bf> Add a a record <tt>bf=/kickstart/ks.cfg</tt> to the relevant +entry in <em>/etc/bootptab</em>. + +<bf>Q:</bf> More flexibility when things go wrong - e.g. prompt for alternate +locations if distribution not found on CD-ROM.<p> + +<bf>A:</bf> ?<p> + +<bf>Q:</bf> Explicit exclusion of packages - e.g. everything apart from +<em>sendmail</em>.<p> + +<bf>A:</bf> Rebuild the <bf>BASE</bf> package without sendmail.<p> + +<bf>Q:</bf> Choose which services are started automatically on boot-up by the +run-level scripts under <em>/etc/rc.d/</em>.<p> + +<bf>A:</bf> The <em>chkconfig</em> utility lets you configure which +services are run automatically on boot-up. You can run this in your +post-installation script section, e.g. to run <em>ypbind</em> in run +levels 3, 4 and 5:<p> + +<tscreen><verb> +chkconfig --level 345 ypbind on +</verb></tscreen><p> + +and it will start the ypbind level on the 345 level. + +<bf>Q:</bf> When executing the shell commands in the <tt>%post</tt> section, +bring any output up in another virtual console rather than overwriting the +main screen. <em>Could be done in the shell commands section using +<tt>open</tt>?</em>.<p> + +<bf>A:</bf> No problem - do something like this:<p> + +<tscreen><verb> + exec >/dev/tty5 +</verb></tscreen><p> + +<bf>Q:</bf> Does the filesystem creation code check for bad blocks ?<p> + +<bf>A:</bf> If you switch to the virtual console where the filesystem +creation output is being displayed, you won't see any mention of the +'read-only' test being performed. Looks like the answer is no.<p> + +<bf>Q:</bf> Can I arrange things so some of my machines are configured +differently from others ?<p> + +<bf>A:</bf> You could move the host dependent stuff into the +scripted section of the KickStart config - e.g. only install a given +RPM if on a given machine. It would be useful to have a conditional +installation feature in the packages section of the config file, +e.g. switching on architecture, or hostname/domain name/IP address.<p> + +<bf>Q:</bf> Are there any changes between RedHat 5.1 and 5.2 ?<p> + +<bf>A1:</bf> Lots of changes in the installer, but mostly bug fixes +or cosmetic improvements. No impact on KickStart as far as I can +tell - from a <em>diff -rcs</em> of the two <em>misc/src/install</em> +directories.<p> + +<bf>A2:</bf> RH5.2 now apparently includes the automatic IP allocation/DHCP +patches to <tt>bootpd</tt>, but they have left out the documentation +which tells you how to use it. + +<bf>Q:</bf> (How) can you clear a specific partition or partitions ? +e.g. to leave <em>/home</em> but zap <em>/</em>.<p> + +<bf>A:</bf> You can't - yet!<p> + +<bf>Q:</bf> Can you arrange to have your partitions created across +multiple drives ? e.g. <em>/</em> on <tt>sda</tt> and <em>/home</em> +on <tt>sdb</tt>.<p> + +<bf>A:</bf> Don't think so - looks like you only get access to the +first drive from the partitioning tool.<p> + +<bf>Q:</bf> Is it possible to specify existing partitions to be +included in the mount table, or is it only possible to specify the +creation of new partitions that will then be included?<p> + +<bf>A:</bf> ?<p> + +<bf>Q:</bf> After running <tt>mkkickstart</tt>, where is the file +it creates?<p> + +<bf>A:</bf> It doesn't create a file - it dumps the KickStart +config to <tt>stdout</tt>.<p> + +<bf>Q:</bf> In virtual console 4 (Alt-F4) I get <tt>Unable to load NLS +charset cp437(nls_cp437)</tt>. What does this mean ? Should I be +worried ?<p> + +<bf>A:</bf> Sounds like you're trying to mount a CD-ROM burned with +the Joliet (Unicode extensions to ISO 9660. In theory the filenames +on the CD-ROM might get munched and not make it through to Linux +correctly. In practice it doesn't seem to cause any problems - +could be a spurious dependency ?<p> + +<bf>Q:</bf> Why am i getting the X Window System installed ? I didn't +put it in my list of packages.<p> + +<bf>A:</bf> The <tt>XFree86-VGA16</tt> RPM is a 'base' component, and +as such always gets installed - unless you change the definition of +the base class.<p> + +<bf>Q:</bf> In my post-installation script, can I use the packages +which have been installed by now to do funky things not possible with +the limited tools on the floppies ?<p> + +<bf>A:</bf> Yep - e.g. if you chose to install Perl when you put your +KickStart config together, almost anything is possible in about five +lines :-)<p> + + +<sect>Credits<p> + +Thanks to Eric Doutreleau for the info about <em>chkconfig</em>, the +<tt>SYSLINUX</tt> config file hack, and the Perl script for updating +your distribution server's RPMs. Thanks to Robert Kaminsky for +extensive investigations. Thanks to Piete Brooks, Flavia Regina +Munhoz, Tom Toffoli, Bob Robbins, Charlie Brady and Ragen Herrington, +for their comments and questions.<p> + + +<sect>Appendix A - Configuring BOOTP/DHCP and NFS<p> + +If you're wondering what on earth this BOOTP and DHCP stuff is, more +information is available at <url name="the DHCP WWW site" +url="http://www.dhcp.org/">. NFS is documented separately in detail +in the NFS HOWTO, and there's a DHCP mini-HOWTO too. I've tried to +provide enough details here to help you get started, whilst not +treating the topics in depth - let me know if you think this is +overkill.<p> + +In the BOOTP/DHCP + NFS configuration we're discussing, the KickStart +config file should be NFS mountable by the machine being installed +from <em>/kickstart/IPADDR-kickstart</em> on the BOOTP/DHCP server, +where <em>IPADDR</em> is the IP address of the new machine, e.g. +<em>/kickstart/198.168.254.254-kickstart</em> for the machine +<em>198.168.254.254</em>.<p> + +You should be able to override this location by returning +the <tt>bf</tt> parameter (boot file) in your BOOTP/DHCP response. It +may even be possible to have this NFS mounted off another machine +entirely.<p> + +To NFS export some directories from an existing Linux box, create the +file <em>/etc/exports</em> with contents something like:<p> + +<tscreen><verb> +/kickstart *.swedish-chef.org(ro,no_root_squash) +/mnt/cdrom *.swedish-chef.org(ro,no_root_squash) +</verb></tscreen><p> + +Note that if you didn't register the IP addresses you're going to be +using in the DNS, you may be told to get lost by the NFS server and/or +the RPC portmapper. In this you can probably get away with putting +IP address/netmask pairs in the config files, e.g.<p> + +<tscreen><verb> +/kickstart 198.168.254.0/255.255.255.0(ro,no_root_squash) +</verb></tscreen><p> + +and in <em>/etc/hosts.allow</em>:<p> + +<tscreen><verb> +ALL: 194.82.103.0/255.255.255.0: ALLOW +</verb></tscreen><p> + +This is because most Linux distributions use TCP wrappers to do +access control for some or all of the NFS related daemons. Be aware +that the <em>/etc/exports</em> syntax tends to be different on other +Unix variants - the NFS servers bundled with Linux distributions +tend to offer a much wider range of options than the ones shipped +with other versions of Unix. + +Be aware that if you include a root password in your KickStart config +file, or NFS export directories containing sensitive information, you +should take care to expose this information to as few people as +possible. This can be done by making the NFS export permissions as +fine grained as you can, e.g. by specifying a particular host or +subnet to export to rather than a whole domain. If you keep a special +IP address free for KickStart installations, everything's nice and +simple, but you'll have to change it later - or reconfigure the +machine to get its IP address via BOOTP/DHCP.<p> + +Most NFS servers require you to tell <tt>mountd</tt> and <tt>nfsd</tt> +(on some versions of Unix they're prefixed with a <tt>rpc.</tt>) that +the <em>/etc/exports</em> file has changed - usually by sending a +<tt>SIGHUP</tt>. There's often a program or script called +<tt>exportfs</tt>, which will do this for you, e.g.<p> + +<tscreen><verb> +# exportfs -a +</verb></tscreen><p> + +If you didn't have NFS up and running when this machine was booted, +the directories may not be exported automatically. Try rebooting, or +running the following programs as root:<p> + +<tscreen><verb> +# portmap +# rpc.nfsd +# rpc.mountd +</verb></tscreen><p> + +As noted, on some systems the <tt>rpc.</tt> prefix isn't used. In +most modern Unix distributions, these programs can be found in the +<em>/usr/sbin</em> or <em>/usr/libexec</em> directories. These might +not be in your path already, e.g. if you used <tt>su</tt> to become +<em>root</em>. The <tt>portmap</tt> program is also sometimes called +<tt>rpcbind</tt>, e.g. on Solaris, some versions of <tt>nfsd</tt> +require a command line argument specifying the number of instances of +the server to run, and you may find you also need to run another +daemon called <tt>biod</tt>. The above should suffice on most (all?) +Linux systems.<p> + +If you're using the CMU BOOTP server with DHCP and dynamic addressing +extensions referred to earlier, a sample <em>/etc/bootptab</em> entry +(<em>/etc/bootptab</em> is the normal location of the BOOTP/DHCP +configuration file) would look something like this:<p> + +<tscreen><verb> + .dynamic-1:ip=198.168.254.128:T254=0x30:T250="ds=198.168.254.2: + dn=swedish-chef.org:sm=255.255.255.0:gw=198.168.254.1: + dl=0xFFFFFFFF": +</verb></tscreen><p> + +(wrapped for clarity)<p> + +This says to allocate IP addresses dynamically on encountering new +machines, starting at <em>198.168.254.128</em> and continuing for the +next 48 (the hexadecimal value <em>30</em>) addresses. Each client +will be passed back the value of <em>T250</em>. In this case that +sets:<p> + +<itemize> +<item> the DNS server <tt>ds</tt> to <em>198.168.254.2</em> +<item> the domain name <tt>dn</tt> to <em>swedish-chef.org</em> +<item> the subnet mask <tt>sm</tt> to <em>255.255.255.0</em> +<item> the default gateway <tt>gw</tt> to <em>198.168.254.1</em> +<item> the lease length <tt>dl</tt> (how long the address is + valid for) to "forever" +</itemize><p> + +There seem to be a number of other versions of this server kicking +around which do not support dynamic addressing. For these, you would +have to list the hardware (typically Ethernet MAC) address of each +to-be-installed machine in <em>/etc/bootptab</em>, and the entries +would look something like this:<p> + +<tscreen><verb> +bork.swedish-chef.org:ip=198.168.254.128:ha=0000E8188E56: + ds=198.168.254.2:dn=swedish-chef.org:sm=255.255.255.0: + gw=198.168.254.1:dl=0xFFFFFFFF": +</verb></tscreen><p> + +(wrapped for clarity)<p> + +Note that the parameter <tt>ha</tt> corresponds to the hardware +address of the machine being installed.<p> + + +<sect>Appendix B - Making your own RPMs<p> + +The RPM package format is already very well documented, particularly +in the book <em>Maximum RPM</em> by Ed Bailey, which you can download +from the <url url="http://www.rpm.org/" name="RPM WWW site"> - also +available from all good book stores! This is just a couple of quick +hints for people in a hurry.<p> + +RPM packages are built from a <em>spec</em> file. This consists (in a +similar fashion to the KickStart config file) of a recipe of steps +that need to be taken in order to build the package - it's expected +that you'll have to build it from source, potentially for multiple +platforms, and may need to apply patches before compiling. Once built +and installed, a binary RPM will be created from the files and +directories you specify as being associated with the package. It's +important to note that RPM has no idea of which files and directories +are related to a given package - you have to tell it. + +Here's a sample specification for a custom RPM of the <url name="Squid +WWW cache server" url="http://squid.nlanr.net/">:<p> + +<tscreen><verb> +Summary: Squid Web Cache server +Name: squid +Version: 1.NOVM.22 +Release: 1 +Copyright: GPL/Harvest +Group: Networking/Daemons +Source: squid-1.NOVM.22-src.tar.gz +Patch: retry-1.NOVM.20.patch +%description +This is just a first attempt to package up the Squid Web Cache for easy +installation on our RedHat Linux servers + +%prep +%setup +%build +configure --prefix=/usr/squid +perl -spi -e 's!#( -DALLOW_HOSTNAME_UNDERSCORES)!$1!' src/Makefile +make + +%install +make install + +%files +/usr/squid +</verb></tscreen><p> + +Here's how to build this RPM:<p> + +<tscreen><verb> +% mkdir -p SOURCES BUILD SRPMS RPMS/i386 +% cp ~/squid-1.NOVM.22-src.tar.gz SOURCES +% cp ~/retry-1.NOVM.20.patch SOURCES +% rpm -ba squid-1.NOVM.22+retry-1.spec +</verb></tscreen><p> + +This will automatically create a subdirectory under the <em>BUILD</em> +directory, into which it'll unpack the source code and then apply the +patch (there are a number of options available for patching - check +the book for details). Now, RPM will automatically build the package +by running <tt>configure</tt> and then <tt>make</tt>, install it using +<tt>make install</tt>, and take a snapshot of the files under +<em>/usr/squid</em>. It's the latter which will form the binary RPM +of the Squid software.<p> + +Note that we can insert arbitrary shell commands into the unpacking, +building and installing processes, e.g. the call to <tt>perl</tt> +which tweaks one of Squid's compile-time parameters.<p> + +The final binary RPM will be left under the <em>RPMS</em> directory in +the platform specific subdirectory <em>i386</em>. In this case it +will be called <em>squid-1.NOVM.22-1.i386.rpm</em>. Note that the +filename is created by concatenating the values of the following +parameters from the spec file: <tt>Name</tt>, <tt>Version</tt> and +<tt>Release</tt> - plus the hardware platform in question, +<em>i386</em> in this case. Try to bear this in mind when creating +your own RPMs, to avoid giving them overly long or painful names!<p> + +It's also worth bearing in mind that you can build RPMs without having +to rebuild the whole software package, e.g.<p> + +<tscreen><verb> +Summary: Linux 2.0.36 kernel + filehandle patch + serial console patch +Name: linux +Version: 2.0.36+filehandle+serial_console +Release: 1 +Copyright: GPL +Group: Base/Kernel +Source: linux-2.0.36+filehandle+serial_console.tar.gz +%description +This is just a first attempt to package up the Linux kernel with patches +for installation on our RedHat Linux servers + +%prep +echo + +%setup +echo + +%build +echo + +%install +echo + +%post +/sbin/lilo + +%files +/lib/modules/2.0.36 +/boot/vmlinuz +</verb></tscreen><p> + +In this case we simply create an RPM based on the +<em>/boot/vmlinuz</em> file and the contents of the directory +<em>/lib/modules/2.0.36</em>, and execute <em>/sbin/lilo</em> after +the package has been installed on a target machine. Let me know if +you know much neater way of writing the spec file than this.<p> + + +<sect>Appendix C - Munging your own RPMs into the distribution<p> + +Here is Eric's script for munging updated RPMs into the RedHat +distribution area: + +<tscreen><verb> +#!/usr/bin/perl +# +$redhatdir="/cdrom/i386"; +$rpmdir="/cdrom/i386/RedHat/RPMS/"; +$updatedir="/cdrom/updates/"; +@OTHERDIR=($updatedir); +foreach $dir (@OTHERDIR) + { + print "update for $dir\n"; + system(" find $dir -name \"*.rpm\" -exec cp {} $rpmdir \\; "); + } +chdir($contribdir) || die "peux pas aller dans $contribdir $!\n"; +system("chmod -R 755 $redhatdir"); +chdir($rpmdir) || die "problem to go in $rpmdir $!\n"; +# +# remove the old file +# +opendir(DIR,'.'); +@package=grep(/\.rpm$/,readdir(DIR)); +foreach $file (@package) + { + $file =~ /(.*)\-([\d+|\.]+\w*)\-(\d+)\.[i386|noarch].*/; + $nom=$1; + $version=$2; + $buildvers=$3; + if ($NOM{$nom}) + { + $version2=$VERSION{$nom}; + $buildver2=$BUILDVERS{$nom}; + $file2=$FILE{$nom}; + $nom2=$NOM{$nom}; + if ( $version2 gt $version ) + { + print "$file2 is newer than $file\n"; + unlink($file); + } + else + { + if ( $version2 lt $version ) + { + print "$file is newer than $file2\n"; + unlink($file2); + $VERSION{$nom}=$version; + $BUILDVERS{$nom}=$buildvers; + $FILE{$nom}=$file; + $NOM{$nom}=$nom; + } + else + { + if ( $buildver2 > $buildvers ) + { + print "$file2 : $buildver2 est mieux que $file : $buildvers\n"; + unlink($file); + } + else + { + print "$file2 : $buildver2 is older than $file : $buildvers\n"; + unlink($file2); + $VERSION{$nom}=$version; + $BUILDVERS{$nom}=$buildvers; + $FILE{$nom}=$file; + $NOM{$nom}=$nom; + } + } + } + } + else + { + $VERSION{$nom}=$version; + $BUILDVERS{$nom}=$buildvers; + $FILE{$nom}=$file; + $NOM{$nom}=$nom; + } + } + +# we do the hard thing here +# +system("$redhatdir/misc/src/install/genhdlist $redhatdir"); +</verb></tscreen><p> + +</article> diff --git a/LDP/retired/LDAP-Implementation-HOWTO.sgml b/LDP/retired/LDAP-Implementation-HOWTO.sgml new file mode 100644 index 00000000..66a493ff --- /dev/null +++ b/LDP/retired/LDAP-Implementation-HOWTO.sgml @@ -0,0 +1,110 @@ +<!doctype article public "-//OASIS//DTD DocBook V4.1//EN" + [ +<!entity header system "header.sgml"> +<!entity sectionpamnss SYSTEM "section-pamnss.sgml"> +<!entity sectionsasl SYSTEM "section-sasl.sgml"> +<!entity sectionradius SYSTEM "section-radius.sgml"> +<!entity sectionsamba SYSTEM "section-samba.sgml"> +<!entity sectiondns SYSTEM "section-dns.sgml"> +<!entity sectionsendmail SYSTEM "section-sendmail.sgml"> +<!entity sectionaddress SYSTEM "section-address.sgml"> +<!entity sectionroaming SYSTEM "section-roaming.sgml"> +<!entity sectioncertificates SYSTEM "section-certificates.sgml"> +<!entity sectionssl SYSTEM "section-ssl.sgml"> +<!entity sectionsecurity SYSTEM "section-security.sgml"> +<!entity sectionperformance SYSTEM "section-performance.sgml"> +<!entity sectionttt SYSTEM "section-ttt.sgml"> +<!entity sectionschemas SYSTEM "section-schemas.sgml"> +<!entity sectionfiles SYSTEM "section-files.sgml"> +<!entity fileslapdconf SYSTEM "lih-slapd.conf"> +<!entity fileldapconf SYSTEM "lih-ldap.conf"> +<!entity fileschema SYSTEM "lih-schema.conf"> +<!entity fileldifstructure SYSTEM "lih-structure.ldif"> +]> +<ARTICLE ID="INDEX"><ARTICLEINFO><TITLE>LDAP Implementation HOWTO +v0.5, 2001-03-30 +Roel +van +Meer +Linvision BV +
r.vanmeer@linvision.com
+Giuseppe +Lo +Biondo +INFN MI +
giuseppe.lobiondo@mi.infn.it
+This document describes the technical aspects of storing application data in an ldap server. It focuses on the configuration of various applications to make them ldap-aware. Some applications that assist in handling ldap data are also discussed. + + + +0.5 +2001-03-30 +rvm +Cleanup, fixes, overview rewritten. + +0.4 +2001-02-01 +rvm +Added dns section. + +0.3 +2001-01-18 +rvm +Added MTA sections. + +0.2 +2000-11-12 +glb +Improved section on nss. Added sections about certificates and wrappers. + + + +Overview +Why this howto? +I started learning about ldap when my company felt the need for a centralized storage of user account information, and wanted to use ldap for this. I soon found that there were bits and pieces of documantation everywhere, but that there was no document that put it all together. This has been the reason to start it. +Furthermore, Ldap is becoming more widely used every day. I think it is useful that when people are considering to use Ldap, they can get a full overview of which applications are Ldap aware. This might help them to choose their system setup carefully, without throwing everything about every time they want to change something or add functionality. + +It started out as a project roadmap on how we wanted to implement Ldap for our own uses. But thanks to my employer, Linvision, who gave me the opportunity to do some research on things that weren't really useful to our own cause, it changed from a roadmap to a technical overview of applications that are ldap aware. + +What is it about? +Most of the common services can be authenticated through PAM, Pluggable Authentication Modules. With the pam_ldap and nss_ldap modules, all pamified programs can get their information from LDAP. More information about PAM in general can be found on the Linux-PAM site. Information about pam_ldap and nss_ldap can be found on the padl software site. +For Samba, things are a little difficult at this moment. The current stable Samba versions do not have Ldap support. Ldap support can be found in the HEAD and TNG branch, and probably also in the combined tree. The problem is that samba has it's own usernames and passwords. It does have usage for PAM, in fact, but that is not sufficient to do all the authentication and retrieval of user information. Because the implementation of LDAP in samba is not fully finished yet, there are a few limitations to the use of ldap with samba. From my experiences, the HEAD is at this time (early June 2000) not stable enough, and the performance is unsatisfying. However, when the ldap support is fully functional in the new releases, samba too can be configured to get all of it's user information from ldap. +Another thing that can be stored into an ldap database is DNS. When the amount of machines connected to your network increases, it is no longer feasable to edit the DNS files by hand. When machine accounts are stored into ldap, two simple DNS entries (one for the lookup, and one for the reverse lookup) can easily be added at the same time. This too provides a simplification of system management. Although the storage of DNS entries in an ldap database may not be neccesary for most systems, it may prove useful to some people. +Since sendmail version 8.9 (see sendmail.net +for more details), sendmail has Ldap support. Postfix and QMail are ldap-aware too. When setting up an email system which has multiple mailhosts and or fallback hosts, it is convenient to store all the information in one place. Normally, every system needs to be configured separately, with the same information. When using ldap, this can be avoided. +Roaming access can also be used with LDAP. Netscape versions 4.5 and up have the possibility to store user data like bookmarks and such via an HTML or LDAP server. This gives users their good old preferences, wherever they log in and use Netscape. +Microsoft's office programs can import address books. Thay can also use an Active Directory service to automagically match emailaddresses to user names or nicknames. With Ldap this can be done on a Linux system, without the need for Microsoft Exchange Server or something the like. + +What is it NOT about? +First thing: I will try not to talk too much about the actual setup and administration of Ldap itself. +There is an excellent Ldap HOWTO available at the Linux Documentation Project that discusses this. +Secondly, I will not discuss things regarding the applications itself, when they have nothing to do with Ldap. +Lastly, in most cases, I cannot tell you if it is wise to use Ldap. I don't have that kind of experience. I can tell you how to do it, if you want, but i cannot tell you if you should. There is plenty documentaion available that discusses the useability of Ldap in general. + + +Acknowledgements +At first, I would like to thank my employer, Linvision, for giving me the opportunity to work on this document in their time. +Furthermore, I would like to thank the following people, who have contributed to this document in some way (in no particular order): Giuseppe Lo Biondo. + +Disclaimer +This document is provided as is and should be considered as a work in progress. Several sections are as yet unfinished, and probably a lot of things that should be in here, aren't. I would greatly appreciate any comments on this document, of whatever nature they may be. +In any case, think before you go messing around with your system and don't come to me if it breaks. + +Copyright and license +Copyright (c) by Roel van Meer, Giuseppe Lo Biondo. This document +may be distributed only subject to the terms and conditions set forth in +the LDP License at the Linux Documentation Project. +§ionpamnss; +§ionradius; +§ionsamba; +§iondns; +§ionsendmail; +§ionaddress; +§ionroaming; +§ioncertificates; +§ionssl; +§ionschemas; +§ionfiles; +
+ diff --git a/LDP/retired/Laptop-HOWTO.sgml b/LDP/retired/Laptop-HOWTO.sgml new file mode 100644 index 00000000..2fbe3c99 --- /dev/null +++ b/LDP/retired/Laptop-HOWTO.sgml @@ -0,0 +1,3721 @@ + +
+Linux Laptop-HOWTO +<author>Werner Heuser <htmlurl url ="mailto:wehe@tuxmobil.org" name="<wehe@tuxmobil.org>"> +<date>v2.2b, 27 February 2003 +<abstract> +Laptops are different from desktops/towers. They use certain hardware such as PCMCIA cards, infrared ports, batteries, docking stations. Often their hardware is more limited (e.g. disk space, CPU speed), though the performance gap is becoming smaller. In many instances, laptops can become a desktop replacement. + +Hardware support for Linux (and other operating systems) on laptops is sometimes more limited (e.g. graphic chips, internal modems). Laptops often use specialized hardware, hence finding a driver can be more difficult. + +Laptops are often used in changing environments, so there is a need for multiple configurations and additional security strategies. + +Though there are laptop related HOWTOs available already, this HOWTO contains a concise survey of laptop related documents. Also, laptop related Linux features, such as installation methods for laptops (via PCMCIA, without CD drive, etc.), laptop hardware features and configurations for different (network) environments are described. Besides there are some notes on PDAs, Handheld PCs and other mobile computer devices (digital cameras, cellular phones, calculators). + +And though some caveats Linux is a better choice for laptops, than most other operating systems. Because it supports numerous installation methods, works in many heterogenoues environments and needs smaller resources. + +</abstract> +<toc> + +<sect>Preface +<p> +Life is the first gift, love is the second, and understanding is the third. -- <url url="http://www.capecod.net/~tmpiercy/" name="Marge Piercy"> + +<sect1>About the Author +<p> +People like either <idx>laptops</idx> or <idx>desktops</idx>. I like to work with laptops rather than with desktops. I like Linux too. My first HOWTO was the <url url="http://tuxmobil.org/howtos.html" name="Linux/IR-HOWTO"> about infrared support for Linux. My second is this one and my third the Ecology-HOWTO, about some ways to use Linux in an ecology aware manner. +<p> +Also I have written some pages about Linux with certain laptops: <url url="http://tuxmobil.org/echos133.html" name="Olivetti Echos 133 DM (German)"> (together with Kurt Saetzler), <url url="http://tuxmobil.org/hp800e.html" name="HP OmniBook 800CT">, <url url="http://tuxmobil.org/hp3100e.html" name="HP OmniBook 3100"> (together with Friedhelm Kueck) <url url="http://tuxmobil.org/armada1592dte.html" name="COMPAQ Armada 1592 DT"> and <url url="http://tuxmobil.org/c286lte.html" name="COMMODORE C286LT">. +<p> +During the work with the Laptop-HOWTO I have collected some surveys about laptop related hardware: <url url="http://tuxmobil.org/graphic_linux.html" name="graphic chips">, <it>unofficially</it> <url url="http://tuxmobil.org/pcmcia_linux.html" name="supported PCMCIA cards">, <url url="http://tuxmobil.org/modem_linux.html" name="internal modems"> and <url url="http://tuxmobil.org/ir_misc.html" name="infrared chips">. +<p> +But I don't claim to be a laptop guru, I just had the opportunity to install Linux on some laptops and I simply want to share the information I collected. +<p> +Since I don't own a non-Intel based machine, this HOWTO might not contain all the details for non-Intel systems or may contain inaccuracies. Sorry. + +<sect1>Sponsoring +<p> +This HOWTO is free of charge and free in the sense of the General Public Licence - GPL. Though it requires much work and could gain more quality if I would have some more hardware. So if you have a spare laptop, even an old one or one which requires repair, please let me know. Especially I need one with infrared port, USB port, DVD drive, WinModem and a non Intel machine. The according chapters need a major rewrite. For the curious, this HOWTO is written on a <url url="http://tuxmobil.org/hp800e.html" name="HP OmniBook 800CT 5/100">. +<p> +Or sponsor a banner ad at my WWW pages <url url="http://tuxmobil.org/ " name="TuxMobil">. +<p> +You can hire me for readings or workshops on <it>Linux with Laptops</it>, <it>Repairing of Laptops</it> and other Linux topics, too. + +<sect1>About the Document (Mirrors, Translations, Versions, Formats, URLs) +<p> +Many times I have mentioned <it>MetaLab</it> formerly known as <it>SunSite</it>. This site carries a heavy load, so do yourself a favor, use one of the <url url="http://metalab.unc.edu/pub/Linux/MIRRORS.html" name="MetaLab mirrors"> . +<p> +For <it>Debian/GNU Linux</it> the mirror URLs are organized in this scheme <tt>http://www.<country code, e.g. uk>.debian.org</tt> . +<p> +This text is included in the <url url="http://tldp.org/" name="LINUX DOCUMENTATION PROJECT - LDP"> . +<p> +Richard Worwood mirrors this HOWTO at <url url="http://www.felch01.demon.co.uk/laptop-howto.html" name="http://www.felch01.demon.co.uk/laptop-howto.html"> . +<p> +Lionel, &dquot;trollhunter&dquot; Bouchpan-Lerust-Juery, <trollhunter@linuxfr.org> provides a translation into French. You can download or browse it at <url url="http://infonomade.linuxfr.org/portables/ressourcesfr.html#howto" name="http://infonomade.linuxfr.org/portables/ressourcesfr.html#howto"> . And he mirrors the English version at <url url="http://infonomade.linuxfr.org/portables/ressourcesen.html#howto" name="http://infonomade.linuxfr.org/portables/ressourcesen.html#howto "> +<p> +He has also written a HOWTO about portables and wearables, please look at his pages <url url="http://infonomade.linuxfr.org/index.html" name="http://infonomade.linuxfr.org/index.html "> (French version) <url url="http://infonomade.linuxfr.org/indexen.html" name="http://infonomade.linuxfr.org/indexen.html"> (English version). +<p> +Translations into Japanese (Ryoichi Sato <rsato@ipf.de>), Italian (Alessandro Grillo <Alessandro_Grillo@tivoli.com>), Portuguese (Gledson Evers <pulga_linux@bol.com.br> the translation will be announced at <url url="http://www.linuxall.org" name="LinuxALL">) and Greek (Vassilis Rizopoulos <mscyvr@scs.leeds.ac.uk>) are under construction. +<p> +Please contact me before starting a translation to avoid double work. Since a translation is a great amount of work, I recommend to do this work as a group. +<p> +Nearly all of the programms I mention are available as <url url="http://www.debian.org" name="Debian/GNU Linux"> packages, or as RPM packages, look up your favorite RPM server, for instance <url url="http://rufus.w3.org/linux/RPM/ByName.html" name="RUFUS"> . +<p> +The latest version of this document is available in different formats at <url url="http://tuxmobil.org/" name="TuxMobil"> . + +<sect1>Contact +<p> +This document isn't ready yet. If you like to write a chapter or even a smaller part by yourself, please feel free to contact me. Also your suggestions and recommendations and critics are welcome. But please don't expect me to solve your laptop related problems if the solution is already documented. Please read all according manual pages, HOWTOs and WWW sites first, than you may consider to contact me or the other resources mentioned below. +<p> +Since I want to write much more stuff about mobile computing and Linux I'm thinking about turning this HOWTO into a book. +<p> +Werner Heuser <wehe@tuxmobil.org> + +<sect>Copyright, Disclaimer and Trademarks +<p> +Copyright © 1999 by Werner Heuser. This document may be distributed under the terms set forth in the <url url="http://metalab.unc.edu/LDP/COPYRIGHT.html" name="LDP license"> . +<p> +This is free documentation. It is distributed in the hope that it will be useful, but without any warranty. The information in this document is correct to the best of my knowledge, but there's a always a chance I've made some mistakes, so don't follow everything too blindly, especially if it seems wrong. Nothing here should have a detrimental effect on your computer, but just in case I take no responsibility for any damages incurred from the use of the information contained herein. +<p> +Some laptop manufacturers don't like to see a broken laptop with an operating system other than the one shipped with it, and may reload MS-Windows if you complain of a hardware problem. They may even declare the warranty void. Though IMHO this isn't legal or at least not fair. Always have a backup of both the original configuration and your Linux installation if you have to get your laptop repaired. +<p> +Though I hope trademarks will be superfluous sometimes (you may see what I mean at <url url="http://www.opensource.org/osd.html" name="Open Source Definition">) : If certain words are trademarks, the context should make it clear to whom they belong. For example &dquot;MS Windows NT&dquot; implies that &dquot;Windows NT&dquot; belongs to Microsoft (MS). Mac is a trademark by Apple Computer. All trademarks belong to their respective owners. + +<sect>Which Laptop to Buy? +<p> +<sect1>Introduction +<p> +Portable computers may be divided into different categories. This is a subjective decision, but I try to do so. My groupings roughly follow the generally accepted marketing categories. The criteria could be: + +<enum> + +<item> +Weight: Often expressed in terms like Portables, Laptops/Notebooks, Sub/Mini-Notebooks, Palmtops/PDAs. There is no standard method to define the weight of a laptop, therefore the data provided by the manufacturers (and which are given below) have to be considered as approximations. The question is how the power supply (wether external or internal) or swappable parts like CD and floppy drive, are included in the weight. +<p> +Most peripheral cables are appallingly heavy. If you get a subnotebook +and carry it around with a bunch of external drives, cables, and <it>port +expander</it> dongles and power converter, you may be lugging a heavier +bag than if it were all in one box. Subnotebooks are useful mainly +if you can afford to leave all the other junk behind.</item> + +<item> +Supported Operations Systems: proprietary versus open</item> + +<item> +Price: NoName versus Brand</item> + +<item> +Hardware Features: display size, harddisk size, CPU speed, battery type, etc.</item> + +<item> +Linux Support: graphic chip, sound card, infrared controller (IrDA), internal modem, etc.</item> + +</enum> + +<sect1>Portables, Laptops/Notebooks, Sub/Mini-Notebooks, Palmtops, PDAs/HPCs +<p> +<sect2>Portables +<p> +Weight greater than 4.0 kg (9 lbs). Features like a PC, but in a smaller box and with LCD display. Examples: lunchbox or ruggedized laptops (e.g., <url url="http://www.bsicomputer.com/" name="http://www.bsicomputer.com/">) + +<sect2>Laptops/Notebooks +<p> +Weight between 1.7 and 4.0 kg (4 to 9 lbs). Features custom hardware and usually a special CPU. Examples: HP OmniBook 3100, COMPAQ Armada 1592DT. The terms <it>laptop</it> and <it>notebook</it> seem equivalent to me. + +<sect2>Sub-Notebooks/Mini-Notebooks +<p> +Weight between 1.3 and 1.7 kg (3 to 4 lbs). Features: external floppy drive, external CD drive. Examples: HP OmniBook 800CT, Toshiba Libretto 100, COMPAQ Aero, SONY VAIO 505. + +<sect2>Palmtops +<p> +Weight between 0.7 and 1.3 kg (1.5 to 3 lbs). Features: proprietary commercial operating systems. Examples: HP200LX. + +<sect2>Personal Digital Assistants (PDAs)/Handheld PCs (HPCs) +<p> +Weight below 0.7 kg (1.5 lbs). Features: proprietary commercial operating systems and often non-Intel CPU with commercial operating systems like PalmOS, EPOC32, GEOS, Windows CE. Examples: Newton Message Pad, Palm III (former Pilot), Psion Series 3 and 5, CASIO Z-7000. + +<sect2>Wearables +<p> +Watches, digital pens, calculators, digital cameras, cellular phones and other wearables. + +<sect1>Linux Features +<p> +Due to a lack of support by some <idx>hardware manufacturers</idx>, not every feature of a laptop is always supported or fully operational. The main devices which may cause trouble are: graphic chip, IrDA port, sound card, PCMCIA controller , PnP devices and internal modem. Please try to get as much information about these topics before buying a laptop. But often it isn't quite easy to get the necessary information. Sometimes even the specifications or the hotline of the manufacturer aren't able to provide the information. Therefore I have included a Linux <idx>Compatibility Check</idx> chapter in the Hardware In Detail sections below. +<p> +Depending on your needs, you might investigate one of the vendors that provide +laptops pre-loaded with Linux. By purchasing a pre-loaded Linux laptop, much +of the guesswork and time spent downloading additional packages could be +avoided. See the <url url="http://tuxmobil.org/laptop_manufacturer.html" +name="Linux Laptop Manufacturer Survey">. + +<sect1>Main Hardware Features +<p> +Besides its Linux features, there often are some <it>main features</it> which have to be considered when buying a laptop. For <it>Linux features</it> please see the Hardware In Detail section below. + +<sect2>Weight +<p> +Don't underestimate the weight of a laptop. This weight is mainly influenced by: + +<enum> + +<item> +screen size</item> + +<item> +battery type</item> + +<item> +internal components, such as CD drive, floppy drive</item> + +<item> +power supply</item> + +<item> +material used for the case, usually they are either from plastics or from magnesium. + +</enum> + +<sect2>Display +<p> +Laptops come with one of two types of displays: <it>active</it> matrix (TFT) and <it>passive</it> matrix (DSTN). Active matrix displays have better color and contrast, but usually cost more and use more power. Also consider the screen size. Laptops may be purchased with screens up to 15&dquot;. A bigger screen weighs more, costs more, and is harder to carry, but is good for a portable desktop replacement. + +<sect2>Batteries +<p> +The available battery types are <it>Lithium Ion (LiIon)</it>, <it>Nickel Metal Hydride ( NiMH)</it> and <it>Nickel Cadmium (NiCd)</it>. + +LiIon batteries are the most expensive ones but a lot lighter than NiCd for the same energy content, and have minimal -- but present -- memory effects. NiMH is better than NiCd, but still rather heavy and does suffer some (although less than NiCd) memory effects. + +Unfortenately most laptops come with a proprietary battery size. So they are not interchangeable between different models. + +<sect2>CPU +<p> +<sect3>Supported CPU Families +<p> +For details about systems which are supported by the Linux Kernel, see the <url url="http://www.cl.cam.ac.uk/users/iwj10/linux-faq/" name="Linux FAQ"> . See also <url url="http://www.ctv.es/USERS/xose/linux/linux_ports.html" name="Current ports of Linux OS"> + +<enum> + +<item>i286: +Linux doesn't support this CPU family yet. But there are some efforts at <url url="http://www.elks.ecs.soton.ac.uk/" name="ELKS">. If you like, you may use <url url="http://www.cs.vu.nl/~ast/minix.html" name="Minix"> one of the predecessors of Linux. Minix supports 8088 to 286 with as little as 640K memory. Actually there are some laptops with ELKS around, for instance the <url url="http://tuxmobil.org/c286lte.html" name="Commodore C286LT"> + +<item>i386: +This covers PCs based on Intel-compatible processors, including Intel's 386, 486, Pentium, Pentium Pro and Pentium II, and compatible processors by AMD, Cyrix and others. Most of the currently available laptops use Intel compatible CPUs and have quite good Linux support. + +<item>m68k: +This covers Amigas and Ataris having a Motorola 680x0 processor for x>=2; with MMU. And the early Apple/Macintosh computers. +<p> +There was a long series of Apple PowerBooks and other laptops based on the m68k chip. Macintosh Portable (an ugly 16-pound first attempt); PowerBook 100, 140, 170, 145, 160, 180c, 165c, 520c, 540c, 550c, 190; Duo 210, 230, 250, 270c, 280. The PowerBook Duos were available at the same time as the PowerBooks, they were a sort of subnotebook, but were designed so that you could plug them into a base station (a DuoDock) with more RAM, peripherals, etcetera, so that they could also act as a desktop computer. The first PowerPC PowerBooks were the ill-starred PowerBook 5300 (after the 190) and the Duo 2300c. +<p> +For a complete list of all Macintosh computers ever made, with specifications, see <url url="http://www.apple-history.com/gallery.html" name="Apple-History">. +<p> +Note also that readers should *not* go to www.linuxppc.org for hardware compatibility with 68k laptops--as the name implies, LinuxPPC is only for PowerPC machines. The proper place to go for information on running Linux on m68k Macintoshes is: <url url="http://www.mac.linux-m68k.org/" name="linux-m68k">. +<p> +In particular, their hardware compatibility list is at: <url url="http://www.mac.linux-m68k.org/status/sysreq.html" name="linux-m68k-status"> and it states in regards to laptops: +<p> +&dquot;Much like laptops of the Intel/Linux world, Mac laptops have generally different setups that can be very hard to figure out. Also, because of a general lack of machines to test, we are only aware of boots on the Powerbook 145, Powerbook 150, Powerbook 170, Powerbook 180, and Powerbook 190. Even if it boots, we currently have no support for Powerbook-style ADB, the APM support, or just about anything else on them. This means the only way to log in is with a terminal hooked up to the serial interface, this has been tested on the 170.&dquot; +<p> +&dquot;Several Powerbooks have internal IDE which is supported. PCMCIA drivers will be forthcoming if someone can supply the necessary hardware information to write a driver. As always, an FPU is needed also. Many of the later models have the 68LC040 processor without FPU, and many of these processors are broken with respect to the FPU trap mechanism so they can't run regular Linux binaries even with FPU emulation. Current status on Powerbooks 140, 160, 165, 165c, 180c, 190, 520 and Duos 210, 230, 250, 270c, 280, and 280c is unknown.&dquot; + +<p> +Also there are two Atari laptops, for which I don't have enough information. The following quotations are from the <url url="http://capybara.sk-pttsc.lj.edus.si/yescrew/eng/atari.htm" name="Atari Gallery">. +<p> +&dquot;The <it>STacy</it> was released shortly after the <it>Mega ST</it> to provide a portable means of Atari computing. STacy computers were shipped with TOS v1.04. +<p> +Designed to replace the <it>STacy</it> as the defacto portable ST computer, the <it>ST Book</it> brought the basic computing power of an ST to a lightweight notebook computer. This machine was only released in Europe and Atari only shipped a very small quantity. The ST Book was shipped with TOS v2.06.&dquot; +<p> +Is there an Amiga notebook? + +<item>PowerPC (PPC): +Although some driver support present in Intel based Linux is still missing for Linux PPC, it is a fully usable system for Macintosh PowerBooks. See <url url="http://www.linuxppc.org/hardware/" name="LinuxPPC"> for a current list of supported machines. +<p> +BTW: The team at <url url="http://www.imaclinux.net" name="iMac Linux"> has managed to get the iMac DV to boot Linux to a usable point. You may get information about the iBook there as well. + +<item>Alpha, Sparc, Sparc64 architectures: +These are currently under construction. AFAIK there are only the Tadpole SPARC and ALPHA laptops, and some other ALPHA laptops available. + +<item>StrongARM: +a very low-power CPU found in Rebel.com's popular NetWinder (some kind of mobile computer, too), +and actively supported in the Debian project, it is also in several +WinCE machines, such as HP's Jornadas. Only the lack of tech specs +prevents Linux from being ported to these tiny, long-battery-life +machines. A full-scale StrongARM-based laptop would make a superb +Linux platform, but none exists yet. +<p> +For PDAs with ARM/StrongARM CPU see the PDA chapter below. + +<item>MIPS: +Used in SGI mainframes and Cobalt Micro intranet appliances, +chips based on this architecture are used in many Wince machines. +Linux has been ported to a few of these, including the lovely little +Vadem Clio. Vadem has been admirably cooperative. +<p> +More about Linux on Wince boxes may be found at +<url url="http://www.2gn.com/~jjorgens/linuxce_faq.html" name="LinuxCE-FAQ">. + +</enum> + +<sect3>Miscellaneous +<p> +At higher speed, a CPU consumes more power and generates more heat. Therefore, in many laptops a special low-power CMOS CPU is used. Usually, this special CPU doesn't use as much power as a similar processor used in a desktop. These special CPUs are also more expensive. As a side effect you may find that laptops with a desktop CPU often have a fan which seems quite loud. + +<sect2>Cooling +<p> +An enormously important issue. +Anything based on PPC or Pentium will generate enormous amounts +of heat which must be dissipated.Generally, this means either a +fan, or a heat sink the size of the case.If it's a fan, the air +path had better not ever get blocked, or it will overhead and burn +out.This means machines with a fan mounted in the bottom are a +big, big mistake: you can't use them on a soft surface. + +<sect2>Keyboard Quality +<p> +Though you might use your desktop computer to do longer writings, a good keyboard can save you some headaches and finger-aches. Look especially for the location of special keys like: <tt><ESC></tt>, <tt><TAB></tt>, <tt><Pos1></tt>, <tt><End></tt>, <tt><PageDown></tt>, <tt><PageUp></tt> and the cursor keys. +<p> + +<sect2>Price +<p> +Laptops are quite expensive if you compare them with desktops. So you may decide between a brand or no-name product. Though I would like to encourage you to take a <it>no-name</it> product, there are some caveats. I have experienced that laptops break often, so you are better off, when you have an after sales warranty, which is usually only offered with brand products. Or you may decide to take a <it>second hand</it> machine. When I tried this, I discovered that the laptop market is changing quite often. A new generation is released approximately every three months (compared by CPU speed, harddisk capacity, screen size etc.). So laptops become old very quick. But this scheme often isn't followed by the prices for second hand laptops. They seem too expensive to me. Anyway if you plan on purchasing a second hand machine, review my recommendations on checking the machine. For German readers there is an online market place at <url url="http://www.hardware.de" name="http://www.hardware.de">, which offers a good survey about current prices for second hand machines. + +<sect2>Power Supply +<p> +If you travel abroad pay attention to the voltage levels which are supported by the power supply. Also the power supply is often one of the heavier parts of a laptop. + +<sect1>Sources of More Information +<p> +Specifications, manuals and manufacturer support often are not helpful. Therefore you should retrieve information from other sources too: + +<enum> + +<item> +Highly recommended is the survey by Kenneth E. Harker <url url="http://www.linux-on-laptops.com/" name=" http://www.linux-on-laptops.com/"> .</item> + +<item> +<url url="ftp://tsx-11.mit.edu/pub/linux/packages/laptops/" name=" ftp://tsx-11.mit.edu/pub/linux/packages/laptops/"> .</item> + +<item> +Hardware-HOWTO</item> + +<item> +open hardware - The Open Hardware Certification Program <url url="http://www.debian.org/OpenHardware/" name=" http://www.debian.org/OpenHardware/"> </item> + +<item>HARDWARE.doa.org - dedicated to the hardware aspects of (Linux) computing <url url="http://hardware.doa.org/" name=" http://hardware.doa.org/"> </item> + +<item>How to Build a PC FAQ - excellent hardware overview by Billy Newsom <url url="http://www.motherboards.org/build.html" name="http://www.motherboards.org/build.html"></item> + +<item> +Last but not least the WWW itself.</item> + +</enum> + +<sect1>Linux Compatibility Check +<p> +<sect2>Related HOWTOs +<p> + +<enum> + +<item> +Hardware-HOWTO</item> + +<item> +Kernel-HOWTO</item> + +<item> +PCMCIA-HOWTO</item> + +<item> +PCI-HOWTO</item> +<item> +Plug-and-Play-mini-HOWTO</item> + +</enum> + +<sect2>Check Methods in General +<p> +If you can't find the necessary information through the above mentioned sources, you are on your own. Luckily, Linux provides many means to help. For details see the Hardware on Detail section below. In general you may use: + +<enum> + +<item> +First of all the kernel itself. Look up what kind of hardware is detected by the kernel. You get this information during boot time or usually by <tt>dmesg</tt> or by looking into <file>/var/log/messages</file>. + +<item> +If your kernel supports the <file>/proc</file> file system you may get detailed information about PCI devices by <tt>cat /proc/pci</tt> Please read the kernel documentation <file>pci.txt</file>. You may get further information about unknown PCI devices at the database from Craig Hart at <url url="http://members.hyperlink.net.au/~chart" name="http://members.hyperlink.net.au/~chart">. From 2.1.82 kernels on you may use the <tt>lspci</tt> command from the <tt>pci-utils</tt> package. + +<item> +To retrieve information about Plug-and-Play (PNP) devices use <tt>isapnp-tools</tt> . + +<item> +Use <tt>scsi_info</tt> by David Hinds for SCSI devices or <tt>scsiinfo</tt>. + +</enum> + +If you don't want to install a complete Linux you may retrieve this information by using a micro Linux ( see appendix A). The package <tt>muLinux</tt> provides even a small <tt>systest</tt> program and <tt>TomsRtBt</tt> comes with <tt>memtest</tt>. To use <tt>memtest</tt> you have to copy it on a floppy <tt>dd if=/usr/lib/memtest of=/dev/fd0</tt> and to reboot from this floppy. +<p> +If your laptop came with Windows, you may determine a lot of hardware settings from the installation. Boot into DOS or Windows to get the information you need. +<p> +Using Windows9x/NT to get hardware settings, basically boot Windows, then <tt>Start -> Settings -> Control Panel -> System -> Device Manager</tt> and write down everything, or make a hardcopy from the display using the <tt><PRINT></tt> key, plus keep a log of settings, hardware, memory, etc. +<p> +Using MS-DOS and Windows3.1x you can use the command <tt>msd</tt>, which is an akronym for MicroSoft Diagnostics. Or you might try one of the numerous DOS shareware utilities: <tt>CHECK-IT</tt>, <tt>DR.HARD</tt> and others. +<p> +Sometimes it's difficult to know what manufacturer has built the machine or parts of it actually. The <url url="http://www.fcc.gov/fcc-bin/ead" name="FCC"> &dquot;Federal Communications Commission On-line Equipment Authorization Database may be used, if you are having problems identifying the manufacturer of a laptop or notebook computer (or other electronic device,) this site lets you search the FCC database based on the FCC ID number you can usually find on the equipment if it was marketed in the United States of America.&dquot; +<p> +<url url="http://www.linux-mandrake.com/lothar/" name="The Lothar Project"> +is a Mandrake-related project to provide a GUIed interface to get at hardware +configuration information on Linux-based systems. It provides a +library for different system informations, too. +<p> +Many laptops are no more compatible with Windows than Linux. David Hinds, author of the PCMCIA drivers, points out that Toshiba notebooks use a proprietary Toshiba PCMCIA bridge chip that exhibits the same bugs under Windows as under Linux. IBM Thinkpads have serious BIOS problems that affect delivery of events to the power management daemon <tt>apmd</tt>. These bugs also affect MS-Windows, and are listed in IBM's documentation as <it>considerations</it>. +<p> +Some incompatibilities are temporary, for instance laptops that have Intel's USB chip will probably get full USB support, eventually. + +<sect1>Writing a Device Driver +<p> +If you encounter a device which is not yet supported by Linux, don't forget it's also possible to write a driver by yourself. You may look at the book from Alessandro Rubini, Andy Oram: Linux Device Drivers. + +<sect1>Buying a Second Hand Laptop +<p> +Some recommendations to check an used laptop, before buying it: + +<enum> + +<item> +Review the surface of the case for visible damages.</item> + +<item> +Check the display for pixel faults. Maybe it's useful to take a magnifying glass therefore.</item> + +<item> +Do an IO stress-test, .e.g. with the tool <tt>bonnie</tt>.</item> + +<item> +You may use <tt>memtest</tt> and <tt>crashme</tt> to achieve a memory test. + +<item> +Do a CPU stress test, e.g. with the tool <tt>Byte</tt> or by compiling a kernel.</item> + +<item> +Check the floppy drive by formatting a floppy.</item> + +<item> +Check the CD drive by reading a CD.</item> + +<item> +To check the battery seems difficult, because it needs some time: one charge and one work cycle.</item> + +<item> +To check the surface of the harddisk you may take <tt>e2fsck</tt>. There is also a Linux tool <tt>dosfsck</tt> or the other <tt>fsck</tt> tools.</item> + +<item> +To test the entire disk (non-destructively), time it for performance, and determine its size, as root do: <tt>time dd if=/dev/hda of=/dev/null bs=1024k</tt> . + +<item> +Check wether the machine seems stolen. I have provided a <url url="http://tuxmobil.org/stolen_laptops.html" name="survey of databases for stolen laptops">. + +</enum> + +AFAIK there is no Linux tool like the DOS tools CHECK-IT, DR. HARD, SYSDIAG and others. These tools include many of the tests in one integrated suite. One of the best IMHO is the tool <tt>PC Diagnostics 95</tt> made by Craig Hart <url url="http://members.hyperlink.net.au/~chart" name="http://members.hyperlink.net.au/~chart"> . Despite the 95 in its name it's plain DOS, tiny (76KB programm and 199KB data) reliable and free. Unfortenately it contains no check for the IrDA port. +<p> +Please note this quotation from the disclaimer: &dquot;This program is written with the target audience being a trained, experienced technician. It is NOT designed to be used by those ignorant of computer servicing. Displays are not <it>pretty</it> but functional. Information is not explained since we are not trying to educate. This software should be considered to be just like any other tool in a tech's toolbox. It is to be applied with care, in the right situation, in order to find answers to specific problems. If you are an end user who is less than confident of dealing with computer hardware, this is probably not a program for you.&dquot; +<p> +Laptop computers, unlike desktop machines, really do get used up. +<it>Lithium batteries</it> are good for no more than 400 recharge cycles, +sometimes much fewer. <it>Keyboards</it> wear out. <it>LCD screen backlighting</it> +grows dim. <it>Mouse buttons</it> fail. Worst of all, <it>connectors</it> get loose +as a result of vibration, causing intermittent failures (e.g. only +when you hit the <Enter> key). We have heard of a machine used on the +table in a train being shaken to unusability in one trip. + +<sect1>No Hardware Recommendations +<p> +It's difficult to give any recommendations for a certain laptop model in general. Your personal needs have to be taken into account. Also the market is changing very quickly. I guess every three months a new generation of laptops (according to harddisk space, CPU speed, display size, etc.) comes into the market. So I don't give any model or brand specific recommendations. + +<sect>Laptop Distribution +<p> +<sect1>Requirements +<p> +From the Battery-HOWTO I got this recommendation (modified by WH): + +A Message to Linux Distributors + +If you happen to be a Linux distributor, thank you for reading all this. Laptops are becoming more and more popular, but still most Linux distributions are not very well prepared for portable computing. Please make this section of this document obsolete, and make a few changes in your distribution. + +The installation routine should include a configuration, optimized for laptops. The <it>minimal install</it> is often not lean enough. There are a lot of things that a laptop user does not need on the road. Just a few examples. There is no need for three different versions of vi (as found in Suse Linux). Most portable systems do not need printing support (they will never be connected to a printer, printing is usually done with the desktop system at home). Quite a few laptops do not need any network support at all. + +Don't forget to describe <it>laptop-specific installation problems</it>, e. g. how to install your distribution without a cd-rom drive or how to setup the plip network driver. + +Add better <it>power management</it> and seamless <it>PCMCIA support</it> to your distribution. Add a recompiled kernel and an alternative set of PCMCIA drivers with <it>apm support</it> that the user can install on demand. Include a precompiled <it>apmd package</it> with your distribution. + +Add support for dynamically <it>switching network configurations</it>. Most Linux laptops travel between locations with different network settings (e. g. the network at home, the network at the office and the network at the university) and have to change the network ID very often. Changing a Linux system's network ID is a pain with most distributions. + +Add a <it>convenient PPP dialer</it> with an address book, that does not try to start multiple copies of the PPP daemon if you click on the button twice (e.g., the RedHat <tt>usernet</tt> tool). It would be nice to have the PPP dialer also display the connection speed and some statistics. One nice command line dialer that autodetects modems and PPP services is <tt>wvdial</tt> from Worldvisions <url url="http://www.worldvisions.ca/wvdial/" name="http://www.worldvisions.ca/wvdial/">. + +<sect1>Recommendation +<p> +The <url url="http://www.debian.org" name="Debian/GNU Linux"> has most of the desired features for a laptop installation. The distribution has a quite flexible installation tool. The installation process is well documented, especially concerning the methods which are useful at laptops. All the binaries are tiny, because they are stripped. A mailing list <it>debian-laptop</it> including a searchable archiv is provided. And Debian/GNU Linux is free. +<p> +At the end of August 1999 the <url url="http://tuxmobil.org/debian_linux.html" name="Debian Laptop Distribution - Proposal"> was issued. And some more laptop related packages and a Debian <it>meta-package</it> dedicated to laptops are on the way. +<p> +Note: I know other Linux distributions work well with laptops, too. I even tried some of them, see my pages about certain laptops mentioned above. + +<sect>Installation +<p> +<sect1>Related HOWTOs +<p> +<enum> +<item> +CDROM-HOWTO</item> + +<item> +Config-HOWTO</item> + +<item> +Diskless-mini-HOWTO</item> + +<item> +Installation-HOWTO</item> + +<item> +Pre-Installation-Checklist-mini-HOWTO</item> + +<item> +Update-mini-HOWTO</item> + +<item> +Hard-Disk-Upgrade-mini-HOWTO</item> + +<item> +Installation and getting started by Matt Welsh and others available at the LINUX DOCUMENTATION PROJECT <url url="http://metalab.unc.edu/LDP" name="http://metalab.unc.edu/LDP"></item> + +<item> +Installing Debian Linux 2.1 For x86 by Bruce Perens, Sven Rudolph, Igor Grobman, James Treacy, Adam P. Harris <url url="ftp://ftp.debian.org/debian/dists/slink/main/disks-i386/current/install.html" name="ftp://ftp.debian.org/debian/dists/slink/main/disks-i386/current/install.html"> + +<item> +Install-From-Zip-mini-HOWTO</item> + +<item> +<url url="http://www.torque.net/~campbell" name="ZIP-Drive-mini-HOWTO "> </item> +</enum> + +<sect1>Prerequisites - Partitioning +<p> +Partitioning can be done in a very sophisticated way. Currently I have only some first thoughts. I assume that with laptops there are still some reasons (e.g. updating the firmware of PCMCIA cards and BIOS) to share Linux and Windows9x/NT. Depending on your needs and the features of your laptop you could create the following partitions: + +<itemize> +<item>BIOS, some current BIOSes use a separate partition +<item>suspend to disk, some laptops support this feature +<item>swap space Linux +<item>swap space Windows9x/NT +<item>Linux base +<item>Linux <file>/home</file> or data +<item>common data between Linux and Windows9x/NT +</itemize> + +Note this chapter isn't ready yet. Please read the according HOWTOs first. + +<sect1>Linux Tools to Repartition a Hard Disk +<p> +<sect2>GNU parted +<p> +<url url="http://www.alphalink.com.au/~clausen/parted/" name="GNU parted"> allows you to create, destroy, resize and copy partitions. It currently supports ext2 and fat (fat16 and fat32) filesystems, and MS-DOS disklabels. This program can destroy data, and is not yet safe for general use. <tt>parted</tt> is currently in its early developement stage. + +<sect2>ext2resize +<p> +<url url="http://www.dsv.nl/~buytenh/ext2resize/" name="ext2resize"> is a program capable of resizing (shrinking and growing) ext2 filesystems. Checks whether the new size the user gave is feasible (i.e. whether the fs isn't too occupied to shrink it), connected to the <tt>parted</tt> project. + +<sect2>fixdisktable +<p> +Something was recently published on the <linux-kernel@vger.kernel.org> mailing list about a partition recovery program. I have not used this, nor examined it, nor read much about it (except for the HTML page.) It may be useful to some of you if you have problems with FIPS, Ranish Partition Manager/Utility or Partition Magic destroying your partition information. You can find information on this partition-fixer named &dquot;fixdisktable&dquot; at <url url="http://bmrc.berkeley.edu/people/chaffee/fat32.html" name="http://bmrc.berkeley.edu/people/chaffee/fat32.html ">. It is quite a ways down in that page. Or look for it via ftp in <url url="ftp://bmrc.berkeley.edu/pub/linux/rescue/" name=" ftp://bmrc.berkeley.edu/pub/linux/rescue/"> and locate the latest &dquot;fixdisktable&dquot; in that ftp directory. (Source and binary dist should be available.) + +<sect2>Caveats +<p> +Before repartitioning your harddisk take care about the disk layout. Especially look for hidden disk space or certain partitions used for <it>suspend to disk</it> or <it>hibernation</it> mode. Some laptops come with a partition which contains some BIOS programs (e.g. COMPAQ Armada 1592DT). Search the manual carefully for tools like <tt>PHDISK.EXE</tt>, Suspend to Disk, Diagnostic TOOLS. +<p> +Please see chapter <ref id="dostools" name="DOS Tools to Repartition a Hard Disk">, too. +<p> +By Nathan Myers from <url url="http://www.linuxlaptops.com" name="LL - LinuxLaptops">: &dquot;I partitioned a 10G Thinkpad drive last week and then none of fdisk, cfdisk, or sfdisk would read the partition table any more. It turns out I had created a partition that started on cylinder 1024, and there's a bug common to all three programs that makes them fail in that case. (I didn't try Disk Druid.) So, maybe you should add some advice about not starting partitions on that cylinder.&dquot; + +<sect2>Multi Boot +<p> +Please see the Different Environments chapter, for information about booting different operating systems from the same harddisk. + +<sect1>Installation Methods +<p> +From the Battery-HOWTO:&dquot;Installing and using Linux on a laptop is usually no problem at all, so go ahead and give it a try. Unlike some other operating systems, Linux still supports and runs well on even very old hardware, so you might give your outdated portable a new purpose in life by installing Linux on it.&dquot; +<p> +One of the great benefits of Linux are its numerous and flexible installation features, which I don't want to describe in detail. Instead I try to focus on <it>laptop specific methods</it>, which are necessary only in certain circumstances. +<p> +Most current distributions support installation methods which are useful for laptops, including installation from CD-ROM, via PCMCIA and NFS (or maybe SMB). Please see the documents which are provided with these distributions for further details or take a look at the above mentioned manuals and HOWTOs. + +<sect1>From a Boot Floppy plus CD-ROM - The Usual Way +<p> +With modern laptops, the usual Linux <idx>installation</idx> (one Boot Floppy, one Support Floppy, one Packages CD-ROM) should be no problem, if there is are floppy drive and a CD-ROM drive available. Though with certain laptops you might get trouble if you can not simultaneously use the <it>floppy drive and CD-ROM drive </it>, or if the floppy drive is <it>only available as a PCMCIA device</it>, as with the Toshiba Libretto 100. Some laptops support also booting and therefore installation completely from a CD drive, as reported for the SONY VAIO in the VAIO-HOWTO. Note: Check the BIOS for the CD boot option and make sure your Linux distribution comes on a bootable CD. +<p> +Certain laptops will only boot <it>zImage</it> kernels. <it>bzImage</it> kernels won't work. This is a known problem with the IBM Thinkpad 600 and Toshiba Tecra series, for instance. Some distributions provide certain boot floppies for these machines or for machines with limited memory resources, Debian/GNU Linux <url url="http://www.debian.org" name="http://www.debian.org"> for instance. + +<sect1>From a DOS or Windows Partition at the Same Machine +<p> +This is a short description of how to install from a CD-ROM under DOS without using boot or supplemental floppy diskettes. This is especially useful for notebooks with <it>swappable floppy and CD-ROM components</it> (if both are mutually exclusive) or if they are <it>only available as PCMCIA devices</it>. I have taken this method from &dquot;Installing Debian GNU/Linux 2.1 For Intel x86 - Chapter 5 Methods for Installing Debian&dquot; <url url="http://www.debian.org" name="http://www.debian.org"> : + +<enum> + +<item>Get the following files from your nearest Debian FTP mirror and put them into a directory on your DOS partition: <tt>resc1440.bin drv1440.bin base2_1.tgz root.bin linux install.bat</tt> and <tt>loadlin.exe</tt>. + +<item>Boot into DOS (not Windows) without any drivers being loaded. To do this, you have to press <<tt>F8</tt>> at exactly the right moment. + +<item>Execute <tt>install.bat</tt> from that directory in DOS. + +<item>Reboot the system and install the rest of the distribution, you may now use all the advanced features such as PCMCIA, PPP and others. + +</enum> + +This should work for other distributions with similar changes. For RedHat see <url url="http://www.linux-on-laptops.com/install_advice.html" name="How to Install from CD-ROM without Boot and Supplemental Disks"> . +<p> +Some new laptops may be able to boot a Linux distribution on a bootable CD-ROM (e.g., RedHat). This would allow installation without a floppy disk drive. + +<sect1>From a Second Machine With a Micro Linux On a Floppy +<p> +<sect2>Introduction +<p> +Because of their small or non-existent footprint, micro-Linuxes are especially suited to run on laptops, particularly if you use a company-provided laptop running Windows9x/NT. Or for installation purposes using another non Linux machine. There are several <it>micro</it> Linux distributions out there that boot from one or two floppies and run off a ramdisk. See appendix A for a listing of distributions. +<p> +I tried the following with <tt>muLinux</tt> <url url="http://mulinux.firenze.linux.it/" name="http://mulinux.firenze.linux.it/"> to clone my HP OmniBook 800 to a COMPAQ Armada 1592DT. Thanks to Michele Andreoli, maintainer of muLinux for his support. Since <tt>muLinux</tt> doesn't support PCMCIA yet, you may use <tt>TomsRtBt</tt> instead. In turn <tt>TomsRtBt</tt> doesn't support <tt>PPP</tt> but provides <tt>slip</tt>. Note: Since version 7.0 <tt>muLinux</tt> provides an Add-On with PCMCIA support. +<p> +I have described how to copy an already existing partition, but it might be also possible to achieve a customized installation. Note: Usually you would try to achieve an installation via NFS, which is supported by many distributions. Or if your sources are not at a Linux machine you might try the SMB protocol with SAMBA, which is also supported by <tt>muLinux</tt> . + +<sect2>Prerequisites +<p> +You need two machines equipped with Linux. With the laptop (client/destination) on which you want to install Linux use the muLinux floppy. The other machine (server/source) may be a usual Linux box or also using muLinux. Though its low transfer rate I use a serial null modem cable because its cheap. You may apply the according method using a PCMCIA network card and a crossover network cable or a HUB, or a parallel &dquot;null modem&dquot; cable and PLIP. As the basic protocol I used PPP, but you may also use SLIP. For the data-transfer I used <tt>nc</tt>. Note: this is an abbrevation for <tt>netcat</tt>, some distributions use this as the program name. You may use <tt>ftp</tt>, <tt>tftp</tt>, <tt>rsh</tt>, <tt>ssh</tt>, <tt>dd</tt>, <tt>rcp</tt>, <tt>kermit</tt>, <tt>NFS</tt>, <tt>SMB</tt> and other programs instead. + +Basic requirements are: + +<enum> + +<item> +A good knowledge about using Linux. You have to know exactly what you are doing, if not you might end destroying former installations.</item> + +<item> +A nullmodem serial cable.</item> + +</enum> + +<sect2>Source Machine +<p> +At your <it>source</it> machine issue the following commands (attention: IP address, port number, partition and tty are just examples!): + +<enum> + +<item> +Edit <file>/etc/ppp/options</file>, it should contain only: +<code> +/dev/ttyS0 +115200 +passive +</code></item> + +<item>With muLinux versions 3.x you may even use the convenient command <tt>setup -f ppp</tt> .</item> + +<item> +Start PPP: <tt>pppd</tt> .</item> + +<item> +Configure the PPP network device: <tt>ifconfig ppp0 192.168.0.1</tt> .</item> + +<item> +Add the default route: <tt>route add default gw 192.168.0.1</tt> .</item> + +<item> +Check the network connection: <tt>ping 192.168.0.2</tt>, though the destination machine isn't up yet.</item> + +<item> +Start the transfer from another console, remember <tt><LEFT-ALT><Fx></tt>: <tt>cat /dev/hda2 | gzip -c | nc -l -p 5555</tt> .</item> + +<item> +After the transfer (there are no more harddisk writings) stop the ping: <tt>killall ping</tt> .</item> + +</enum> + +<sect2> Destination Machine +<p> +At the <it>destination</it> machine issue: + +<enum> + +<item> +Edit <file>/etc/ppp/options</file>, it should contain only: +<code> +/dev/ttyS0 +115200 +passive +</code></item> + +<item>With muLinux versions >= 3.x you may even use the convenient command <tt>setup -f ppp</tt> .</item> + +<item> +Start PPP: <tt>pppd</tt> .</item> + +<item> +Configure the PPP network device: <tt>ifconfig ppp0 192.168.0.2</tt> .</item> + +<item> +Add the default route: <tt>route add default gw 192.168.0.2</tt> .</item> + +<item> +Check the network connection, by pinging to the source machine: <tt>ping 192.168.0.1</tt> .</item> + +<item> +Change to another console and get the data from the server: <tt>nc 192.168.0.1 5555 | gzip -dc >/dev/hda4</tt> .</item> + +<item> +400 MB may take app. 6 hours, but YMMV.</item> + +<item> +Stop the transfer, when it is finished with: <tt><CTL><C></tt> . This can probably be avoided (but I didn't test it) by adding a timeout of 3 seconds using the <tt>-w 3</tt> parameter for <tt>nc</tt> at the destination machine <tt>nc -w 3 192.168.0.1 5555 | gzip -dc >/dev/hda4</tt></item> + +<item> +After the transfer is completed, stop the ping: <tt>killall ping</tt> .</item> + +</enum> + +<sect2>Configuration of the Destination Machine after the Transfer +<p> + +<enum> + +<item> +Edit <file>/etc/fstab</file> .</item> + +<item> +Edit <file>/etc/lilo.conf</file> and <file>/etc/lilo.msg</file> and start <tt>lilo</tt> .</item> + +<item> +Set the new root device to the kernel: <tt>rdev image root_device</tt> .</item> + +</enum> + +<sect2>Miscellaneous +<p> + +<enum> + +<item> +You may use <tt>bzip2</tt> the same way as <tt>gzip</tt> (untested). + +<item> +Since <tt>rshd</tt>, <tt>sshd</tt>, <tt>ftpd</tt> daemons are not available with muLinux you have to build your own daemon with <tt>nc</tt> aka <tt>netcat</tt>, as described above.</item> + +<item> +I had to set up both PPP sides very quick or the connection broke, I don't know why.</item> + +<item> +Speed optimization has to be done, <tt>asyncmap 0</tt> or <tt>local</tt>?</item> + +<item> +I checked this only with a destination partition greater than the source partition. Please check <tt>dd</tt> instead of <tt>cat</tt> therefore. +<p> +Or do the following (untested): At the destination machine <tt>cd</tt> into the root directory <file>/</file> and do <tt>nc -l -p 5555 | bzip2 -dc | tar xvf -</tt>. At the source machine machine <tt>cd</tt> into the root directory <file>/</file> and do <tt>tar cvf - . | bzip2 | nc -w 3 192.168.0.2 5555</tt>. This should shorten the time needed for the operation, too. Because only the allocated blocks need to be transfered. + +<item> +Don't <tt>mount</tt> the destination partition.</item> + +</enum> + +<sect1>From a Second Machine With a 2.5&dquot; Hard Disk Adapter +<p> +From Adam Sulmicki adam@cfar.unc.edu I got this hint: Most but not all harddisks in laptops are removable, but this might be not an easy task. You could just buy one of those cheap 2.5&dquot; IDE converters/adapters which allow you to connect this harddisk temporarily to a PC with IDE subsystem, and install Linux as usual using that PC. You may do so using the harddisk as the first IDE drive or besides as the second IDE drive. But than you need to be sure that lilo writes to the right partition. Also you have to make sure that you use the same translation style as your laptop is going to use (i.e. LBA vs. LARGE vs. CHS ). You find additional information in the Hard-Disk-Upgrade-mini-HOWTO. You might copy an existing partition, but it is also possible to achieve a customized installation. + +<sect1>From a PCMCIA Device +<p> +Since I don't have a laptop which comes with a PCMCIA <it>floppy drive</it> (for instance Toshiba Libretto 100), I couldn't check this method. Please see the chapter Booting from a PCMCIA Device in the PCMCIA-HOWTO. Also I couldn't check whether booting from a PCMCIA <it>harddisk</it> is possible. +<p> +Anyway, when you are able to boot from a floppy and the laptop provides a PCMCIA slot, it should be possible to use different PCMCIA cards to connect to another machine, to an external SCSI device, different external CD and ZIP drives and others. Usually these methods are described in the documentation which is provided with the distribution. + +<sect1>From a Parallel Port Device (ZIP Drive, CD Drive) +<p> +I couldn't check this method by myself, because I don't have such a device. Please check the according Install-From-Zip-mini-HOWTO and CD-HOWTO. Also I don't know how much these installation methods are supported by the Linux distributions or the micro Linuxes. I suppose you have to fiddle around a bit to get this working. + +<sect1>From a Second Machine Using the Parallel Port - PLIP Network Install +<p> +I got this courtesy by Nathan Myers <ncm@cantrip.org>: &dquot;Many distributions support installing via a network, using FTP, HTTP, or NFS. It is increasingly common for laptops to have only a single PCMCIA slot, already occupied by the boot floppy drive. Usually the boot floppy image has drivers for neither the floppy drive itself, nor the PCMCIA subsystem. Thus, the only network interface available may be the parallel port. +<p> +Installation via the parallel port using the PLIP protocol has been demonstrated on, at least, Red Hat. All you need is a <it>Laplink</it> parallel cable, cheap at any computer store. See the PLIP-mini-HOWTO for details on setting up the connection. Note that (uniquely) the RedHat installation requires that the other end of the PLIP connection be configured to use ARP (apparently because RedHat uses the DOS driver in their installer). On the host, either <tt>export</tt> your CD file system on NFS, or <tt>mount</tt> it where the ftp or web daemon can find it, as needed for the installation.&dquot; +<p> +The PLIP Install HOWTO by Gilles Lamiral describes how to install the Debian GNU-Linux distribution on a computer without ethernet card, nor cdrom, but just a local floppy drive and a remote nfs server attached by a Null-Modem parallel cable. The nfs server has a cdrom drive mounted and exported. + +<sect1>Installing Linux on Small Machines +<p> +If you have less than 8MB memory and want to install via NFS you may get the message &dquot;fork: out of memory&dquot;. To handle this problem, use <tt>fdisk</tt> to make a swap partition (<tt>fdisk</tt> should be on the install floppy or take one of the mini Linuxes described above). Then try to boot from the install floppy again. Before configuring the NFS connection change to another console (for instance by pressing <ALT><2>) and issue <tt>swapon /dev/xxx</tt> (xxx = swap partition ). Thanks to Thomas Schmaltz. + +<sect> +Hardware In Detail +<p> +<sect1> +PCMCIA Controller +<p> +<sect2> +Linux Compatibility Check +<p> +With the <tt>probe</tt> command, which is included in the PCMCIA-CS package by David Hinds you can get the type of the PCMCIA controller. Often this shows also up with <tt>cat /proc/pci</tt> . + +<sect2> +Related HOWTOs +<p> + +<enum> + +<item> +PCMCIA-HOWTO</item> + +</enum> + +<sect2>PCMCIA Configuration - Survey +<p> +In the mailing lists where I'm a member, the question &dquot;How can I set up PCMCIA support, after the Linux installation?&dquot; comes up sometimes. Therefore I try to give a short survey. But the authoritative source for the latest information about the <it>PCMCIA Card Services for Linux</it>, including documentation, files, and generic PCMCIA information is the <url url="http://pcmcia.sourceforge.org" name="Linux PCMCIA Information Page"> . For problems with PCMCIA and APM see the APM chapter. + +<sect3>Software +<p> +<enum> + +<item> +Read the PCMCIA HOWTO, usually included in the PCMCIA-CS package.</item> + +<item> +Install the newest available PCMCIA-CS package, if you take a rpm or deb package it is quite easy.</item> + +<item> +If necessary, install a new kernel. Note: With 2.2.x kernels PCMCIA kernel support seems no longer necessary. I had no time to look this up yet. Please read the according documents.</item> + +<item> +Make sure your kernel has module support and PCMCIA support enabled (and often APM support)</item> + +<item> +Make sure your kernel also includes support for the cards you want to use, e.g. network support for a NIC card, serial support for a modem card, SCSI support for a SCSI card and so on.</item> + +<item> +If you have a custom made kernel, don't forget to compile the PCMCIA-CS source against your kernel. + +</enum> + +<sect3>PCMCIA Controller +<p> + +<enum> + +<item> +Use the <tt>probe</tt> command to get information whether your PCMCIA controller is detected or not.</item> + +<item> +Edit the file <file>/etc/sysconfig/pcmcia</file>. It should include <tt>PCMCIA=y</tt> and the type of your PCMCIA controller, e.g. <tt>PCIC=i82365</tt>. </item> + +<item> +Start the PCMCIA services typically via <tt>/etc/init.d/pcmcia start</tt>. If you get two high beeps, everything should be fine.</item> + +<item> +If something doesn't work, check the messages in <file>/var/log/messages</file> . </item> + +</enum> + +<sect3> +PCMCIA Card +<p> +<enum> +<item> +Check your card with <tt>cardctl ident</tt> .</item> + +<item> +If your card is not in <file>/etc/pcmcia/config</file>, edit the file <file>/etc/pcmcia/config.opts</file> accordingly. Take an entry in the first file as a model. You may try every driver, just in case it might work, for instance the <tt>pcnet_cs</tt> supports many NE2000 compatible PCMCIA network cards. + +<item> +A list of supported cards is included in the PCMCIA-CS package. The current list you may find at <url url="http://pcmcia-cs.sourceforge.net" name=" SUPPORTED.CARDS">. +<p> +Since there are not all cards mentioned I have set up a page <url url="http://tuxmobil.org/pcmcia_linux.html" name="PCMCIA Cards &dquot;Unofficially&dquot; Supported by Linux"> . + +<item> +If you use X, you can use <tt>cardinfo</tt> to insert, suspend, or restart a PCMCIA card via a nice graphical interface. + +</enum> + +<sect1>Infrared Port +<p> +<sect2>Linux Compatibility Check +<p> +To get the IrDA port of your laptop working with Linux/IrDA you may use StandardInfraRed (SIR) or FastInfraRed (FIR). + +<sect3>SIR +<p> +Up to 115.200bps, the infrared port emulates a serial port like the 16550A UART. This will be detected by the kernel serial driver at boot time, or when you load the <file>serial</file> module. If infrared support is enabled in the BIOS, for most laptops you will get a kernel message like: + +<code> +Serial driver version 4.25 with no serial options enabled +ttyS00 at 0x03f8 (irq = 4) is a 16550A #first serial port /dev/ttyS0 +ttyS01 at 0x3000 (irq = 10) is a 16550A #e.g. infrared port +ttyS02 at 0x0300 (irq = 3) is a 16550A #e.g. PCMCIA modem port +</code> + +<sect3>FIR +<p> +If you want to use up to 4Mbps, your machine has to be equipped with a certain FIR chip. You need a certain Linux/IrDA driver to support this chip. Therefore you need exact information about the FIR chip. You may get this information in one of the following ways: + +<enum> + +<item>Read the <it>specification</it> of the machine, though it is very rare that you will find enough and reliable information there. + +<item>Try to find out wether the FIR chip is a <it>PCI</it> device. Do a <tt>cat /proc/pci</tt> . The according files for 2.2.x kernels are in <file>/proc/bus/pci</file> . Though often the PCI information is incomplete. You may find the latest information about PCI devices and vendor numbers in the kernel documentation usually in <file>/usr/src/linux/Documentation</file> or at the page of Craig Hart <url url="http://members.hyperlink.net.au/~chart" name="http://members.hyperlink.net.au/~chart"> . From kernel 2.1.82 on, you may use <tt>lspci</tt> from the <tt>pci-utils</tt> package, too. + +<item>Use the <it>DOS tool</it> <tt>CTPCI330.EXE</tt> provided in ZIP format by the German computer magazine CT <url url="http://www.heise.de/ct/ftp/pci.shtml" name=" http://www.heise.de/ct/ftp/pci.shtml"> . The information provided by this program is sometimes better than that provided by the Linux tools. + +<item>Try to get information about <it>Plug-and-Play (PnP)</it> devices. Though I didn't use them for this purpose yet, the <tt>isapnp</tt> tools, could be useful. + +<item>If you have installed the <it>Linux/IrDA software</it> load the FIR modules and watch the output of <tt>dmesg</tt>, whether FIR is detected or not. + +<item>Another way how to figure it out explained by Thomas Davis (modified by WH): &dquot;Dig through the FTP site of the vendor, find the <it>Windows9x FIR drivers</it>, and they have (for a SMC chip): + +<code> +-rw-rw-r-- 1 ratbert ratbert 743 Apr 3 1997 smcirlap.inf +-rw-rw-r-- 1 ratbert ratbert 17021 Mar 24 1997 smcirlap.vxd +-rw-rw-r-- 1 ratbert ratbert 1903 Jul 18 1997 smcser.inf +-rw-rw-r-- 1 ratbert ratbert 31350 Jun 7 1997 smcser.vxd +</code> + +If in doubt, always look for the .inf/.vxd drivers for Windows95. Windows95 doesn't ship with _ANY_ FIR drivers. (they are all third party, mostly from Counterpoint, who was assimilated by ESI).&dquot + +<item>Also Thomas Davis found a package of small <it>DOS utilities made by SMC</it>. Look at <url url="http://www.smsc.com/ftppub/chips/appnote/ir_utils.zip" name="http://www.smsc.com/ftppub/chips/appnote/ir_utils.zip"> . The package contains <tt>FINDCHIP.EXE</tt>. And includes a <tt>FIRSETUP.EXE</tt> utility that is supposed to be able to set all values except the chip address. Furthermore it contains <tt>BIOSDUMP.EXE</tt>, which produces this output: +<p> +Example 1 (from a COMPAQ Armada 1592DT) + +<code> + In current devNode: + Size = 78 + Handle = 14 + ID = 0x1105D041 = 'PNP0511' -- Generic IrDA SIR + Types: Base = 0x07, Sub = 0x00, Interface = 0x02 + Comm. Device, RS-232, 16550-compatible + Attribute = 0x80 + CAN be disabled + CAN be configured + BOTH Static & Dynamic configuration + Allocated Resource Descriptor Block TAG's: + TAG=0x47, Length=7 I/O Tag, 16-bit Decode + Min=0x03E8, Max=0x03E8 + Align=0x00, Range=0x08 + TAG=0x22, Length=2 IRQ Tag, Mask=0x0010 + TAG=0x79, Length=1 END Tag, Data=0x2F +</code> + +Result 1: +<p> +<tt>Irq Tag, Mask (bit mapped - ) = 0x0010 = 0000 0000 0000 0001 0000</tt> so, it's IRQ 4. (start at 0, count up ..), so this is a SIR only device, at IRQ=4, IO=x03e8. +<p> +<p> +Example 2 (from an unknown machine) + +<code> + In current devNode: + Size = 529 + Handle = 14 + ID = 0x10F0A34D = 'SMCF010' -- SMC IrCC + Types: Base = 0x07, Sub = 0x00, Interface = 0x02 + Comm. Device, RS-232, 16550-compatible + Attribute = 0x80 + CAN be disabled + CAN be configured + BOTH Static & Dynamic configuration + + Allocated Resource Descriptor Block TAG's: + TAG=0x47, Length=7 I/O Tag, 16-bit Decode + Min=0x02F8, Max=0x02F8 + Align=0x00, Range=0x08 + TAG=0x22, Length=2 IRQ Tag, Mask=0x0008 + TAG=0x47, Length=7 I/O Tag, 16-bit Decode + Min=0x02E8, Max=0x02E8 + Align=0x00, Range=0x08 + TAG=0x2A, Length=2 DMA Tag, Mask=0x02, Info=0x08 + TAG=0x79, Length=1 END Tag, Data=0x00 +</code> + +Result 2: +<p> +a) it's a SMC IrCC chip +<p> +b) one portion is at 0x02f8, has an io-extent of 8 bytes; irq = 3 +<p> +c) another portion is at 0x02e8, io-extent of 8 bytes; dma = 1 (0x02 =0000 0010) +<p> +<p> +Thomas Davis has placed some device information at <url url="http://www.jps.net/tadavis/irda/devids.txt" name="http://www.jps.net/tadavis/irda/devids.txt"> . +<p> +WARNING: The package is not intended for the end user, and some of the utilities could be harmful. The only documentation in the package is in M$ Word format. Linux users may read this with <tt>catdoc</tt>, available at <url url="http://www.fe.msk.ru/~vitus/catdoc/" name="http://www.fe.msk.ru/~vitus/catdoc/"> . + +<item>Use the <it>Device Manager</it> of Windows9x/NT. + +<item>You may also use the <it>hardware surveys</it> mentioned below. + +<item>And as a last ressort, you may even <it>open the laptop</it> and look at the writings at the chipsets themselfs. + +</enum> + +<sect3>Hardware Survey +<p> +I have made a hardware survey at <url url="http://tuxmobil.org/ir_misc.html" name="http:/www.snafu.de/~wehe/ir_misc.html">. This list also contains information about infrared capable devices which are not mentioned here (mice, printers, remote control, transceivers, etc.). +<p> +To make this list more valuable, it is necessary to collect more information about the infrared devices in different hardware. You can help by sending me a short e-mail containing the exact name of the hardware you have and which type of infrared controller is used. +<p> +Please let me know also how well Linux/IrDA worked (at which tty, port and interrupt it works and the corresponding infrared device, e.g. printer, cellular phone). +<p> +Also you can help by contributing detailed technological information about some infrared devices, which is necessary for the development of drivers for Linux. + +<sect2>Related HOWTOs +<p> + +<enum> + +<item> +Linux/IR-HOWTO</item> + +</enum> + +<sect2>IrDA Configuration - Survey +<p> +<sect3>IrDA +<p> +The Linux infrared support is still experimental, but rapidly improving. I try to describe the installation in a short survey. Please read my <url url="http://tuxmobil.org/howtos.html" name="Linux/IR-HOWTO"> for detailed information. + +<sect4>Kernel +<p> + +<enum> + +<item> +Get a 2.2.x kernel.</item> + +<item> +Compile it with all IrDA options enabled.</item> + +<item> +Also enable experimental, sysctl, serial and network support.</item> + +</enum> + +<sect4>Software +<p> + +<enum> + +<item> +Get the Linux/IrDA software <tt>irda-utils</tt> at <url url="http://irda.sourceforge.net" name="The Linux IrDA Project"> .</item> + +<item> +Untar the package.</item> + +<item> +Do a <tt>make depend; make all; make install</tt></item> + +</enum> + +<sect4>Hardware +<p> + +<enum> + +<item> +Enable the IrDA support in the BIOS.</item> + +<item> +Check for SIR or FIR support, as described above.</item> + +<item> +Start the Linux/IrDA service with <tt>irmanager -d 1</tt> .</item> + +<item> +Watch the kernel output with <tt>dmesg</tt> .</item> + +</enum> + +<sect3>Linux Remote Control - LiRC +<p> +Linux Remote Control <url url="http://fsinfo.cs.uni-sb.de/~columbus/lirc/" name="http://fsinfo.cs.uni-sb.de/~columbus/lirc/"> is maintained by Christoph Bartelmus. &dquot;Lirc is a package that supports receiving and sending IR signals of the most common IR remote controls. It contains a device driver for hardware connected to the serial port, a daemon that decodes and sends IR signals using this device driver, a mouse daemon that translates IR signals to mouse movements and a couple of user programs that allow to control your computer with a remote control.&dquot; I don't have valid information about how much infrared remote control is working with laptop infrared devices. + +<sect1>Graphic Chip +<p> +<sect2>Linux Compatibility Check +<p> +<sect3>Video Mode +<p> +The tool <tt>SuperProbe</tt> is part of XFree86 and is able to check many graphic chips. Please read the documentation carefully, because it might crash your hardware. From <tt>man SuperProbe</tt>: +<p> +&dquot;SuperProbe is a a program that will attempt to determine the type of video hardware installed in an EISA/ISA/VLB-bus system by checking for known registers in various combinations at various locations (MicroChannel and PCI machines may not be fully supported; many work with the use of the <tt>-no_bios</tt> option). This is an error-prone process, especially on Unix (which usually has a lot more esoteric hardware installed than MS-DOS system do), so SuperProbe may likely need help from the user. + +... + +At this time, SuperProbe can identify MDA, Hercules, CGA, MCGA, EGA, VGA, and an entire horde of SVGA chipsets (see the -info option, below). It can also identify several HiColor/True-color RAMDACs in use on SVGA boards, and the amount of video memory installed (for many chipsets). It can identify 8514/A and some derivatives, but not XGA, or PGC (although the author intends to add those capabilities). Nor can it identify other esoteric video hardware (like Targa, TIGA, or Microfield boards).&dquot: + +For testing reasons start the X server with <tt>X 2> <error.msg></tt>. And try to change the resolution by typing <tt><CTL><ALT><+></tt> or <tt><CTL><ALT><-></tt>. Note: the + or - sign have to be taken from the numeric pad, which can be emulated at the letter pad by some laptops. + +<sect3>Text Mode +<p> +Just watch the display and determine if it works properly. If not, try to enable different video modes at startup time. Setting up X can sometimes be an exercise in trial and error. + +<sect2>Related HOWTOs +<p> + +<enum> + +<item> +XFree86-HOWTO</item> + +<item> +XFree86-Video-Timings-HOWTO</item> + +<item> +XFree86-XInside-HOWTO</item> + +<item> +X-Big-Cursor-mini-HOWTO (useful when running X on a notebook with low contrast LCD)</item> + +<item> +Keyboard-and-Console-HOWTO</item> + +<item> +vesafb-mini-HOWTO</item> + +</enum> + +<sect2>Survey X-Servers +<p> +You might discover that some features of your laptop are not supported by XFree86, e.g. high resolutions, accelerated X or an external monitor. Therefore I give a survey of available X servers. + +<enum> + +<item> +XFree86 <url url="http://www.xfree86.org" name="http://www.xfree86.org"></item> + +<item> +VESA Frame-Buffer-Device, available with 2.2.x kernels and XFree86 3.3.2 </item> + +<item> +Xinside aka AcceleratedX <url url="http://www.xig.com" name="http://www.xig.com"> , commercial </item> + +<item> +SciTech <url url="http://www.scitechsoft.com" name="http://www.scitechsoft.com"> , commercial</item> + +<item> +Metro-X at <url url="http://www.metrolink.com" name=" http://www.metrolink.com">, commercial . + +</enum> + +If you can't get an appropriate X server working, but don't want to effort a commercial X server you may try the VGA16 or the mono server included in XFree86. + +<sect2>Resources +<p> +You may find a survey about X windows resources at Kenneth E. Harker's page <url url="http://www.linux-on-laptops.com/" name="Linux on Laptops"> and a survey about current graphic chips used in laptops at <url url="http://tuxmobil.org/" name="TuxMobil">. + +<sect2>External Monitor +<p> +There are several different methods to activate support for an external monitor: as a <it>BIOS option</it> or during runtime with a <it>keystroke</it> e.g. <tt><Fn>+<F4></tt>. Maybe you have to edit <file>/etc/XF86Config</file> by configuring <tt>int_disp</tt> and <tt>ext_disp</tt>. If you can't get this to work with XFree, try a demo version of the commercial X servers mentioned above. Also check with the RedHat and SuSE WWW sites as they may have new, binary-only, X servers that may work with your laptop. + +<sect2>Miscellaneous +<p> +Sometimes you may encounter a display not working properly in text mode. Currently I don't have any recommendations, please see Keyboard-Console-HOWTO. + +Take care of the <it>backlight</it> AFAIK this device can only bear a limited number of uptime circles. So avoid using screensavers too much. + +For problems with X windows and APM please see the APM chapter. + +<sect1>Sound +<p> +<sect2>Linux Compatibility Check +<p> +The only way I know to check this, is to compile the different sound drivers into the kernel and check whether they are detected or not. The best way to do so, is to compile them as modules because it's easier to load different parameters such as interrupts and IO ports than. For the new 2.2.x kernels, read the <file>/usr/src/linux/Documentation/sound/Introduction</file> document by Wade Hampton. This document may help you get started with sound. Also, you might try one of the commercial sound drivers mentionend below. +<sect2>Related HOWTOs +<p> + +<enum> + +<item> +Sound-HOWTO + +<item> +Visual-Bell-mini-HOWTO + +</enum> + +<sect2>Survey Sound Drivers +<p> +Many new laptops come with 16-bit sound. But MWave and some other sound technologies won't work or are very hard to get working, e.g. booting to DOS, loading a driver, then using the soundcard as a standard SB-PRO. So you might need a commercial sound driver. With the recent announcement of Linux support by IBM, it would be GREAT if IBM supported the MWave under Linux (hint, hint...). As a last ressort you may try the speaker module <tt>pcsnd</tt>, which tries to emulate a soundcard. + +<enum> + +<item> +Kernel Sound Driver by Hannu Savolainen</item> + +<item> +ALSA <url url="http://alsa.jcu.cz" name="Advanced Linux Sound Architecture"> , commercial or at least non-GPL (since I found a Debian/GNU Linux package I'm not sure anymore, about the commercial status)</item> + +<item> +OSS <url url="http://www.4front-tech.com/usslite/ossfree.html" name="UNIX Sound System Lite / OSS">, commercial or at least non-GPL (since the 2.2.x kernels I'm not sure about the commercial status), also available from <url url="http://www.opensound.com" name="http://www.opensound.com"> .</item> + +</enum> + +<sect1>Keyboard +<p> +<sect2>Linux Compatibility Check +<p> +Usually there are no problems with Linux and the keyboard. Though there are two minor caveats: First the <tt>setleds</tt> program might not work. Second the key mapping might not fit your needs. Some Unix users and <tt>vi</tt> users expect to find the <CONTROL> key to the left of the <A> key. Many PC-type keyboards have the <CAPS-LOCK> key there. You may use <tt>xmodmap</tt> or <tt>loadkeys</tt> to re-map the keyboard. Some laptops (e.g., Toshiba) allow you to swap the <CAPS-LOCK> and <CONTROL> keys. Mark Alexander offered this solution in the linux-laptop mailing list: On RedHat, it's a one-line patch to <file>/usr/lib/kbd/keytables/us.map</file> , or whatever file is referenced in <file>/etc/sysconfig/keyboard</file>: + +<code> +*** us.map~ Tue Oct 31 14:00:07 1995 +--- us.map Thu Aug 28 13:36:03 1997 +*************** +*** 113,119 **** + keycode 57 = space space + control keycode 57 = nul + alt keycode 57 = Meta_space +! keycode 58 = Caps_Lock + keycode 59 = F1 F11 Console_13 + control keycode 59 = F1 + alt keycode 59 = Console_1 +--- 113,119 ---- + keycode 57 = space space + control keycode 57 = nul + alt keycode 57 = Meta_space +! keycode 58 = Control + keycode 59 = F1 F11 Console_13 + control keycode 59 = F1 + alt keycode 59 = Console_1 +</code> + +<sect2>External (Second) Keyboard +<p> +A second (or external) keyboard can be attached using the PS/2 port (I suppose this is not possible via the serial port, since there is no keyboard controller for the serial port). Also there is one laptop with a detachable keyboard the Siemens Scenic Mobile 800. This machine uses an infrared connection to the keyboard, but I don't know whether this works with Linux. WARNING: Don't plug the external keyboard in while the laptop is booted, or plug the mouse in the keyboard port and the keyboard in the mouse port. On a Toshiba, this caused one user to have to completely shutdown the laptop, remove the keyboard/mouse, and do a cold reboot. +<p> +For PS/2 ports there are so called Y-Cable available, which make it possible to use external mouse and external keyboard at the same time if your laptop supports this feature. +<p> +<url url="http://www.suse.cz/development/input/" name=" Parport to AUX port adapter"> In some cases one kbd port and one aux port is not enough and you may want to add another keyboard or mouse. You can use this adapter, together with the <tt>parkbd.c</tt> module for that. +<p> +On some laptops a splitter works to allow both mouse and keyboard +to be plugged in; on others it doesn't work at all.If you might +want to use both you had better check that it works, or you may +find yourself waiting anxiously for USB support. +<p> +<url url="http://www.suse.cz/development/input/" name="Sun keyboard to PC serial port adapter">: Many people have dreamed having their Sun Type 5 keyboard attached to their Linux box up to now. And with this adapter, it is finally possible. Because the standard Sun keyboards use TTL RS232 at 1200 bps to talk to the Suns, it's very easy to make them talk to any non-Sun computer by converting this to true RS232. All what you need is a MAX232 chip that'll take care about the correct voltage levels, and also some chip to invert the signals (CD4049 in the pic, I've used a 7400 quad-nand myself), since the MAX232 inverts them as well, and we don't need this. This all easily fits into a 25-pin serial connector. + +<sect1>Pointing Devices - Mice and Their Relatives +<p> +<sect2>Linux Compatibility Check +<p> +You may check your mouse with the <tt>mev</tt> command from the GPM package. +<sect2>Related HOWTOs +<p> + +<enum> + +<item> +3-Button-Mouse-mini-HOWTO for serial mice</item> + +<item> +Bus-Mouse-HOWTO</item> + +<item> +Kernel-HOWTO</item> + +</enum> + +<sect2>Mice Species +<p> + +<enum> + +<item> +Trackpad, Touchpad, used with the majority of current laptops</item> + +<item> +Trackball, e.g. COMPAQ LTE</item> + +<item> +Pop-up-Mouse, e.g. HP OmniBook 800</item> + +<item> +Trackpoint, Mouse-Pin, e.g. IBM ThinkPad and Toshiba</item> + +<item> +3 Button Mice, e.g. IBM Thinkpads at least the 600s. I have heard rumor about a 3 button mouse for Texas Instruments Travelmates, but couldn't verify this yet. </item> + +</enum> + +<sect2>PS/2 Mice +<p> +Most of the mice used in laptops are PS/2 mice (actually I don't know one with another mouse protocol). You may communicate with the PS/2 mouse through <file>/dev/psaux</file> or <file>/dev/psmouse</file>. If you use X windows this device and the protocol has to be set in <file>/etc/XF86Config</file>, too. In earlier releases, sometimes the GPM mouse manager and X windows had trouble sharing a mouse when enabled at the same time. But AFAIK this is no problem anymore for the latest versions. +<p> +Speaking of Emulate3Buttons, 100ms is usually better than the 50ms +allowed in most default setups of <file>/etc/X11/XF86Config</file>. +<code> +Section &dquot;Pointer&dquot; +Protocol &dquot;PS/2&dquot; +Device &dquot;/dev/psaux&dquot; +Emulate3Buttons +Emulate3Timeout 100 +EndSection +</code> + +<sect2>Touchpad +<p> +Usually a touchpad works with the PS/2 mouse driver. A tip: I've heard that tipping with one , two or three fingers on the touchpad simultaneously results in pressing the left, middle and respectively the right mouse-button (by Martin Hoffmann <mh@rrz.uni-hamburg.de> for an IPC-Radiance 900). +<p> +There is also a dedicated touchpad driver available. <url url="http://www.pdos.lcs.mit.edu/~cananian/Synaptics/" name="The Synaptics Touchpad Linux Driver"> supports pointing devices used in notebooks by Acer, Compaq, Dell, Gateway, Olivetti, Texas Instruments, Winbook, and others. Other URL <url url="http://compass.com/synaptics/" name="N.N.">. +<p> +The recent <tt>gpm</tt> package (<url url="ftp://ftp.prosa.it/pub/gpm/" name="gpm >=1.8">) includes the above mentioned synaptics touchpad device driver. This device driver has been developed by H. Davies <hdavies@ameritech.net>. Instead of using the PS/2 compatibility mode of touchpad devices, you can now use native touchpad mode with some pretty impressive features. +<p> +In addition to translating finger motion into mouse motion and supporting the buttons, this support currently has several features (from the README): + +<itemize> + +<item>a &dquot;tap&dquot; on the TouchPad causes a left mouse click + +<item>a &dquot;tap&dquot; followed quickly by a finger motion causes a left button drag type action. + +<item>a &dquot;tap&dquot; in one of the corners causes an action the default configuration is upper right causes middle mouse click and lower right causes right mouse click + +<item>more pressure on the touch pad speeds the motion of the cursor + +<item>a &dquot;tap&dquot; with a motion component (default > 2mm) initiates a toss and catch sequence. This is terminated by a finger touch on the pad (the toss also ends after 1 sec since that is the idle timeout period for the touchpad). + +<item>if the finger moves close to an edge then the mouse motion will be continued in that direction so that you don't need to pick up your finger and start moving again. This continued motion is pressure sensitive (more pressure is faster motion). + +</itemize> + +These features can be enabled/disabled and many of them have time and speed parameters which can be adjusted to the taste of the user. +<p> +It seems <tt>gpm</tt> is best known as a console biased tool. This is true, but you may use it as an X input device. <tt>gpm</tt> is used as a repeater device. In this way you can use both the built-in synaptics touchpad with all the features and at the same time a serial mouse (with three buttons). This all works smoothly together. X reads the mouse events from a named pipe <file>/dev/gpmdata</file> in a protocol it understands, which in my case is <it>Mouse-Systems-Compatible</it> (5bytes). Most 3-button mice use the default protocol. So a simple reconfiguration in XF86Config is all that is required, after starting <tt>gpm</tt> in an appropriate way, of course. +<p> +<tt>gpm</tt> could be started on your laptop with the following arguments : <tt>/usr/bin/gpm -t synps2 -M -t ms -m /dev/ttyS0</tt> . Both touchpad and serial mouse work in console and X mode. You do have to create the named pipe <file>/dev/gpmdata</file> yourself. +<p> +Tapping with two fingers simultaneously to simulate a middle mouse +button works on Logitech touchpads used in a few machines. +<p> +Thanks to Geert Van der Plas for most of the touchpad chapter. + +<sect2>Touchscreen +<p> +The only laptop I know which includes a touchscreen is the Fujitsu Biblo 112. It may work in PS/2 or serial mouse compatibility mode. But I couldn't check this yet. + +<sect2>COMPAQ Concerto Pen +<p> +The latest version of the <url url="http://www.cs.nmsu.edu/~pfeiffer/#pen" name="Linux Compaq Concerto Pen Driver"> is available from Joe Pfeiffer's home page. + +<sect2>External Mouse +<p> +For better handling, e.g. with a 3 button mouse you may use an external mouse. This usually a serial mouse or a PS/2 mouse, according to the port your laptop offers. Usually this is no problem. +<p> +For PS/2 ports there are so called Y-Cable available, which make it possible to use external mouse and external keyboard at the same time if your laptop supports this feature. +<p> +WARNING: Don't plug in the external mouse while powered up. If you have separate mouse and keyboard ports, make sure you plug the mouse in the mouse port and the keyboard in the keyboard port. If you don't, you may have to do a hard reboot of the laptop to get it to recover. + +<sect1>Advanced Power Management - APM +<p> +<sect2>Linux Compatibility Check +<p> +From the Battery-Powered-mini-HOWTO &dquot; .. for APM to work on any notebook or energy-conscious desktop, the system BIOS ROM in the machine must support the <htmlurl url="http://www.intel.ocm/IAL/powermgm" name="APM Specification"> standard. Furthermore, for APM to work with the Linux operating system, the system BIOS ROM must support either the 1.0 or 1.1 version of the APM standard, and it must also support 32-bit protected mode connections. A system that supports APM 1.1 is preferred, as it provides more features that the device driver and supporting utilities can take advantage of.&dquot; + +You may get information about the APM version with the <tt>dmesg</tt> command and in the <file>/proc/apm</file> file. + +<sect2>Introduction +<p> +Features of APM according to <file>Documentation/Configure.help</file>: &dquot;The system time will be reset after a USER RESUME operation, the <file>/proc/apm</file> device will provide battery status information, and user-space programs will receive notification of APM <it>events</it> (e.g., battery status change). &dquot; + +APM support consists of two parts: <it>kernel</it> support and <it>user-land</it> support. + +<sect3>Kernel Land +<p> +For <it>kernel</it> support, enable the parameters in the corresponding kernel section. Some features need special tweaking with certain machines (e.g. IBM ThinkPad) or even don't work, (&dquot;TI 4000M TravelMate and the ACER 486/DX4/75 because they don't have compliant BIOSes&dquot;). Currently all distributions I know don't provide a kernel with APM support enabled. So you usually have to compile your custom kernel. Please see Kernel-HOWTO or distribution manual for details. The available APM options are (please see <file>Documentation/Configure.help</file> in the kernel source tree for more details): + +<itemize> + +<item><tt>CONFIG_APM_IGNORE_USER_SUSPEND</tt> Just a workaround for some NEC Versa M series laptops. + +<item><tt>CONFIG_APM_DO_ENABLE</tt> Enable APM features at boot time. + +<item><tt>CONFIG_APM_CPU_IDLE</tt>. Puts CPU in power save mode, if there is nothing to do for the kernel. + +<item><tt>CONFIG_APM_DISPLAY_BLANK</tt> Some laptops can use this to turn off the LCD backlight when the screen blanker of the Linux virtual console blanks the screen. Note that this is only used by the virtual console screen blanker, and won't turn off the backlight when using the X Window system. + +<item><tt>CONFIG_APM_POWER_OFF</tt> Turns the machine completely down, when using <tt>halt</tt>. This feature works with most laptops without problems. + +<item><tt>CONFIG_APM_IGNORE_MULTIPLE_SUSPEND</tt> Just a workaround for IBM ThinkPad 560. + +<item><tt>CONFIG_APM_IGNORE_SUSPEND_BOUNCE</tt> Just a workaround for Dell Inspiron 3200 and other notebooks. + +<item><tt>CONFIG_APM_RTC_IS_GMT</tt> Stores time in Greenwich Mean Time format. It is in fact recommended to store GMT in your real time clock (RTC) in the BIOS. + +<item><tt>CONFIG_APM_ALLOW_INTS</tt> Resolves some problems with <it>Suspend to Disk</it> for some laptops, for instance many newer IBM ThinkPads. + +</itemize> +<p> +Joey Hess <joey@kitenet.net> wrote at debian-laptop@lists.debian.org +&dquot;I just installed kernel 2.2.12 on my laptop, and was having some trouble +getting apm working. it said <it>apm disabled on user request</it> at boot time. +Well, some grepping the kernel sources found that passing <tt>apm=on</tt> to the +kernel at boot time enables it now. I can't find any record or docs of this +change. + +<sect3>User Land +<p> + +The utilities for <it>userland</it> support may be found at <url url="http://worldvisions.ca/~apenwarr/apmd/" name="http://worldvisions.ca/~apenwarr/apmd/">. APMD is a set of programs that control the Advanced Power Management system found in most modern laptop computers. If you run a 2.2.x kernel and want to experiment, Gabor Kuti <seasons@falcon.sch.bme.hu> has made a kernel patch that allows you to <it>hibernate</it> any Linux system to disk, even if your computers APM BIOS doesn't support it directly. IMHO you don't need this features if your laptop provides a function key to invoke suspend mode directly. + +When you first install Linux, you will probably have to recompile the kernel. The kernel that came with your distribution probably does not have APM enabled. + +Please see the Battery Powered Linux Mini-HOWTO by <kontakt@hanno.de> <url url="http://www.hanno.de" name="Hanno Mueller"> and the page of <url url="http://www.linux-on-laptops.com/" name="Kenneth E. Harker"> for detailed information. + +<p> +README <tt>apmd</tt>?:On laptop computers, the APM support provides access to battery status +information and may help you to conserve battery power, depending on your +laptop and the APM implementation. + +Rik Faith <faith@acm.org> has transferred maintenance of the Linux apmd +package over to me, Avery Pennarun <apenwarr@worldvisions.ca> and I'm +finally getting around to making a release with the many updates we've +collected since the last release back in 1996. + +Here's what <tt>apmd</tt> can do: + +<itemize> +<item>apmd(8): logs the battery status to syslog every now and then and handles background power management tasks; +<item>apm(1): a command-line tool to print the current battery status or suspend the computer; +<item>xapm(1x): provides a battery meter for X; +<item>libapm.a: a library for writing similar APM applications. +</itemize> + +Richard Gooch wrote: I'have had a look at the beta version of <tt>apmd</tt>, and I still don't like it, because: + +<itemize> + +<item> +Only supports one command to run at suspend time. + +<item> +Doesn't distinguish between user and system suspends. + +<item>doesn't provide a way to disable policy (the <tt>sync()</tt>; <tt>sleep(0) </tt>; <tt>sync()</tt>; <tt>sleep(1)</tt>; sequence) + +<item> +Does not document extra features. + +<item> +And I'm not sure that what we want is a single super daemon. A collection of smaller daemons might be better, since it allows people to pick and choose. A super daemon is bloat for those who only want one small feature. + +</itemize> + +Though this topic was discussed controversly Richard Gooch has put together a package <tt>suspendd</tt> at <url url="http://www.atnf.csiro.au/~rgooch/linux/" name="http://www.atnf.csiro.au/~rgooch/linux/"> . + +Also, have a look at <tt>apmcd</tt> (<tt>apm</tt> based crontab) at <url url="ftp://ftp.binary9.net/pub/linux/" name="ftp://ftp.binary9.net/pub/linux/"> . A tool made by Nicolas J. Leon <nicholas@binary9.net> <url url="http://mrnick.binary9.net/" name="http://mrnick.binary9.net/">. + +Note: I didn't check wether this features are merged into one package (<tt>apmd</tt> eventually) already. + +<sect2>Caveats +<p> +If you have another operating system preinstalled or use another operating system at the same disk, make sure there is no &dquot;hibernation&dquot; or &dquot;suspend&dquot; tool installed, which could severely interfere with Linux, e.g. it might use disk space which is occupied by Linux or vice versa. + +<sect2>Troubleshooting +<p> +If your machine worked with 2.0.x kernels but not with the 2.2.x series, take this advice from Klaus Franken kfr@klaus.franken.de : &dquot;The default changed in 2.2. Search in the init-scripts for <tt>halt</tt> and change it to <tt>halt -p</tt> or <tt>poweroff</tt>. See <tt>man halt</tt> , if you don't have this option you need a newer version of <tt>halt</tt>.&dquot; You may find it in the <tt>SysVinit</tt> package. +<p> +On some new machines (for instance HP Omnibook 4150 - 366 MHz model) when accessing <file>/proc/apm</file>, you may get a kernel fault <tt>general protection fault: f000</tt>. Stephen Rothwell <Stephen.Rothwell@canb.auug.org.au> <url url="http://www.canb.auug.org.au/~sfr/" name="http://www.canb.auug.org.au/~sfr/"> explaines: &dquot;This is your APM BIOS attempting to use a real mode segment while in protected mode, i.e. it is a bug in your BIOS. .. We have seen a few of these recently, except all the others are in the power off code in the BIOS wher we can work around it by returning to real mode before attempting to power off. Here we cannot do this.&dquot; +<p> +<tt> apmd-rhcn-2.4phil-1</tt> by RedHat <url url="ftp://rhcn.redhat.com/pub/rhcn/" name="ftp://rhcn.redhat.com/pub/rhcn/"> contains an unofficial patch for shutting down the PCMCIA sockets before a suspend and patches for multiple batteries. +<p> +According to <file>Documentation/Configure.help</file>: &dquot;Some other things you should try when experiencing seemingly random, <it>weird</it> problems: + +<enum> + +<item>make sure that you have enough swap space and that it is enabled. +<item>pass the <tt>no-hlt</tt> option to the kernel. +<item>switch on floating point emulation in the kernel and pass the <tt>no387</tt> option to the kernel. +<item>pass the <tt>floppy=nodma</tt> option to the kernel. +<item>pass the <tt>mem=4M</tt> option to the kernel (thereby disabling all but the first 4 MB of RAM). +<item>make sure that the CPU is not over clocked. +<item>read the sig11 FAQ at <url url="http://www.bitwizard.nl/sig11/" name="http://www.bitwizard.nl/sig11/"> . +<item>disable the cache from your BIOS settings. +<item>install a fan for the video card or exchange video RAM. +<item>install a better fan for the CPU. +<item>exchange RAM chips. +<item>exchange the motherboard. + +</enum> + +<sect2>APM and PCMCIA +<p> +PCMCIA Card Services and Advanced Power Management (from the PCMCIA-HOWTO): +<p> +"Card Services can be compiled with support for APM (Advanced Power Management) if you've configured your kernel with APM support. ... The PCMCIA modules will automatically be configured for APM if a compatible version is detected on your system. Whether or not APM is configured, you can use <tt>cardctl suspend</tt> before suspending your laptop, and <tt>cardctl resume</tt> after resuming, to cleanly shut down and restart your PCMCIA cards. This will not work with a modem that is in use, because the serial driver isn't able to save and restore the modem operating parameters. APM seems to be unstable on some systems. If you experience trouble with APM and PCMCIA on your system, try to narrow down the problem to one package or the other before reporting a bug. Some drivers, notably the PCMCIA SCSI drivers, cannot recover from a suspend/resume cycle. When using a PCMCIA SCSI card, always use <tt>cardctl eject</tt> prior to suspending the system.". + +<sect2>APM and Resuming X Windows +<p> +&dquot;Many (most?) BIOSes fail to save and restore display +controller chip registers, and X has no protocol to +be notified of resume events, so on many systems +suspend/resume is more-or-less incompatible with X.&dquot; +<htmlurl url="http://www.linuxlaptops.com/ll/xresume.html" name="Linux Laptops"> +has created a fix for this problem. +<p> +Sometimes X windows and APM don't work smoothly together, the machine might even hang. A recommendation from Steve Rader: Some linux systems have their X server hang when doing <tt>apm -s</tt>. Folks with this affliction might want switch to the console virtual terminal then suspend <tt>chvt 1; apm -s</tt> as root, or, more appropiately.<tt>sudo chvt 1; sudo apm -s</tt>. I have these commands in a script, say, <tt>my-suspend</tt> and then do <tt>xapmload --click-command my-suspend</tt> . + +<sect2>Modularization of APM +<p> +As far as I remember this is controversly discussed, but I don't remember the URL. It isn't a kernel feature yet. + +<sect2>APM Resume Options +<p> +The new 3.0beta versions add a new feature to apmd: it can run arbitrary +commands (like <tt>cardctl suspend</tt>) when you suspend or resume your system. +It also supports BIOS clocks that are set to UTC time. + +<sect2>APM and Sound +<p> +Lots of BIOSes fail to restore sound chip registers, so you may get +a squeal of feedback when you wake up the machine. A script in +<file>/etc/apm/event.d</file> can use <tt>aumix</tt> to save and restore sound mixer settings. + +<sect2> Software Suspend +<p> +<htmlurl url="http://falcon.sch.bme.hu/˜seasons/linux/swsusp.html" name="Software suspend"> +enables the possibilty of suspendig machine. It doesn't need APM. You may suspend your machine by either pressing Sysrq-d +or with 'swsusp' or 'shutdown -z (patch for sysvinit needed). It creates an image which is saved in your active swaps. By the +next booting the kernel detects the saved image, restores the memory from it and then it continues to run as before you've +suspended. If you don't want the previous state to continue use the 'noresume' kernel option. + +<sect1>ACPI +<p> +ACPI stands for <it>Advanced Configuration and Power Interface</it>. This is a specification by Toshiba, Intel and Microsoft. Besides many other things it also defines power management. This is why it is often compared to APM. +<p> +The ACPI4Linux project has started at the beginning of 1999. The ACPI4Linux project is a kernel driver project aimed at implementing full ACPI support for Linux, including fan control, dock/undock detection and a WindowMaker dockable temperature meter. You may reach it at <url url="http://phobos.fachschaften.tu-muenchen.de/acpi/" name="ACPI4Linux">. + +<sect1>Batteries +<p> +For information about available battery types, take a look at the Hardware Features chapter above. + +Please see Battery Powered Linux Mini-HOWTO by Hanno Mueller <kontakt@hanno.de> <url url="http://www.hanno.de/" name="http://www.hanno.de"> <url url="http://tuxmobil.org/energy_laptops.html" name="Power Supplies for Laptops - (Draft)"> for further information. + +Stephen Rothwell <url url="http://www.canb.auug.org.au/~sfr/" name="http://www.canb.auug.org.au/~sfr/"> is currently integrating a patch that will add multiple battery support to the kernel APM. + +From the <tt>mobile-update</tt> page (modified by WH): Discharge the battery. If your battery runs only for about 20 minutes, you probably suffer from memory effects. Most laptops do not discharge the battery properly. With low powered devices like old computer fans they can be discharged completely. This removes memory effects. You should do so even with LiIon batteries, though they don't suffer much from memory effext (the manual of an IBM Thinkpad says to cycle the batteries through a full charge/discharge cycle 3 times every few months or so). + +WARNING: Try this at your own risk! Make sure the voltage of the fans is compatible to your battery. It works for me. + +In the US, this company has most batteries for anything and can rebuild many that are no longer manufactured: Batteries Plus, 2045 Pleasant Hill Road, Duluth, GA 30096 +1 770 495 1644. + +<sect1>Memory +<p> +Unfortenately most laptops come with a proprietary memory chips. So they are not interchangeable between different models. But this seems changing. + +<sect1>Plug-and-Play Devices (PnP) +<p> +The <it>Plug and Play driver project</it> for Linux is a project to create support within the Linux kernel (see Linux.Org for more information) for handling Plug and Play (and other semi-PnP) devices in a clean, consistent way. It aims to allow a driver of any type of hardware to have this hardware configured by the PnP driver in the kernel. This driver is then notified when the device is reconfigured, or even removed from the system, so as to allow for graceful action in these circumstances <url url="http://www.io.com/~cdb/mirrors/lpsg/pnp-linux.html" name="http://www.io.com/~cdb/mirrors/lpsg/pnp-linux.html"> . +<p> +<it>ISA PnP tools</it> is another useful package. +<p> +And there is a project at RedHat <url url="http://www.redhat.com/pnp/overview.html" name="http://www.redhat.com/pnp/overview.html"> . +<p> +The latest PCMCIA driver package (>>3.1.0) has utilities <tt>lspnp</tt> and +<tt>setpnp</tt> to manipulate PNP settings. Note that in 3.1.0 you may +need this patch to compile them: +<code> +-#ifdef __GLIBC__ ++#if 0 /* def __GLIBC__ */ + #include <byteswap.h> + #else +</code> + +<sect1>Docking Station / Port Replicator +<p> +<sect2>Definitions +<p> +First some definitions. There is a difference between <it>docking station</it> and <it>port replicator</it>. + +I use the term <it>docking station</it> for a box which contains slots to put some interface cards in, and space to put a harddisk, etc. in. This box can be permanently connected to a PC. A <it>port replicator</it> is just a copy of the laptop ports which may be connected permanently to a PC. + +<sect2>Other Solutions +<p> +I don't use a docking station. They seem really expensive and I can't see any usefulness. OK you have to mess up with some more cables, but is it worth so much money? Docking stations are useful in an office environment when you have a permanent network connection, or need the docking station's SCSI adaptor (e.g., for a CD-R). + +Also all docking stations I know are proprietary models, so if you change your laptop you have to change this device, too. I just found one exception a docking station which connects to your laptop via IrDA the IRDocking IR-660 by Tekram <url url="http://www.tekram.com/Hot_Products.asp?Product=IR-660" name="http://www.tekram.com/Hot_Products.asp?Product=IR-660"> . It supports these connectors: 10Base-T (RJ-45); PS/2 Keyboard; PS/2 Mouse; 25-Pin Printer Port (LPT); IR Transceiver; Power (6 VDC). So it seems that a VGA port and a port to connect a desktop PC directly are missing. This device should work with Linux/IrDA, though I couldn't check it out. + +I would prefer to buy a PC instead and connect it via <it>network</it> to the laptop. + +Or use an external display, which usually works well as described above, and an external keyboard and mouse. If your laptop supports an extra PS/2 port you may use a cheap solution a <it>Y cable</it>, which connects the PS/2 port to an external keyboard and an external monitor. Note: Your laptop probably has support for the <it>Y cable</it> feature, e.g. the COMPAQ Armada 1592DT. + +<sect2>Connection Methods +<p> +AFAIK there are <it>three solutions</it> to connect a laptop to a docking station: + +<enum> + +<item> +SCSI port</item> + +<item> +parallel port</item> + +<item> +(proprietary) docking port</item> + +</enum> + +From <url url="http://www.mjedev.demon.co.uk/index.html" name="Martin J. Evans martin@mjedev.demon.co.uk "> &dquot;The main problem with docking stations is getting the operating system to detect you are docked. Fortunately, if you configure your kernel with the /proc file system (does anyone not do this?) you can examine the devices available and thus detect a docked state. With this in mind a few simple scripts is all you need to get your machine configured correctly in a docked state. + +You may want to build support for the docking station hardware as modules instead of putting it directly into the kernel. This will save space in your kernel but your choice probably largely depends on how often you are docked. +<p> +1) Supporting <it>additional disks</it> on the docking station SCSI card +<p> +To my mind the best way of doing this is to: + +<enum> + +<item> +Either build support for the SCSI card into the kernel or build it as a module.</item> + +<item> +Put the mount points into <file>/etc/fstab</file> but use the &dquot;noauto&dquot; flag to prevent them from being mounted automatically with the <tt>mount -a</tt> flag. In this way, when you are docked you can explicitly mount the partitions off any disk connected to the docking station SCSI card.</item> + +</enum> +<p> +2) Supporting <it>additional network adaptors</it> in the docking station +<p> +You can use a similar method to that outlined above for the graphics card. Check the <file>/proc</file> filesystem in your rc scripts to see if you are docked and then set up your network connections appropriately. &dquot; + +Once you determine this information, you may use a script, similar to the following example, to configure the connection to your docking station at startup. The script is provided by Friedhelm Kueck: +<p> + +<code> +# check, if Laptop is in docking-station (4 PCMCIA slots available) +# or if it is standalone (2 slots available) +# Start after cardmgr has started +# +# Friedhelm Kueck mailto:fk@impress.de +# 08-Sep-1998 +# +# Find No. of Sockets +SOCKETS=`tail -1 /var/run/stab | cut -d &dquot:&dquot; -f 1` + +case &dquot;$SOCKETS&dquot; in + +&dquot;Socket 3&dquot;) +echo Laptop is in Dockingstation ... +echo Disabeling internal LCD Display for X11 +echo +cp /etc/XF86Config_extern /etc/XF86Config +# +# Setup of PCMCIA Network Interface after start of cardmge +# +echo +echo &dquot;Setting up eth0 for use at Network ...&dquot; +echo +/sbin/ifconfig eth0 10.1.9.5 netmask 255.255.0.0 broadcast 10.1.255.255 +/sbin/route add -net 10.1.0.0 gw 10.1.9.5 +/sbin/route add default gw 10.1.10.1 +;; + +&dquot;Socket 1&dquot;) +echo Laptop is standalone +echo Disabling external Monitor for X11 +cp /etc/XF86Config_intern /etc/XF86Config +echo +echo Network device NOT setup +;; +esac +</code> + +<sect1>Network Connections +<p> +<sect2>Related HOWTOs +<p> + +<enum> + +<item> +PLIP-mini-HOWTO</item> + +<item> +NET-3-HOWTO</item> + +<item> +Ethernet-HOWTO</item> + +<item> +Term-Firewall-mini-HOWTO</item> + +</enum> + +<sect2>Connection Methods +<p> +<sect3>PCMCIA Network Card +<p> +If your laptop supports PCMCIA this is the easiest and fastest way to get network support. Make sure your card is supported before buying one. + +<sect3>Serial Null Modem Cable +<p> +Probably the cheapest way to connect your laptop to another computer, but quite slow. You may use PPP or SLIP to start the connection. + +<sect3>Parallel Port NIC (Pocket Adaptor) +<p> +<url url="http://www.unix-ag.uni-siegen.de/~nils/accton_linux.html" name="Accton Pocket Ethernet and Linux"> This ethernet adaptor uses a parallel port and delivers approximately 110k Bytes/s throughput for those notebooks that do not have PCMCIA slots. + +<url url="http://www.linux-on-laptops.com/linksys.html" name="Linux and Linksys Ethernet Adaptors"> A short note on the use of the Linksys parallel-port ethernet adaptor under Linux. This is a widely available networking adaptor that doesn't require a PCMCIA slot. + +<sect3>Parallel &dquot;Null&dquot; Modem Cable +<p> +Offers more speed than a serial connection. Some laptops use chipsets that will not work with PLIP. Please see PLIP-HOWTO for details. + +<sect3>Docking Station NIC +<p> +I don't have experience with a NIC in a docking station yet. + +<sect1>Modem +<p> +<sect2>Modem Types +<p> +There are three kinds of modems available: internal, PCMCIA card or external serial port modems. But some internal modems will NOT work with Linux such as the MWave modems (IBM) or if the laptop has a WinModem. This is caused by non-standard hardware. So you have to use either a PCMCIA card modem or an external modem. + +Quotation from the Kernel-FAQ: &dquot;9.Why aren't WinModems supported? (REG, quoting Edward S. Marshall) The problem is the lack of specifications for this hardware. Most companies producing so-called <it>WinModems</it> refuse to provide specifications which would allow non-Microsoft operating systems to use them. The basic issue is that they don't work like a traditional modem; they don't have a DSP, and make the CPU do all the work. Hence, you can't talk to them like a traditional modem, and you -need- to run the modem driver as a realtime task, or you'll have serious data loss issues under any kind of load. They're simply a poor design.&dquot; + +&dquot;<it>Win</it> modems are lobotomized modems which expect Windows to do some of their thinking for them. If you do not have Windows, you do not have a connection. &dquot; + +Anyway, I have set up a page collecting information on laptops with internal modems at <url url="http://tuxmobil.org/" name="http://tuxmobil.org/"> . Maybe it's possible to run such modems with MS-Windows9x/NT emulators like <tt>wine</tt> or <tt>VMware</tt>, but I don't know it. +<p> +Recently there is a driver for Lucent WinModems (alpha) available at <url url="http://www.suse.cz/development/ltmodem/" name="SuSE - Labs"> and <url url="http://www.close.u-net.com" name="LTModem diagnostic tool">. + +<sect2>Caveats +<p> +WARNING: Pay attention to the different kinds of phone lines: analog and ISDN. You can't connect an analog modem to an ISDN port and vice versa. Though there might be hybrid modems available. Connecting to the wrong port may even destroy your modem. Trick: If you are looking for an analog phone port in an office building which is usually wired with ISDN, take a look at the fax lines, they are often analog lines. + +For tracking the packets on PPP you may use <tt>pppstats</tt>. Or <tt>pload</tt> this provides a graphical view of the traffic (in and out) of the PPP connection. It is based on athena widgets hence is very portable. It also uses very little CPU time. The home of <tt>pload</tt> is <url url="http://www.engr.utk.edu/~mdsmith/pload/" name="http://www.engr.utk.edu/~mdsmith/pload/"> . + +<sect1>SCSI +<p> +<sect2>Hardware Compatibility Check +<p> +If unsure about the right SCSI support, compile a kernel with all available SCSI drivers as modules. Load each module step by step until you get the right one. + +<sect2>Related HOWTOs +<p> + +<enum> + +<item> +SCSI-HOWTO</item> + +</enum> + +<sect2>Survey +<p> +AFAIK there is no laptop yet with a SCSI harddisk. Though there are two models with a built in SCSI port: Texas Instruments TI 4000 and HP OmniBook 800. Maybe the PowerBook G3 has a SCSI disk, but I didn't check this yet. The old Apple Powerbook Duo models had a SCSI hard disk. +<p> +For other models, if you need SCSI support you may get it by using a SCSI-PCMCIA card or via a SCSI adapter in a docking station. + +<sect1>Universal Serial Bus - USB +<p> +<sect2>Linux Compatibility Check +<p> +You should get information about the USB controller with <tt>cat /proc/pci</tt> and about USB devices with <tt>cat /proc/bus/usb/devices</tt>. + +<sect2>Miscelleaneous +<p> +Newer laptops come with the Universal Serial Bus (USB). I haven't tried it on any of my systems because I don't have any USB devices. +<p> +Visit <url url="http://www.linux-usb.org" name="http://www.linux-usb.org"> for the USB Linux home page. Also I have set up a page collecting information about laptops and USB at <url url="http://tuxmobil.org/" name="TuxMobil"> . + +<sect1>Floppy Drive +<p> +<sect2>Linux Compatibility Check +<p> +Usually there are no problems connecting a floppy drive to a Linux laptop. But with a laptop floppy drive you may sometimes not be able to use every feature. I encountered the <tt>superformat</tt> command (from the fdutils package) couldn't format more than 1.44MB with my HP OmniBook 800. You may also have difficulty when the floppy drive and CD drive are mutually exclusive, or when the floppy drive is a PCMCIA device (as with the Toshiba Libretto 100). With older laptops, there might be a minor problem if they use a 720K drive. AFAIK all distributions come with support for 1.44M (and sometimes 1.2M) floppies only. Though it's possible to install Linux anyway. Please see Installation chapter. Please see kernel documentation for boot time parameters concerning certain laptop floppy drives, for instance IBM ThinkPad. Or <tt>man bootparam</tt> . + +<sect1>CD Drive +<p> +Most notebooks today come with CD drives. If floppy and CD drive are swappable they are usually mutually exclusive. Sometimes they come as PCMCIA devices. Or as SCSI device (HP OmniBook 800). AFAIK there are discmans available which have a port to connect them to a computer or even a SCSI port. I found an article published by Ziff-Davis Publishing Company (September 1996 issue, but missed to note the URL) written by Mitt Jones: &dquot;Portable PC Card CD-ROM drives transform laptops into mobile multimedia machines&dquot;, which listed: Altec Lansing AMC2000 Portable Multimedia CD-ROM Center; Axonix ProMedia 6XR; CMS PlatinumPortable; EXP CDS420 Multimedia Kit; H45 QuickPCMCIA CD; Liberty 115CD; Panasonic KXL-D740; Sony PRD-250WN CD-ROM Discman. + +<sect1>DVD Drive +<p> +<url url="http://livid.on.openprojects.net" name="The Linux Video and DVD Project"> has made great headway since its start last February. They have just released the source code ( http://livid.on.openprojects.net/css.tgz) so that a DVD decoder card can unlock and read the DVD. Also provided on the site are links to various documents discussing DVD chipset specifications. The Linux Video and DVD Project is avidly seeking help from the opensource community for development. +<p> +<url url="http://www.trylinux.com/projects/udf/index.html" name="Universal Disk Format (UDF) Driver">: &dquot;UDF is a newer CDROM filesystem standard that's required for DVD roms. It's meant to be a replacement for the ISO9660 filesystem used on today's CDROMs, but the immediate impact for most will be DVD. DVD multimedia cdroms use the UDF filesystem to contain MPEG audio and video streams. To access DVD cdroms you would need a DVD cdrom drive, the kernel driver for the cdrom drive, some kind of MPEG video support, and a UDF filesystem driver (like this one). Some DVD cdroms may contain both UDF filesystems and ISO9660 filesystems. In that case, you could get by without UDF support.&dquot; + +<sect1>Harddisk +<p> +<sect2>Linux Compatibility Check +<p> +Useful programms are <tt>hdparm</tt>, <tt>dmesg</tt>, <tt>fsck</tt> and <tt>fdisk</tt> . + +<sect2>Miscellaneous +<p> +Be careful when using your laptop abroad. I have heard about some destroyed harddisks due to a magnetic field emitted from the magnetic-holds at the backresttable of the seats in a german railway waggon. +<p> +Though I am quite satisfied with the quality of the harddisk in my laptop, when I removed it from the case I unintendedly dropped it, I recommend to be very careful. + +<sect2>Form Factors +<p> +AFAIK there is only one form factor for harddisks used in laptops the 2.5&dquot; format. This format seems to be available in different heights (Please note I couldn't verify this information yet): + +<itemize> + +<item> 18mm: laptops build before 1996 usually have drives 18mm high + +<item>12.7mm: I got a report about such disks but without a notebook model or manufacturer name + +<item> 11mm: since 1996 the drives are 11mm high + +<item> 9mm: many laptops, including the subnotebooks, now use a 9mm-high disk drive. The largest available in this format in late 1999 is IBM <it>12GN</it>. + +<item> 9.5mm: Toshiba Libretto L70 and L100 have a 9.5mm HD + +<item>8.45mm: Toshiba Libretto 20, 30, 50 and 60 have 8.45mm tall HDs + +<item>6.35mm: Toshiba Libretto L1000 has a 6.35mm HD + +</itemize> + +It might be possible to use a hard disk wich doesn't fit with some case modifications. +<p> +Some laptops come with a removable hard disk in a tray, for instance the KAPOK 9600D. There seem to be no SCSI drives for laptops available. + +<sect1>Video Port / ZV Port +<p> +Some high end laptops come with a video or ZV port (NTSC/PAL). Since I don't have a laptop with a ZV or video port yet, I can provide only some URLs <url url="http://www.thp.uni-koeln.de/~rjkm/linux/bttv.html" name=" http://www.thp.uni-koeln.de/~rjkm/linux/bttv.html "> (driver) <url url="http://www.mathematik.uni-kl.de/~wenk/xwintv.html" name=" http://www.mathematik.uni-kl.de/~wenk/xwintv.html "> (tvviewer). For further information see video4linux at <url url=" http://roadrunner.swansea.uk.linux.org/v4l.shtml" name="http://roadrunner.swansea.uk.linux.org/v4l.shtml">. To collect information about laptops with video port I have setup a page at <url url="http://tuxmobil.org/" name="http://tuxmobil.org/"> . Alternatively to the ZV port you might use the USB port. + +<sect>Palmtops, Personal Digital Assistants - PDAs, Handheld PCs - HPCs +<p> +Palmtops and PDAs are currently not much covered in this HOWTO. Anyway it may be useful therefore, too. I just include some links, most of them are from <url url="http://www.linux-on-laptops.com/" name="Kenneth E. Harker's page"> : + +<enum> + +<item> +Highly recommended is the page by Russell King <url url="http://www.arm.uk.linux.org/~rmk/" name=" ARM Linux "> about PDAs with ARM CPU and with links to other Linux related PDA sites. + +<item> +PalmOS-HOWTO (former Pilot-HOWTO) by David H. Silber. + +<item> +<url url="http://privat.swol.de/ReinholdSchoeb/Newton/"name="Newton and Linux Mini-HOWTO"> . + +<item><url url="http://www.tcel.com/~aehall/newtl/" name="Newtl: Newton/Linux Communications System"> Newtl allows a Linux machine to communicate with a Newton PDA. Automatically send e-mail, print, and fax outboxes through your Linux machine, and more. + +<item> +<url url="ftp://ryeham.ee.ryerson.ca/pub/PalmOS/" name="PilotLink and XCoPilot"> PilotLink is an utility that performs data transfers from 3com PalmPilot handheld computers to your Linux machine. XCoPilot is an emulator of the PalmPilot operating system that runs under Linux. + +<item> +<url url="http://www.icsi.berkeley.edu/~minenko/PalmVNC" name="PalmVNC"> is an implementation of the Virtual Network Client architecture that will allow you to use a Linux or other UNIX machine to put up a (tiny) X Window on a 3COM PalmPilot. + +<item>PDAs and infrared remote control, see <url url="http://hp.vector.co.jp/authors/VA005810/remocon/remocone.htm" name="Hiromu Okada"> + +<item> +AFAIK you can run Linux on the IBM PC110 (a tiny PC handheld that's no longer manufactured). There's a HOWTO on it running around somewhere but I don't have an URL, instead I found a description in <url url="http://boardwatch.internet.com/mag/97/jul/bwm70.html" name=" LINUX REDUX July 1997"> by Alan Cox. + +<item> +For more information on Virtual Network Computing, see <url url="http://www.uk.research.att.com/vnc" name="VNC"> . + +<item> +There is also the <url url="http://www.cdpubs.com/hhsys/archives.html" name="Handheld Systems(TM) On-line Archives"> and a search engine about palmtop related topics <url url="http://www.palmtop.net/" name="Palmtop.Net/"> . + +<item> +I have setup a small page about <url url="http://tuxmobil.org/pda_linux.html" name="Linux with PDAs and Handheld PCs">, too. + +</enum> + +<sect>Cellular Phones, Pagers, Calculators, Digital Cameras, Wearable Computing +<p> +Though in my opinion related to the topic, these devices are not much covered in this text, yet. For general information about Embedded Systems, see <url url="http://www.embedded.com" name="http://www.embedded.com ">. For Linux information, see <url url="http://www.elks.ecs.soton.ac.uk/" name="ELKS"> and the <url url="http://ryeham.ee.ryerson.ca/uClinux" name=" uCLinux"> project. See news:comp.arch.embedded + +<sect1>Cellular Phones +<p> +For NOKIA cellular phones see <url url="http://multivac.fatburen.org/gnokii/" name="GNOKII project"> . And <url url="http://www.users.globalnet.co.uk/~syrinx/nserver/index.html" name="Linux Nserver">. This project aim is to produce a GPL replacement for Nokia's Windows Nserver, and maybe improve upon it along the way. Initially it will emulate the Windows 3.1 version (ie. allow backup, restore and install). +<p> +<url url="http://www.openwap.org/" name="openWAP"> is an open source project for the implementation of the Wireless Application Protocol (WAP) for use with browsers, servers and tools. WAP is used by PDA devices, cell phones, pagers and other wireless devices to transmit internet content to these devices. The project is still in its early stages and nothing can be downloaded yet. +<p> +<url url="http://www.pxh.de/fs/gsmlib/download/" name="GSMLIB"> is a library to access GSM mobile phones through GSM modems. Features include: modification of phonebooks stored in the mobile phone or on the SIM card, reading and writing of SMS messages stored in the mobile phone, sending and reception of SMS messages. Additionally, some simple command line programs are provided to use these features. + +<sect1>Pagers - SMS Messages +<p> +<url url="http://www.qpage.org/" name="QuickPage"> is a client/server software package that enables you to send messages to an alphanumeric pager. The client accepts a message from the user and forwards it to a server using SNPP. The server uses a modem to transmit the message to the recipient's paging service using the TAP protocol (also known as the IXO protocol). +<p> +<url url="http://www.fts.frontec.se/~dast/mail2sms/" name="mail2sms"> converts a (MIME) mail to a short message, allowing search/replace, conditional rules, date/time dependent actions, customizing the output format, etc. The output defaults to 160 characters, which is perfectly suitable for sending the text to a GSM telephone as an SMS message. This software does not include any code for actually sending the text to anything else but another program or stdout. +<p> +<url url="http://www.new.ox.ac.uk/~adam/computing/email2sms/" name="email2sms"> is a filter written in Perl which converts an e-mail into a form suitable for sending as an SMS message. Its main advantage over the alternatives is that it uses the CPAN module <it>Lingua::EN::Squeeze</it> to compress the text down to as little as 40% of its original size, so you can get much more of your e-mail into the 160 character limit imposed by SMS. It is fully MIME compatible, and has many configurable options, including removal of quoted text. Ideal for use with procmail. A Perl script for sending the output to a typical e-mail to SMS web gateway is included. +<p> +<url url="http://www.styx.demon.co.uk/smslink/" name="SMSLink"> implements a client/server gateway to the SMS protocol (short messages on the mobile phones). It requires the use of dedicated hardware though (a serial GSM module). Both SMS emission and reception are supported. The server only runs under Linux at the present time and also supports interactive mode via <tt>telnet</tt>. The command-line client already exists for Linux, Solaris and HP-UX. A basic web interface is provided. A Win32 client is in the works. +<p> +<url url="http://lide.pruvodce.cz/~wayne/" name="nmsms"> is a very simple program to announce incoming email to an SMS address (email address) defined at compile time. The original <it>From:</it> and <it>Subject:</it> header are included in each mail announced. +<p> +<url url="http://www.hof-berlin.de/mepl/" name="mepl"> is a software for 3COM/USRobotics Messagemodems to control the self-employed-mode. This program can be used for downloading the messages and saving or mailing them in gsm or fax-format. + +<sect1>Digital Cameras +<p> +For information about cellular phones and digital cameras see some links at my page about <url url="http://tuxmobil.org/ir_misc.html" name="Linux with Infrared Devices"> and my IR-HOWTO. +<p> +Newsgroup: rec.photo.digital . +<p> +The Flashpath adapter is a diskette like device which is used to transfer data from a digital camera to a computer. See <url url="http://www.schou.dk/flashpath/" name="Flashpath for Linux"> and James Radley's <url url="http://www.susie.demon.co.uk/flashpath.html" name="flashpath homepage">. + +<sect1>Calculators +<p> +Information about calculators e.g. HP-48 is at <url url="http://www.hpcalc.org" name="HP-Calculator.Org"> and <url url="http://www.gmi.edu/~madd0118/hp48/" name="Keith's HP-48 Page">. <url url="http://www.columbia.edu/kermit/hp48.html" name="HP-48 Kermit Hints and Tips"> shows how to talk to the HP48 via its serial-line Kermit protocol. The HP-48 may also be used as a <url url="http://panic.et.tudelft.nl/~costar/hp48" name="Linux terminal">. +<p> +See also at my page about <url url="http://tuxmobil.org/ir_misc.html" name="Linux with Infrared Devices">. +<p> +<url url="http://www.tunbury.demon.co.uk/casio/" name="Backup utility for the CASIO diary">. It is a package ported from DOS to allow communication to the CASIO series of hand-held organizers. It allows backup from CASIO to your computer and restore a backup file from your computer to the CASIO. It can also output human readable file from CASIO. Currently supports: phone, calendar, schedule, memo, and reminder. See also http://www.aloha.net/~alank/ http://www.casioworld.com , http://home.t-online.de/home/Milan.Urosevic/ and http://sunsite.unc.edu/pub/Linux/apps/ +<p> +<url url="http://www.multimania.com/rlievin/" name="GtkTiLink"> is a program which allows you to transfer data between a Texas Instruments calculator and a computer. It works with all cables (parallel, serial, Black and Gray TI Graph Link). It supports the TI82, TI89, TI92 and TI92+ calculators. It can send/receive data and backups, make a capture of the calculator screen and do remote control. + +<sect1>Wearable Computing +<p> +Also related to this topic but not covered yet seems wearable computing, see <url url="http://lcs.www.media.mit.edu/projects/wearables/" name="http://lcs.www.media.mit.edu/projects/wearables/"> , the page of Lionel, &dquot;trollhunter&dquot; Bouchpan-Lerust-Juery, <url url="http://infonomade.linuxfr.org/indexen.html" name="http://infonomade.linuxfr.org/indexen.html"> for further information and <url url="http://wearables.blu.org" name="http://wearables.blu.org"> and <url url="http://www.wearcomp.org/" name="http://www.wearcomp.org/">. +<p> +<url url="http://wearables.essex.ac.uk/sulawesi/" name="Sulawesi"> was developed due to the problems running a desktop GUI on a wearable computer. It has been designed and implemented to tackle what has been considered to be important challenges in a wearable user interface, the ability to accept input from any number of input devices, such as machine vision, speech recognition, portable keyboards, GPS devices, infra-red, etc. and to allow services to manipulate the information and generate a suitable output such as speech generation, graphics using a headmounted display, vibrotactile stimuli, etc. The <it>Gili</it> user interface has been updated, more documentation has been added, and the <it>Spatial Reminder</it> has been introduced. + +<sect1>Watches +<p> +The <url url="http://datalink.fries.net/" name="datalink library"> allows sending information to the Timex DataLink watches. The original datalink library supports the model 150 and possibly the model 70 watch. This version has been extended to work with the DataLink Ironman Triathlon watch. It has been tested with the SVGA output on the Ironman watch only, other output devices and other watches may or may not work, I have no reports either way. The display must be a CRT display (not a LCD). + +<sect>Accessories +<p> +<sect1>PCMCIA Cards +<p> +<sect2>Card Families +<p> + +<enum> + +<item> +Ethernet adapter</item> + +<item> +Token Ring adapter</item> + +<item> +Ethernet + Modem / GSM</item> + +<item> +Fax-Modem / GSM adapter</item> + +<item> +SCSI adapter</item> + +<item> +I/O cards: RS232, LPT, RS422, RS485, GamePort, IrDA, Radio, Video</item> + +<item> +Memory cards</item> + +<item> +harddisks</item> + +<item> +2.5&dquot; harddisk adapters</item> + +</enum> + +For desktops there are PCMCIA slots for ISA and PCI bus available. + +Source: <url url="http://www.lapshop.de" name="http://www.lapshop.de"> + +<sect2>Linux Compatibility Check +<p> +With the command <tt>cardctl ident</tt> you may get information about your card. Put this information into <file>/etc/pcmcia/config.opts</file> if necessary. But this may not be enough to get the card to work, but works sometimes for no-name network cards or modem cards. If you get a card to work or have written a new driver please don't forget to announce this to <url url="http://pcmcia.sourceforge.org" name="the developer of the PCMCIA-CS package David Hinds"> . Look the current issue of his file <url url=" http://pcmcia.sourceforge.org" name="SUPPORTED.CARDS"> to get information about supported cards. +<p> +Since there are not all cards mentioned I have set up a page <url url="http://tuxmobil.org/" name="PCMCIA Cards &dquot;Unofficially&dquot; Supported by Linux"> . + +<sect1>SmartCards +<p> +SmartCard reader, see Project Muscle - <url url="http://www.linuxnet.com/smartcard/index.html" name="Movement for the Use of Smart Cards in a Linux Environment"> + +<sect1>Memory Technology Devices - RAM and Flash Cards +<p> +<url url="http://www.linux-mtd.infradead.org/" name="The Linux Memory Technology Device"> project aims to provide a unified subsystem for handling RAM and Flash cards (Memory Technology Devices). It is intended to be compatible with the Linux PCMCIA code, to prevent duplication of code and effort, yet its main target is small embedded systems, so it will be possible to compile the drivers into the kernel for use as a root filesystem, and a close eye will be kept on the memory footprint. + +<sect1>Printers +<p> +Survey about small mobile printers: + +<enum> + +<item> +CANON: BJC-80, for infrared connections to this printer see the links at my page about <url url="http://tuxmobil.org/ir_misc.html" name="Linux and Infrared Devices"></item> + +<item> +CANON: BJ-30</item> + +<item> +HP: DeskJet 340Cbi. This is a small, portable, low-duty-cycle printer. It prints either black, or color (3 color). I have had some problems with it loading paper. Overall, the small size and portability make it a nice unit for use with laptops. I use the HP 500/500C driver with Linux. </item> + +<item> +Olivetti: JP-90</item> + +</enum> + +AFAIK only the HP and the BJC-80 machine have an infrared port. Pay attention to the supplied voltage of the power supply if you plan to travel abroad. Source: <url url="http://www.lapshop.de" name="http://www.lapshop.de"> + +<sect1>Power and Phone Plugs, Power Supply +<p> +When travelling abroad you might consider to take a set of different power and phone plugs with you. Also, it's useful if you can change the input voltage of the power supply, for instance from 110V in the US to 220V in Germany. There also power supplies for 12V batteries from cars. + +Some models of power plugs: +<code> + ____ + / () \ _ _ _ +frontal view: |() ()| (_)=(_) (_) N.N. + ------ + +abbrevation.: C13 C8 ?? PS/2 + +symbol......: ?? ?? -O)- N.N. +</code> +Caveats: Though some -O)- plug may seem to be compatible to your laptop, because of the according physical size, take extremely care it uses the same plus-minus voltage scheme, for instance plus for the inner ring and minus for the outer one. Often but not always there are the according symbols near the plug. + +<sect1>Bags and Suitcases +<p> +You probably wonder, why I include this topic here. But shortly after using my COMPAQ Armada 1592DT I recognized that the rear side of the machine (where the ports are arranged) was slightly damaged. Though I have taken much care when transporting the laptop, this was caused by putting the bag on the floor. It seems that the laptop has so much weight, that it bounces inside the bag on its own rear side. So I decided to put a soft pad into the bag before loading the laptop. A good bag is highly recommended if you take your laptop on trips, or take it home every night. +<p> +Laptops computers are frequently demolished in their carrying bag. +The two main causes of demolition are poking the LC display and +banging the edges.A good case has very stiff sides to spread out +pokes, and lots of energy-absorbent padding around the edges to help +when you whack it on the door jamb.Few cases actually have either +of these features. +<p> +More laptops are lost to theft than damage, so camouflage is a wise too. +Emerson, Tom # El Monte <TOMEMERSON@ms.globalpay.com> wrote: &dquot;I use for a laptop <it>travelling bag</it>: a Pyrex <it>casserole carrier</it> bag. Yup, you might think it <it>odd</it> to use a casserole bag for a laptop, but it turns out it has several advantages: + +<itemize> + +<item> +The one I use has a microwavable heating pad in it -- while I don't actually heat this pad (it's meant to keep food warm while in transport), it does provide padding underneath the laptop. The carrier I have only has a lower - heating - pad, but there is also a similar carrier that has both a lower - heating - pad and an upper - cooling - pad - placed in the freezer to get it cold - -- the intent is that you keep one or the other in the bag to keep your food hot or cold as desired. A secondary advantage to the - cooling pad - pad is that if you've - chilled - it before taking the computer out for the day, it will keep the CPU cooler while you're running the laptop... + +<item> +the top of the bag has a zipper on three sides, so it - opens - the same way as my laptop -- I don't even need to take it out of the carrier to use the laptop + +<item> +there is enough room at the side of the bag to store the external power supply, a regular Logitech mouseman, and the network - dongle - with BNC/TP ports - and if I had it, the modem/phone port as well - + +<item> +there is enough clearance on top of the machine to include a handful of CD's or diskettes, if needed... + +<item> +when it's left - unattended - in a car, it's less likely to be stolen -- think about it, if you were a thief walking through a parking lot and eyeing the contents of cars, a - laptop bag - is instantly recognizable as holding a laptop computer -- something that can be fenced at a pretty hefty profit, but if you saw a casserole carrier in the front seat of a car, would you think it contained anything OTHER than a casserole? - and probably half-eaten, at that... - Unless you are a hungry thief, chances are you'll skip this and move on... + +<item> +likewise, I've heard that keeping a laptop computer in a diaper bag is another good - camouflage - technique -- who in their right mind is going to steal a bag of - dirty - diapers?&dquot; + +</itemize> + +<sect>Different Environments - On the Road +<p> +<sect1>Related HOWTOs +<p> + +<enum> + +<item> +Security-HOWTO</item> + +<item> +Multiboot-with-LILO-mini-HOWTO</item> + +<item> +Ethernet-HOWTO</item> + +<item> +NET-3-HOWTO</item> + +<item> +Offline-Mailing-mini-HOWTO</item> + +<item> +Plip-mini-HOWTO</item> + +<item> +Slip-PPP-Emulator-mini-HOWTO</item> + +</enum> + +<sect1>Configuration Tools +<p> +<sect2>NetEnv +<p> +Do you use your laptop in different network environments? At home? In the office? At a customers site? + +If yes, the small package &dquot;netenv&dquot; might be useful for you. When booting your laptop it provides you with a simple interface from which you can choose the current network environment. The first time in a new environment, you can enter the basic data and save it for later reuse. + +Netenv sets up a file containing variable assignments which describe the current environment. This can be used by the PCMCIA setup scheme, e.g. like the one that comes with Debian/GNU Linux and perhaps others. + +The netenv data can be used for things like: + +<enum> + +<item> +Network Device: Configure the network device for different environments.</item> + +<item> +Choose a proper <file>XF86Config</file>: Think of using your laptop standalone with touchpad vs. connected to a CRT monitor along with an external mouse. For example, a wheel mouse could be used when docked, but the driver is not compatible with the normal trackpoint or touchpad.</item> + +<item> +Windowmanager: You can set up your windowmanager according to the current location of your machine.</item> + +<item> +Printing Environment: The netenv data can easily be used to set up the printing environment.</item> + +</enum> + +Netenv is available as Debian/GNU Linux package as well as tarball. It depends on <tt>dialog(1)</tt> for the menu system. It is developed by Gerd Bavendiek <htmlurl url="mailto:bav@rw.sni.de" name="bav@rw.sni.de"> you may get it at <url url="http://www.uni-bielefeld.de/~portgym/net/netenv.html" name="http://www.uni-bielefeld.de/~portgym/net/netenv.html"> . + +<sect2>divine +<p> +<url url="http://www.fefe.de/divine/" name="divine"> is an utility for people who use their machines in different networks all the time. &dquot;The idea is this: + +<itemize> + +<item> +you describe the possible networks in /etc/divine.conf, including one or more machines that are probably up (routers and NIS servers come to mind). + +<item> +at boot time, you run divine. + +<item> +<tt>divine</tt> starts a thread that injects fake arp requests into the network. The thread will try again up to three times, pausing 1 second between retries. If the last try times out again, the thread will print an error message, leave the interface in the original state and exit cleanly. + +<item> +the main thread just looks for arp replies and exits if one is found. + +<item> +You have one resolv.conf per network, for example <file>/etc/resolv.conf.default</file> and <file>/etc/resolv.conf.work</file>, and <tt>divine</tt> will symlink one of them to <file>/etc/resolv.conf</file> for you. + +<item> +You can specify a proxy server plus port and divine will write the proxy server to <file>/etc/proxy</file>. This can be evaluated inside your shell startup script, like this (<tt>zsh</tt>): + +<code> +export http_proxy="http://`</etc/proxy`/" +</code> +The included perl script edit-netscape-proxy.pl will edit the proxy settings in your Netscape 4 preferences file. + +<item> +You can even specify an additional script to be run for each selection. You can use this to edit <file>/etc/printcap</file> or <file>/etc/issue</file> or do something else I forgot. + +</itemize> + +<p> +The point about <tt>divine</tt> in contrast to other solutions is that other solutions normally use <tt>ping</tt> or something like that. <tt>divine</tt> can check a large number of networks instantaneously, assuming that the machines you ping answer within one second (.4 seconds are normal on Ethernets). And pinging an unknown address will do an arp request anyway, so why not do an arp request in the first place?&dquot; + +<sect2>Mobile IP +<p> +From the NET3-4-HOWTO: &dquot;The term <it>IP Mobility</it> describes the ability of a host that is able to move its network connection from one point on the Internet to another without changing its IP address or losing connectivity. Usually when an IP host changes its point of connectivity it must also change its IP address. IP Mobility overcomes this problem by allocating a fixed IP address to the mobile host and using IP encapsulation (tunneling) with automatic routing to ensure that datagrams destined for it are routed to the actual IP address it is currently using.&dquot; +<p> +<url url="http://www.cs.hut.fi/Research/Dynamics/Dynamics" name="HUT Mobile IP"> is a dynamical, hierarchical Mobile IP system for Linux operating system. The implementation enables a hierarchical model for IP mobility, thus decreasing the location update times as a mobile host moves. Dynamics system has been designed Wireless LAN technology in mind, and the system has optimized functionality for mobility in WLAN. There is now a mailing list available. You can join it by sending <it>subscribe</it> on the subject line to <dynamics-user-request@cs.hut.fi> - or you can simply check the <url url="http://www.cs.hut.fi/Research/Dynamics/mail/user" name=" mail archive">. + +<sect3>Resources +<p> + +<enum> +<item> +<url url="http://anchor.cs.binghamton.edu/~mobileip/" name="Linux Mobile-IP"> + +<item> +<url url="http://hplbwww.hpl.hp.com/people/jt/MobileIP/index.html" name="Linux Mobile IP from HP Labs Bristol by Manuel Rodríguez"> + +<item> +<url url="http://mosquitonet.Stanford.EDU/software/mip.html" name="MosquitoNet Mobile IP"> + +<item> +<url url="http://mip.ee.nus.sg/" name="Mobile IP at NUS"> + +<item> +<url url="http://anchor.cs.binghamton.edu/~mobileip/" name="Linux Mobile-IP"> + +<item> +<url url="http://http.cs.berkeley.edu/~randy/Daedalus/BARWAN/" name="Bay Area Research Wireless Access Network (BARWAN)"> + +</enum> + +Sources: Kenneth E. Harker and Dag Brattli + +<sect2>DHCP/BootP +<p> +DHCP and BootP are also useful for working in different environments. Please see the DHCP-HOWTO and BootP-HOWTO. + +<sect2>PPPD Options +<p> +The <tt>pppd</tt> command can be configured via several different files: <tt>pppd file /etc/ppp/<your_options></tt> . + +<sect2>/etc/init.d +<p> +You may even choose to do your configuration by editing the <file>/etc/init.d</file> files manually. + +<sect2>PCMCIA - Schemes +<p> +How can I have separate PCMCIA device setups for home and work? This is fairly easy using PCMCIA <it>scheme</it> support. Use two configuration schemes, called <tt>home</tt> and <tt>work</tt>. For details please read the according chapter in the PCMCIA-HOWTO by David Hinds. + +<sect2>Bootloaders +<p> +<sect3>LILO +<p> +From <url url="http://www.mjedev.demon.co.uk/index.html" name="http://www.mjedev.demon.co.uk/index.html"> <Martin J. Evans martin@mjedev.demon.co.uk> I have taken this recommendation: The first point to note is that <tt>init</tt> will take any arguments of the form <tt>name=value</tt> as environment variable assignments if they are not recognized as something else. This means you can set environment variables from the LILO boot prompt before your rc scripts run. I set the <tt>LOCATION</tt> environment variable depending on where I am when I boot Linux. e.g. +<code>LILO: linux LOCATION=home</code> +Or +<code>LILO: linux LOCATION=work</code> +Or simply +<code>LILO: linux</code> +where failing to set <tt>LOCATION</tt> means the same as <tt>LOCATION=home</tt> (i.e. my default). Instead of typing <tt>LOCATION=place</tt> each time you boot you can add an entry to your <file>/etc/lilo.conf</file> file and use the append instruction. e.g. +<code> +# Linux bootable partition for booting Linux at home +# +image = /vmlinuz +root = /dev/hda3 +label = linux +read-only +# Linux bootable partition config ends +# +# Linux bootable partition for booting Linux at work +# +image = /vmlinuz +root = /dev/hda3 +label = work +read-only +append=&dquot;LOCATION=work&dquot; +# Linux bootable partition config ends +</code> +With the example above you can use &dquot;linux&dquot; for booting at home and &dquot;work&dquot; for booting at work. + +Armed with the facility above, you can now edit the relevant rc scripts to test ENVIRONMENT before running <tt>ifconfig</tt>, setting up <tt>route</tt> etc. + +<sect3>Other Bootloaders +<p> +There are several other bootloaders which are often overlooked. Besides LILO, have a look at loadlin, CHooseOS (CHOS) (not GPL), GRand Unified Bootloader (GRUB), System Commander and take a look at <url url="ftp://metalab.unc.edu/pub/Linux/system/boot/loaders/" name="ftp://metalab.unc.edu/pub/Linux/system/boot/loaders/">. The NT boot loader or OS/2 boot loader may even be used. + +<sect2>X-Windows +<p> +From Steve <steve@cygnet.co.uk> I got a configuration for X windows with an external monitor: Note that I have introduced a neat trick! For my nice 17&dquot; monitor I start X with no options and get the default 16-bit 1152x864 display - but when using the LCD screen I specify a 15-bit display (<tt>startx -- -bpp 15</tt>) and get the correct 800x600 resolution automatically. This saves having to have two XConfig files. + +<sect2>E-Mail +<p> +A short introduction about how to setup email on a laptop used at home (dial-up) and work (ethernet) by Peter Englmaier <ppe@pa.uky.edu>: + +<sect3>Features +<p> +As a laptop user, I have special demands for my email setup. The setup described below, enables me to: + +<itemize> + +<item> +Read my email from <it>home</it> using a POP email server, which is supplied by my university, but could also be setup on a <it>work</it> place computer.</item> + +<item> +Write email from home with the <it>right</it> return address in the email (which does not mention my computer name).</item> + +<item> +Read/write my email while working on a workstation without access to my laptop or the POP email server (as a backup).</item> + +<item> +Read my email while working on my laptop connected to the ethernet of our institut.</item> + +<item> +Direct email while connected via ethernet (faster than the fetchmail method).</item> + +<item> +Indirect email (over pop mail server) while not connected to the ethernet at work (either at home via modem or somewhere else via ethernet).</item> + +<item> +Use any emailer, e.g. <tt>elm</tt> or the simple <tt>mail</tt> command.</item> + +<item> +Sort incomming email, delete spam, split email-collections (digests) into seperate emails</item> + +</itemize> + +The configuration is based on <tt>sendmail</tt>, <tt>fetchmail</tt>, and a <it>remote pop account</it> for email. + +<sect3>Configuration of sendmail +<p> +This is the most complicated part. Having installed the <tt>sendmail-cf</tt> package, I created a file named <file>/usr/lib/sendmail-cf/laptop.mc</file>: + +<code> +divert(-1) +include(`../m4/cf.m4') +define(`confDEF_USER_ID',''8:12'') +define(`confBIND_OPTS',`-DNSRCH -DEFNAMES') +define(`confDOMAIN_NAME',''pa.uky.edu'') <---- here you define your domain +OSTYPE(`linux') +undefine(`UUCP_RELAY') +undefine(`BITNET_RELAY') +define(`SMART_HOST',`server1.pa.uky.edu') <---- there we send outgoing email +define(`LUSER_RELAY',`server1.pa.uky.edu') <---- there we send mail to users my laptop does not know +MASQUERADE_AS(pa.uky.edu) <---- again the domain, we want to be seen as +FEATURE(allmasquerade) +FEATURE(nouucp) +FEATURE(nodns) +FEATURE(nocanonify) +FEATURE(redirect) +FEATURE(always_add_domain) +FEATURE(use_cw_file) +FEATURE(local_procmail) +MAILER(procmail) +MAILER(smtp) +HACK(check_mail3,`hash -a@JUNK /etc/mail/deny') +HACK(use_ip,`/etc/mail/ip_allow') +HACK(use_names,`/etc/mail/name_allow') +HACK(use_relayto,`/etc/mail/relay_allow') +HACK(check_rcpt4) +HACK(check_relay3) +</code> + +This looks more complicated as it is. All it does is, that it redirectes outbound mail to server1 (SMART_HOST) and also mail for local users which are not known (LUSER_RELAY). That way, I can write email to my colleques without using their full email address. More important: the From line in my email points back to my MASQUARADE_AS domain and not directly to my laptop. If this where not the case, email returned with the <it>reply</it> button might not reach me. You must restart <tt>sendmail</tt> for changes to take effect. Note: this configuration is for Redhat 5.2 systems. You may have to change some details. + +Now, all what is needed is to generate the <file>/etc/sendmail.cf </file>file <tt>m4 laptop.mc >/etc/sendmail.cf</tt> and to add all possible domain names my laptop should respond to in <file>/etc/sendmail.cw</file>: + +<code> +# sendmail.cw - include all aliases for your machine here. +laptop +laptop.pa.uky.edu +128.17.18.30 +guest1 +guest1.somewhere.org +</code> + +It is important to have all aliases in this file, otherwise <tt>sendmail</tt> will not accept the mail (and will reply <it>we don't relay</it> to the sender). Finally, you must now test the setup by sending email, replying to mail for all possible configurations. Any missconfiguration can result in loss of email. + +<sect3>Configuration for fetchmail on Laptop +<p> +One method to get the email into your machine is through <tt>fetchmail</tt>. Fetchmail periodically checks for new email at one or more remote mail servers. I use the following fetchmail configuration file (in my user home directory): +<file>fetchmailrc</file> + +<code> +set postmaster &dquot;myusername&dquot; +set daemon 900 +poll pop.uky.edu with proto POP3 + user &dquot;mypopusername&dquot; there with password &dquot;mypoppassword&dquot; is mylaptopusername here +</code> + +Fetchmail will just get the the email and send it to <tt>sendmail</tt> which will it deliver into your <file>/var/spool/mail/$USER</file> file. + +<sect3>Forward E-Mail to the Laptop +<p> +On my work station I have the following <file>.forward</file> file: + +<code> +me@pop.acount.edu,me@server1 +</code> + +Here server1 is the machine where I keep my mailbox. All email is send to the pop account to be picked up later by my laptop (using <tt>fetchmail</tt>). However, when my laptop is connected via ethernet, I want my email to go directly to the laptop, instead of pop: + +<code> +me@laptop,me@server1 +</code> + +In both cases, a backup of my email is send to server1 (where I also can read it, in case I cannot get my laptop). I keep/store all email on the laptop. +<p> +Switching is done by three script files and a crontab file (on the workstation): + +<file>forward_pop</file> + +<code> +#!/bin/sh +echo &dquot;me@pop.acount.edu,me@server1&dquot; > ${HOME}/.forward +</code> + +<file>forward_laptop</file> + +<code> +#!/bin/sh +echo &dquot;ppe@laptop,ppe@server1&dquot; > ${HOME}/.forward +crontab ${HOME}/mycrontab +${HOME}/utl/check_laptop +</code> + +<file>check_laptop</file> + +<code> +#!/bin/sh +if /usr/sbin/ping -c 1 laptop >/dev/null 2>&1 ; then + : +else + # redirect mail to pop + ${HOME}/utl/forward_pop + sleep 10 + if /usr/sbin/ping -c 1 laptop >/dev/null 2>&1 ; then + # back to normal + ${HOME}/utl/forward_laptop + else + # deactivate crontab check + /bin/crontab -l | grep -v check_laptop >${HOME}/tmp/mycrontab.tmp + /bin/crontab ${HOME}/tmp/mycrontab.tmp + rm -f ${HOME}/tmp/mycrontab.tmp + fi +fi +</code> + +<file>mycrontab</file> + +<code> +# mycrontab +0,10,20,30,40,50 * * * * ${HOME}/utl/check_laptop +</code> + +Each time I connect the laptop to the ethernet, I have to run <tt>forward_laptop</tt>, and each time I disconnect I run forward_pop. In case I forget to run <tt>forward_pop</tt>, the crontab job runs it for me less then 10 minutes later. To do all that automatically, I change the network script files on my laptop as follows: + +<file>/sbin/ifdown</file> (this script runs, whenever a network device is stopped, new stuff between BEGIN and END) + +<code> +... +fi + +# BEGIN new stuff +# turn off forwarding email +mail ppe <<EOF +turning off forwarding email +device = ${DEVICE} +hostname = `hostname` +EOF +if [ &dquot;${DEVICE}&dquot; = &dquot;eth0&dquot; -a &dquot;`hostname`&dquot; += &dquot;laptop&dquot; ]; then + su -lc &dquot;ssh -l myusername server1 +utl/forward_pop&dquot; myusername >& /dev/null +fi +# END new stuff + +ifconfig ${DEVICE} down +exec /etc/sysconfig/network-scripts/ifdown-post $CONFIG +</code> + +Note, that the script checks for the value of hostname. In case, I am connected to a foreign ethernet, my hostname and ip-address will be something else, e.g. guest1. + +<file>/etc/sysconfig/network-scripts/ifup-post</file> (this script is run, whenever a network device is started) + +<code> +# Notify programs that have requested notification +do_netreport + +# BEGIN new stuff +# check for email -- I'm using fetchmail for this +if [ &dquot;${DEVICE}&dquot; = &dquot;eth0&dquot; -o &dquot;${DEVICE}&dquot; += &dquot;ppp0&dquot; ]; then + su -lc fetchmail myusername >& /dev/null & +fi + +# set clock if connected to ethernet, redirect email +if [ &dquot;${DEVICE}&dquot; = &dquot;eth0&dquot; -a dquot;`hostname`&dquot; = &dquot;zaphod&dquot; ]; then + ( rdate -s server1 ; hwclock --systohc --utc ) >& /dev/null & + # forward email + su -lc &dquot;ssh -l myusername gradj utl/forward_laptop&dquot; myusername >& /dev/null & +fi +# END new stuff + +exit 0 +</code> + +<sect3>Processing Incomming E-Mail with procmail +<p> +This step is completely optional. The above described sendmail configuration calls <tt>procmail</tt> for each received email, but you could have called <tt>procmail</tt> using the <tt>.forward</tt> file (see the procmail man page). Procmail is a handy tool to block spam and to sort incomming email. + +You need to setup a <tt>.procmailrc</tt> file to use <tt>procmail</tt>. See the man page for procmail, procmailrc, and procmailex (examples). My setup demonstrates, how to ignore certain email messages and split email-collections (digest) into pieces: + +<code> +# -- mail filtering -- procmail is called by sendmail -- +PATH=/bin:/usr/bin +MAILDIR=$HOME/Mail +LOGFILE=$MAILDIR/from +# keep in mind: +# use &dquot;:0:&dquot; when writing to a file +# use &dquot;:0&dquot; when writing to a device, e.g. /dev/null, or send email + +# - make first a backup of *all* incomming email (but ignore mail tagged below) - +:0 c: +*! ˆSissa-Repro +backup + +# - keep only last 50 messages +:0 ic +| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,50d` + +# - delete email comming through the 'postdocs' email list, when +# it is not of any interest +:0 +* ˆFrom.*postdocs +* ˆFrom.*Ernst Richter +/dev/null +:0 +* ˆFrom.*postdocs +* ˆSubject.*card charge +/dev/null + +# Split mailing list from the sissa preprint server into individual emails +# - this is quite complicated :( I can flip through the list much +# faster and ignore preprints which have uninteresting titles. Instead of +# having to browse through the whole list, my mailer will just present a +# list of papers. +# 1. split it in individual messages +:0 +* ˆFrom no-reply@xxx.lanl.gov +| formail +1 -de -A &dquot;Sissa-Repro: true&dquot; -s procmail + +# 2. reformat messages a bit +# 2.1. extract 'Title:' from email-Body and add to email-header +as 'Subject:' +:0 b +* ˆSissa-Repro +*! ˆSubject +TITLE=| formail -xTitle: +:0 a +|formail -A &dquot;Subject: $TITLE &dquot; -s procmail + +# 2.2. store in my incomming sissa-email folder. Here, we could +# also reject (and thereafter delete) uninteresting 'Subjects' +# we could also mark more interesting subjects as urgend or send a copy +# to regular mail box. +:0: +* ˆSissa-Repro +* ˆSubject +*! ˆreplaced with +sissa +</code> + +BTW, there is a <tt>tk</tt> GUI tool to configure <tt>procmail</tt> (I think it is called <tt>dotfiles</tt>). + +<sect2>Email with UUCP +<p> +Another possible solution for Email is to use UUCP. This software +was made for disconnected machines, and is by far the easiest solution +if you have several users on your laptop (we are talking about Unix, +remember?), each with his/her own account. + +Unlike what most people think, UUCP does not need a serial +connection: it works fine over TCP/IP, so your UUCP partner can be any +machine on the Internet, if it is reachable from your network +attachment point. Here is the UUCP <file>sys</file> for a typical laptop: + +<tscreen> +<verb> +system mylaptop +time any +chat &dquot;&dquot; \d\d\r\c ogin: \d\L word: \P +address uucp.mypartner.org +port TCP +</verb> +</tscreen> + +<sect2>More Info +<p> +<url url="http://www.ssc.com/lg/issue20/laptop.html" name="Using a Laptop in Different Environments"> by <htmlurl url="mailto:bav@rw.sni.de" name="Gerd Bavendiek"> . This article appeared in the August, 1997 issue of the <url url="http://www.ssc.com/lg/" name="Linux Gazette">. This is an excellent, short technical article describing an easy way to setup your Linux notebook to boot into different network and printing configurations, especially useful for those who use their machines at home as well as other locations such as in the office, at school, or at a customer site. + +<sect1>Data Transport Between Different Machines +<p> +I don't have experience with this topic yet. So just a survey about some means of data transport and maintaining data consistency between different machines. + +<sect2>Hardware +<p> + +<enum> + +<item> +external harddisks</item> + +<item> +ZIP drive</item> + +</enum> + +Wade Hampton wrote: &dquot;You may use MS-DOS formatted ZIP and floppy discs for data transfer. You may be able to also use LS120. If you have SCSI, you could use JAZ, MO or possibly DVD-RAM (any SCSI disc that you could write to). I have the internal ZIP for my Toshiba 700CT. It works great (I use <tt>automount</tt> to mount it). I use VFAT on the ZIP disks so I can move them to Windows boxes, Linux boxes, NT, give them to coworkers, etc. One problem, I must SHUTDOWN to swap the internal CD with the ZIP.&dquot; + +<sect2>Software +<p> +<sect3>Version Management Software +<p> +Although it is certainly not their main aim, version management +software like CVS (Concurrent Version System) are a perfect tool when +you work on several machines and you have trouble keeping them in sync +(something which is often called "disconnected filesystems" in the +computer science literature). Unlike programs like rsync, which are +assymetric (one side is the master and its files override those of the +slave), CVS accept that you make changes on several machines, and try +afterwards to merge them. Assymetric tools are good only when you can +respect a strict discipline, when you switch from one machine to +another. On the contrary, tools like CVS are more forgetful. + +To synchronize two or more machines (typically a desktop and a +laptop), just choose a CVS repository somewhere on the network. It can +be on one of the machines you want to synchronize or on a third +host. Anyway, this machine should be easily reachable via the network +and have good disks. + +Then, <tt>cvs co</tt> the module you want to work on, edit it, and +<tt>cvs commit</tt> when you reached a synch point and are +connected. If you made changes on both hosts, CVS will try to merge +them (it typically succeeds automatically) or give in and ask you to +resolve it by hand. + +The typical limits of this solution: CVS does not deal well with +binary files, so this solution is more for users of vi or emacs than +for GIMP fans. CVS has trouble with some Unix goodies like symbolic +links. + +For more information on CVS, see the <htmlurl name="Web page" +url="http://www.loria.fr/~molli/cvs-index.html">. The CVS +documentation is excellent (in info format). + +<sect3>CODA Filesystem +<p> +The Coda File System is a descendant of the Andrew File System. Like AFS, Coda offers location-transparent access to a shared Unix file name-space that is mapped on to a collection of dedicated file servers. But Coda represents a substantial improvement over AFS because it offers considerably higher availability in the face of server and network failures. The improvement in availability is achieved using the complementary techniques of server replication and disconnected operation. Disconnected operation proven especially valuable in supporting portable computers <url url="http://www.coda.cs.cmu.edu/" name=" http://www.coda.cs.cmu.edu/"> . + +<sect3>WWWsync +<p> +This is a program written in Perl that will update your web pages by ftp from your local pages. This was originally written for updating Demon home-pages, but will work with other providers which provide direct FTP access to your web pages. I didn't check this for laptop purposes yet. You may get the program at <url url="http://www.alfie.demon.co.uk/wwwsync/" name="http://www.alfie.demon.co.uk/wwwsync/"> . + +<sect3>rsync +<p> +<tt>rsync</tt> is a program that allows files to be copied to and from remote machines in much the same way as <tt>rcp</tt>. It has many more options than <tt>rcp</tt>, and uses the <it>rsync remote-update protocol</it> to greatly speedup file transfers when the destination file already exists. The <it>rsync remote-update protocol</it> allows <tt>rsync</tt> to transfer just the differences between two sets of files across the network link. + +<sect3>Xfiles - file tree synchronization and cross-validation +<p> +Xfiles is an interactive utility for comparing and merging one file tree with another over a network. It supports freeform work on several machines (no need to keep track of what files are changed on which machine). Xfiles can also be used as a cross-validating disk <-gt; disk backup strategy (portions of a disk may go bad at any time, with no simple indication of which files were affected. Cross-validate against a second disk before backup to make sure you aren't backing up bad data). + +A client/server program (GUI on the client) traverses a file tree and reports any files that are missing on the server machine, missing on the client machine, or different. For each such file, the file size/sizes and modification date(s) are shown, and a comparison (using Unix diff) can be obtained. For files that are missing from one tree, <it>similarly named</it> files in that tree are reported. Inconsistent files can then be copied in either direction or deleted on either machine. The file trees do not need to be accessible via nfs. Files checksums are computed in parallel, so largely similar trees can be compared over a slow network link. The client and server processes can also be run on the same machine. File selection and interaction with a revision control system such as RCS can be handled by scripting using jpython. Requirements Java1.1 or later and JFC/Swing1.1 are needed. <url url="http://www.idiom.com/~zilla" name="Xfiles">. + +<sect3>sitecopy +<p> +Sitecopy is for copying locally stored websites to remote web servers. The program will upload files to the server which have changed locally, and delete files from the server which have been removed locally, to keep the remote site synchronized with the local site, with a single command. The aim is to remove the hassle of uploading and deleting individual files using an FTP client. <url url="http://www.lyra.org/sitecopy" name="sitecopy"> . + +<sect3>KBriefcase +<p> +The KDE tool <url url="http://netnow.micron.net/~mrolig/kbriefcase/" name="Kbriefcase"> tries to achieve a similar goal as the Windows briefcase, +but in a different way. Rather than pulling your files from the +desktop, they are pushed to the laptop. You drag a file from the local +location to the briefcase. You are then asked for the remote path to +copy it to. It will then copy the file to the remote location and make +the original read-only. When you restore and remove, the file is copied +back and write permissions are given back. The read-only status, of +course, makes sure you don't start editing the file again before you've +brought your changes back from the remote location. + +<sect1>Security in Different Environments +<p> +<sect2>Introduction +<p> +I am not a computer security expert. Please read the Security-HOWTO for more information. I just collected some information below. Note, these means are just small steps to additional security, though I recommend that you use them. + +<p> +LASG Please read <url url="https://www.seifried.org/lasg/" name="Linux Administrator's Security Guide (LASG) - FAQ"> by Kurt Seifried. + +<sect2>Means of Security +<p> + +<enum> + +<item> +International Kernel Patch: The idea of the <url url="http://www.kerneli.org/" name="International Kernel Patch"> is to collect all crypto patches so that using crypto in the kernel will be easier than today. The patch includes a number of crypto patches including a crypto API including Blowfish, CAST-128, DES, DFC, IDEA, MARS, RC6, Rijndael, Safer, Serpent, and Twofish, an encrypted filesystem loopback device using the crypto API, CIPE VPN and EnSKIP patches. + +<item> +Kennsington Lock: AFAIK proprietary lock solution with different laptops <url url="http://www.kennsington.com" name="http://www.kennsington.com "> </item> + +<item> +SmartCards: by DESKO <url url="http://www.desko.de" name=" http://www.desko.de "> are not available for Linux yet. The only available laptop with a SmartCard builtin is the Siemens Scenic Mobile 800.</item> + +<item> +User passwords: can be easily bypassed if the intruder gets physical access to your machine</item> + +<item> +BIOS passwords: are also easily crackable, though sometimes harder than with desktops</item> + +<item> +Name plates: to reduce the possibility of theft, you may want to have a nameplate made and affixed to the cover of the laptop. A nice one will cost you about $12, and can be made by any good trophy shop. They'll glue it on for you too. You could use double-sided tape instead, but glue is more permanent. You may even make an engravement into the laptop cover.</item> + +<item> +Boot loader: a boot loader may be used to put your name and phone number (or whatever text you choose) into the boot sequence before the operating system is loaded. This provides a label that can't be removed by editing files or even doing a simple format of the harddisk.</item> + +<item> +Antivirus policy: I have seen an <tt>antivir</tt> RPM somewhere. Check the BIOS for an option to disable writing at the boot sector.</item> + +<item> +Database of stolen laptops: I have provided a <url url="http://tuxmobil.org/stolen_laptops.html" name="survey of databases for stolen laptops">. + +<item> +Laptop as a security risk itself: Since a laptop can easily be used to intrude a network, it seems a good policy to ask the system administrator for permission before connecting a laptop to a network. + +<item> +Secure Protocol: When connecting to a remote server always use a secure protocol.</item> + +</enum> + +<sect1>Dealing with Down Times (Cron Jobs) +<p> +A cron-like program that doesn't go by time: <tt>anacron</tt> (like &dquot;anac(h)ronistic&dquot;) is a periodic command scheduler. It executes commands at intervals specified in days. Unlike <tt>cron</tt>, it does not assume that the system is running continuously. It can therefore be used to control the execution of daily, weekly and monthly jobs (or anything with a period of n days), on systems that don't run 24 hours a day. When installed and configured properly, <tt>anacron</tt> will make sure that the commands are run at the specified intervals as closely as machine-uptime permits. +<p> +<tt>hc-cron</tt> This program is a modified version of Paul Vixie's <paul@vixie.com> widely used <tt>cron</tt> daemon. Like the original program it runs specified jobs at periodic intervals. However, the original <tt>crond</tt> relies on the computer running continuously, otherwise jobs will be missed. This problem is addressed by <tt>hc-cron</tt>, that is indended for use on <it>home-computers</it> that are typically turned off several times a day; <tt>hc-cron</tt> will remember the time when it was shut down and catch up jobs that have occurred during down time when it is started again. Felix Braun <fbraun@atdot.org> is the author of the programm, it is available at <url url="http://metalab.unc.edu /pub/Linux/system/daemons/cron" name="http://metalab.unc.edu /pub/Linux/system/daemons/cron"> . + +<sect1>Noise Reduction +<p> +Due to the proliferation of cellular phones and walkmans it's not quite common in our days to take care of a quiet environment. Anyway I want to give some recommendations for the polite ones. + +<sect2>Console (Shell) and X +<p> +For the console <tt>setterm -blength 0</tt> and for X <tt>xset b off</tt> turns the bell off. See also PCMCIA-HOWTO, and much more details in the Visible-Bell-mini-Howto by Alessandro Rubini. + +<sect2>PCMCIA +<p> +When starting your laptop with PCMCIA-CS configured correctly, this will be shown by two high beeps. If you want to avoid this put <tt>CARDMGR_OPTS=&dquot;-q&dquot;</tt> into the PCMCIA configuration file, e.g. <file>/etc/pcmcia.conf</file> for Debian/GNU Linux. +<p> +To avoid the dialtones during the modem dialing add + +<code> + module &dquot;serial_cs&dquot; opts &dquot;do_sound=0&dquot; +</code> + +to <file>/etc/pcmcia/config.opts</file> (from <tt>man serial_cs</tt>). This will disable speaker output completely, but the <tt>ATM</tt> command should let you selectively control when the speaker is active. + +<sect2>Miscellaneous Applications +<p> +You may configure <tt>vi</tt> with the <tt>flash</tt> option, so it will use a flash in case of an error, instead of a bell. +<p> +For at least one laptop series, the Toshiba models, there seems to be a Linux package available to control the fan and other features. + +<sect>Other Resources +<p> +Kenneth E. Harker maintains a quite valuable database at <url url="http://www.linux-on-laptops.com/ " name="http://www.linux-on-laptops.com/"> . Please have a look at his site to get current information about laptop related mailing lists, newsgroups, magazines and newsletters, WWW sites and a big database about many different laptop pages. +<p> +To join the <it>linux-laptop@tuxmobil.org</it> mailing list visit the subsription page at <url url="http://tuxmobil.org/mobilix_ml.html" name="http://tuxmobil.org/mobilix_ml.html">. There you may also find the list archiv. +<p> +To join the other <it>Linux-Laptop-Mailing-List</it> write a mail to <majordomo@vger.kernel.org> with <tt>subscribe linux-laptop</tt> in the subject. You will get a confirmation message than, which you have to reply accordingly. As far as I know there is no list archiv. +<p> +There is now a <it>debian-laptop mailing list</it>. Any questions or discussions concerning running the Debian/GNU Linux operating system(s) on laptops are welcome. Send mail to <debian-laptop-request@lists.debian.org> with a subject of <tt>subscribe</tt>. Or visit the<url url="http://www.debian.org" name="http://www.debian.org"> site and use the online form. +<p> +Also recently founded was <it>Running Linux on IBM ThinkPads</it>, to join send an email to <tt>linux-thinkpad-subscribe@topica.com</tt>, to post send mail to <tt>linux-thinkpad@topica.com</tt> . See <url url="http://www.topica.com/lists/linux-thinkpad/" name="http://www.topica.com/lists/linux-thinkpad/">. +<p> +Lionel, &dquot;trollhunter&dquot; Bouchpan-Lerust-Juery, <trollhunter@linuxfr.org> has written a similar HOWTO, please look at his laptop pages <url url="http://infonomade.linuxfr.org/index.html" name=" http://infonomade.linuxfr.org/index.html "> (French version) <url url="http://infonomade.linuxfr.org/indexen.html" name=" http://infonomade.linuxfr.org/indexen.html "> (English version). +<p> +Newsgroups are comp.os.linux.portable, comp.sys.laptops . + +<sect>Repairing the Hardware +<p> +There are several different reasons that could make it necessary to open the case of a laptop. + +<enum> + +<item> +repairing broken hardware</item> + +<item> +get some hardware info, which isn't available otherwise</item> + +<item> +remove the speakers (speakerrektomie, as described in Visual-Bell-mini-HOWTO)</item> + +<item> +install overdrive for CPU</item> + +<item> +change BIOS battery</item> + +<item> +upgrade harddisk</item> + +<item> +upgrade memory</item> + +</enum> + +Repairing a laptop can be quite expensive if you don't have a manufacturer's warranty. Sometimes professional support is bad. But opening a laptop case can be difficult. Often the procedures to upgrade the memory and the harddisk are described in the manual. For further details, you should try to get the maintainance/technical manual. Just be extremely careful and make notes as to where each screw goes. You must get most of them back in the right hole or you could ruin the machine by damaging the system board. Also after you get all the screws to an assembly out (some will be hidden) the parts are usually held together with plastic clips molded in, so you still must exercise care to separate them. Sometimes you need certain tools, for instance TORX screw drivers or a solder kit. Good luck. + +WARNING: Usually laptop manufacturers declare the warranty to be void if the case was opened by people other than their own staff. + +<sect>Solutions with Laptops +<p> +<sect1>Introduction +<p> +The power and capabilities of laptops are sometimes limited as described above. But in turn, they have a feature which desktops don't have, their mobility. I try to give a survey about applications which make sense in connection with laptops. Since I couldn't try all of them, there is currently little documentation. If you can provide further material, please contact me. + +<sect1>Mobile Network Analyzer +<p> +I'm not an expert in this field, so I just mention the tools I know. Please check also for other applications. Besides the usual tools <tt>tcpdump</tt>, <tt>netcat</tt>, there are two applications I prefer, which may be used to analyze network traffic: + +The <it>Multi Router Traffic Grapher (MRTG)</it> is a tool to monitor the traffic load on network-links. MRTG generates HTML pages containing GIF images which provide a LIVE visual representation of this traffic. Check <url url="http://www.ee.ethz.ch/stats/mrtg/" name=" http://www.ee.ethz.ch/stats/mrtg/"> for an example. MRTG is based on Perl and C and works under UNIX and Windows NT. + +Network Top - <tt>ntop</tt> <url url="http://www-serra.unipi.it/~ntop/" name="http://www-serra.unipi.it/~ntop/"> is a Unix tool that shows the network usage, similar to what the popular top Unix command does. <tt>ntop</tt> is based on <tt>libpcap</tt> and it has been written in a portable way in order to virtually run on every Unix platform and on Win32 as well. <tt>ntop</tt> can be used in both interactive or web mode. In the first case, <tt>ntop</tt> displays the network status on the user's terminal. In web mode a web browser (e.g. netscape) can attach to <tt>ntop</tt> (that acts as a web server) and get a dump of the network status. In the latter case, <tt>ntop</tt> can be seen as a simple RMON-like agent with an embedded web interface. + +<sect1>Mobile Router +<p> +Though designed to work from a single floppy, the <it>Linux Router Project (LRP) </it>, seems useful in combination with a laptop, too. + +<sect1>Hacking and Cracking Networks +<p> +When thinking about the powers of laptops, hacking and cracking networks may come into mind. Though I don't want to handle this topic here, but instead recommend the Security-HOWTO. + +<sect1>Lectures +<p> +If you are giving lectures, readings or presentations in different places, a laptop might suit your needs. You can combine it with an overhead display, a beamer or a second monitor. For a second monitor or a beamer make sure it is supported by your laptop. +<p> +Though Microsoft's PowerPoint is often used for such things, there are also Linux solutions: + +<itemize> + +<item> +<url url="http://www.tug.org/applications/pdftex/" name="pdftex"> creates PDF files from Tex files, which can be used toghether with certain LaTeX pakcages for presentations, see the example <it>screen designed users manual</it>. + +<item> +<url url="http://www.math.uakron.edu/~dpstory/webeq.html" name="The Web and Exerquiz Packages"> also a sophisticated method to create presentations with LaTex. + +<item> +<url url="http://www-sp.iti.informatik.tu-darmstadt.de/software/ppower4/" name="PPower"> + +<item> +<url url="http://www.lysator.liu.se/~alla/dia/" name="Dia"> +is a program for creating diagrams of all kinds. The current +version can do UML class diagrams, Entity-Relationship modeling, +network diagrams, and much more. The engine is very flexible and +dynamically loads diagram-types from disk. It can currently export to +postscript and load/save in an xml format. + +<item> +See also the software maps at KDE (K-Office) <url url="http://www.kde.org" name="http://www.kde.org"> for the program <tt>KPresenter</tt> and others. And GNOME <url url="http://www.gnome.org/" name="http://www.gnome.org/"> . + +<item> +<it>MagicPoint</it> or <tt>mgp</tt>, is an X11-based presentation tool. The home page is <url url="http://www.Mew.org/mgp" name="http://www.Mew.org/mgp"> or <url url="ftp://ftp.Mw.org/pub/MagicPoint/" name="ftp://ftp.Mew.org/pub/MagicPoint/"> or <url url="http://jiji.mew.org/mgp/" name="http://jiji.mew.org/mgp/"> . + +<item> +Commercial packages are: <it>Applixware</it> <url url="http://www.applix.com/appware/linux/slideshow/gfx011.html" name="http://www.applix.com/appware/linux/slideshow/gfx011.html"> and Staroffice, see article 15 in LinuxFocus <url url="http://vesta.astro.amu.edu.pl/Library/Linux/LinFocus/May1998/" name="http://vesta.astro.amu.edu.pl/Library/Linux/LinFocus/May1998/">. +</itemize> + + +<sect1>Mobile Data Collecting +<p> +<sect2>Related HOWTOs +<p> + +<enum> + +<item> +Coffee-mini-HOWTO + +<item> +AX-25-HOWTO + +<item> +HAM-HOWTO + +<item> +Serial-HOWTO + +<item> +Serial-Programming-HOWTO + +</enum> + +<sect2>Applications +<p> +A Linux laptop can be used to collect data outside an office, e.g. geodesy data, sales data, network checks, patient data in a hospital and others. There is support for wireless data connections via cellular phone modems and amateur radio. I am not sure whether PCMCIA radio cards are supported, see Aironet Wireless Communications <url url="http://www.aironet.com/" name=" http://www.aironet.com/">. + +<sect2>Specific Environments +<p> +There are laptops available with cases build for a rugged environment (even waterproof laptops). In some environments, for instance in hospitals, take care of the Electro-Magnetic-Compatibility of the laptop. This is influenced by many factors, for instance by the material used to build the case. Usually magnesium cases shield better than the ones made of plastics. + +<sect1>Mobile Office +<p> +With KDE <url url="http://www.kde.org" name="http://www.kde.org"> (K-Office), GNOME, <url url="http://www.gnome.org/" name="http://www.gnome.org/"> and the commercial products WordPerfect, Staroffice and Applixware <url url="http://www.applix.com/" name=" http://www.applix.com/"> Linux has more and more business software applications. With the corresponding hardware, e.g. a portable printer and a cellular phone which connects to your laptop, you will have a very nice mobile office. + +<sect1>Connection to Digital Camera +<p> +AFAIK there are currently three methods to connect a digital camera to a laptop: the infrared port (IrDA), serial port and maybe USB. There are also some auxiliary programs for conversion of pictures, etc. +<p> +Eric <dago@tkg.att.ne.jp> wrote: &dquot;I finally succeeded in downloading pictures from my digital camera, but not exactly the way I expected, i.e. not through USB port but using pcmcia card port and memory stick device, part of digital camera hardware. Anyway, some interesting things to mention: +<p> +Sony (pretending using a standard) uses the msdos format to store images as JPEG files ; so the best way to have your OS recognizing them is to mount the raw device like a msdos filesystem; using mount directly doesn't work (don't know why) but an entry in the /etc/fstab file allows you to mount the device correctly. i.e.: +<code> + /dev/hde1 /mnt/camera msdos user,noauto,ro 0 0 +</code> +Of course, <tt>newfs</tt> before <tt>mount</tt> works too, but there is nothing to see at all ;-) I think both <tt>noauto</tt> and <tt>ro</tt> are important flags; I tried without it and it didn't work. Somehow the mount I got seems buggy . And if <tt>ro</tt> is missing, the camera doesn't recognize back the memory stick and it needs to be msdos-formatted. +<p> +According to the camera documentation , both pcmcia and USB port behave the same (for Mac and Windoze - i.e. you see a file system auto mounted) - I deduce for Linux it should be the same thing too, as long as the USB driver is installed. I think now that mounting USB raw device the way I did with pcmcia should work, but I still couldn't find which device to use.&dquot; +<p> +<url url="http://digitalux.netpedia.net/" name="OpenDiS (Open Digita Support)"> is a library and utility program for cameras such as the Kodak DC-220, DC-260, DC-265, and DC-280, that run Flashpoint's Digita operating system. The library is a unix implementation of the Digita Host Interface Specification, intended for embedding Digita support in other products such as <tt>gPhoto</tt>. The utility is a simple command-line program for standalone downloading of photos from the cameras. +<p> +<url url="http://www.gphoto.org/" name="gPhoto"> enables you to take a photo from any digital camera, load it onto your PC running a free operating system like GNU/Linux, print it, email it, put it on your web site, save it on your storage media in popular graphics formats or just view it on your monitor. <tt>gPhoto</tt> sports a new HTML engine that allows the creation of gallery themes (HTML templates with special tags) making publishing images to the world wide web a snap. A directory browse mode is implemented making it easy to create an HTML gallery from images already on your computer. Support for the Canon PowerShot A50, Kodak DC-240/280 USB, and Mustek MDC-800 digital cameras. +<p> +<url url="http://www.lightner.net/lightner/bruce/ppc_use.html" name="photopc"> is is a library and a command-line frontend to manipulate digital still cameras based on Fujitsu chipset and Siarra Imaging firmware. The program is known to work with Agfa, Epson and Olympus cameras. Should also work with Sanyo, but this is untested. The cameras typically come with software for Windows and for Mac, and no description of the protocol. With this tool, they are manageable from a UNIX box. Bruce D. Lightner <lightner@metaflow.com> has added support for Win32 and DOS platforms. Note that the program does not have any GUI, it is plain command-line even on Windows. For a GUI, check out the <tt>phototk</tt> program. + +<sect1>Connection to QuickCam (Video) +<p> +AFAIK there are currently two methods to connect a video camera to a laptop: a ZV port and maybe USB, but I don't know how this works with Linux. I have heard rumors about using a sound card for video data transfer to a Linux box, see <url url="http://worldvisions.ca/~apenwarr/" name="http://worldvisions.ca/~apenwarr/"> . I have heard rumors about a Linux-QuickCam-mini-HOWTO, but couldn't find a reliable URL yet. Check the <tt>sane</tt> package which is build for scanner support, this should contain support for still-grabbers as well. +<p> +<url url="http://rainbow.uchicago.edu/~muet/linux/kmc/kmc_utils.html" name="kmc_remote"> provides a graphical interface for controlling Kodak Motion Corder fast digital cameras over a serial connection. kmc_remote is built on the kmc_serial library, part of the kmc_utils package. kmc_remote provides a virtual button panel and simple one-touch commands for changing system variables which would involve multiple button operations on the real camera button console. Buttons, record settings (image size, record rate, shutter speed, trigger mode, burst mode), and playback rate control should be fully functional. All camera models are supported, as well as both PAL and NTSC video. +<p> +<url url=" http://www.intel.com/PCcamera/" name="Intel PC Camera Pro Pack"> +is one of the first webcams with USB ports. Also SONY has announced a webcam with USB port. See a survey at <url url="http://www.steves-digicams.com/text_navigator.html" name="Steve's Digicams">. + +<sect1>Connection to Television Set +<p> +If you have a ZV port in the laptop, it should be easy to connect it to a TV set, using either NSCA or PAL, but I don't know whether either works with Linux. + +<sect1>Connection to Cellular Phone +<p> +AFAIK there are two methods to connect a cellular phone to a laptop: via the <it>infrared port</it> (IrDA) or via the <it>serial port</it>. See the Linux/IrDA project for the current status of IrDA connections. AFAIK only the Ericsson SH888, the Nokia 8110 and the Siemens S25 provide infrared support. + +<sect1>Connection to Global Positioning System (GPS) +<p> +From the Hardware-HOWTO I know there is Trimble Mobile GPS available. You may also connect a GPS via a serial port. Most GPS receivers have a data port and can connect to a PC with a special serial cable. + +<itemize> + +<item> +<tt>dgpsip</tt> provides correct GPS location with DGPS signal from internet. + +<item> +<url url="http://www.mayko.com/gpsd.html" name="gpsd"> +is a daemon that listens to a GPS or Loran receiver and translates the positional data to simplified format that can be more easily used by other programs, like chart plotters. The package comes with a sample client that plots the location of the currently visible GPS satellites (if available) and a speedometer. Added support for the DeLame EarthMate as well as a new 'speedometer' mini client. + +<item> +The <url url="http://www.gbdirect.co.uk/" name="QtGPS"> +package contains a piece of software for Unix/Linux/X and a +GPS receiver. It performs logging and replaying of a journey, +supporting a moving-map display. QtGPS works with Lat/Long and British +OSGB (Ornance Survey) co-ordinate systems. + +<item> +<url url="http://www.geog.uni-hannover.de/grass/welcome.html" name="GRASS"> (Geographic Resources Analysis Support System) is a free software +raster and vector based GIS, image processing system, graphics +production system, and spatial modeling system. + +</itemize> + +<sect1>Connection via Amateur Radio (HAM) +<p> +AFAIK laptops are used in HAM contests. Please see <url url="http://sunsite.unc.edu/mdw/HOWTO/HAM-HOWTO.html" name="HAM-HOWTO"> by Terry Dawson, <it>VK2KTJ</it>, <terry@perf.no.itg.telstra.com.au> . + +<sect1>Satellite Watching +<p> +Together with an antenna and software like <tt>seesat</tt> or <tt>sattrack</tt> you can use a laptop to locate a satellite for visual observation. You could also use <tt>xephem</tt> on a laptop when stargazing. + +<sect1>Aviation +<p> +Many people are using laptops for aviation related topics. The <url url="http://metalab.unc.edu/fplan/Aviation-HOWTO/" name="Aviation HOWTO"> is an FAQ, HOWTO <it>like</it> document that provides pointers to software packages that run under the Linux operating system and are useful to private, commercial, or military pilots. The ultimate goal is to enable pilots to use the Linux operating system for all their aviation related computing needs. + +<sect1>Blind or Visually Impaired Users +<p> +There are some groups of which could gain a specific profit by using laptops. For instance blind or visually impaired people (I explicitly avoid to say handicapped people). See ACCESS-HOWTO and <url url="http://leb.net/blinux/" name="Blinux - Linux for blind people"> for more information. <tt>BRLTTY</tt> is a program which supports different braille terminals. <tt>Festival</tt> is a speech synthesis system. Screen and cursor magnifiers are available. + +<sect>Other Operating Systems +<p> +<sect1>DOS/Windows9x/NT +<p> +<sect2>Introduction +<p> +Unfortunately, there are a few reasons which might make it necessary to put DOS/Windows and Linux together on one laptop. Often the support for the flash ROM of PCMCIA cards and modems is not available for Linux, or you have to retrieve hardware information, which is not visible with Linux, due to a lack of support by some hardware manufacturers. I'm not sure wether this tasks can be achieved under an emulation like DOS-EMU or WINE. + +If you want Linux with X, Netscape, etc., and Windows95, things will be tight in a 1GB harddisk. Though I do so with a 810MB disk. + +<sect2><label id="dostools">DOS Tools to Repartition a Hard Disk +<p> +Often you get a preinstalled version of Windows on your laptop. If you just want to shrink the Windows partition, you need a tool to resize the partition. Or you can remove the partition first, repartition, then reinstall. Most of the following information I found at the page of Michael Egan <Michael.Egan@sonoma.edu> at <url url="http://libweb.sonoma.edu/mike/fujitsu/" name=" http://libweb.sonoma.edu/mike/fujitsu/"> . + +A well known and reliable, but commercial product is <it>Partition Magic</it> <url url="http://www.powerquest.com/product/pm/index.html" name="http://www.powerquest.com/product/pm/index.html"> from Power Quest. + +Many people have used <it>FIPS 15c</it> (which may support FAT-32) <url url="http://bmrc.berkeley.edu/people/chaffee/fips/fips.html" name="http://bmrc.berkeley.edu/people/chaffee/fips/fips.html"> for repartitioning FAT partition sizes.) Also, another version from a different source is FIPS 2.0 (claims to support FAT-32) <url url="http://www.igd.fhg.de/~aschaefe/fips/" name="http://www.igd.fhg.de/~aschaefe/fips/"> for repartitioning FAT partition sizes.) + +One more &dquot;newer&dquot; utility for repartitioning and resizing FAT partitions is <it>Ranish Partition Manager/Utility</it> (FAT-32 support is claimed for this as well, Linux support is taken into account.) <url url="http://www.users.intercom.com/~ranish/part/" name="http://www.users.intercom.com/~ranish/part/"> . + +<sect2>Partition Sharing +<p> +You may share your swap space between Linux and Windows. Please see &dquot;Dealing with Limited Resources&dquot; section. Also with Linux you can mount any kind of DOS/Windows partition. The other way round there are also some tools, for instance at <url url="http://uranus.it.swin.edu.au/~jn/linux/" name=" http://uranus.it.swin.edu.au/~jn/linux/"> , which provides a tool to read and write ext2 partitions from Windows9x/NT. + +Also you can mount DOS drives of the type <tt>msdos</tt>, <tt>vfat</tt> and even compressed drives (Drivespace, etc.). For long file names use <tt>vfat</tt> and if you like autoconversion ( a nice feature for text files), you may do so by using the <tt>conv=auto</tt> option. I have used this in my <file>/etc/fstab</file>, but be aware this might cause some strange behaviour sometimes, look at the kernel docs for further details. + +<code> +/dev/hda8 /dos/d vfat user,exec,nosuid,nodev,conv=auto 0 2 +</code> + +<sect2>Installation without CD Drive +<p> +You may use the CD drive of a desktop (or copy the content of the CD to the hard disk) and connect both machines with a nullmodem cable. Than use a DOS boot floppy and the program <tt>INTERLNK.EXE</tt> to connect both machines. + +<sect2>Miscellaneous +<p> +<htmlurl url="http://www.travsoft.com" name="http://www.travsoft.com"> +<p> +Windows/NT offers: RAS - Remote Access Service +<p> +Windows/9x/NT offers the PPTP protocol to connect to remote sites via +a TCP/IP tunnel. This protocol is also supported by Linux. +<url url="http://www.moretonbay.com/vpn/pptp.html" name="PoPToP"> +is the PPTP server solution for Linux allowing Linux servers to function seamlessly in the PPTP VPN environment. This enables administrators to leverage the considerable benefits of both Microsoft clients and Linux servers. The current pre-release version supports Windows 95/98/NT PPTP clients and PPTP Linux clients. The PoPToP pre-release server is not yet fully optimised. On release, PoPToP will be fully compliant with IETF PPTP Internet Draft and it will seamlessly support Windows PPTP clients with the full range of encryption and authentication features. + +<sect1>BSD Unix +<p> + +<enum> + +<item> PicoBSD is a one floppy version of FreeBSD 3.0-current, which in its different variations allows you to have secure dialup access, small diskless router or even a dial-in server. And all this on only one standard 1.44MB floppy. It runs on a minimum 386SX CPU with 8MB of RAM (no HDD required!). You probably may also use it to install BSD on a laptop as described with micro Linuxes above. You get PicoBSD at <url url="http://www.freebsd.org/~picobsd/" name=" http://www.freebsd.org/~picobsd/"> + +<item> +<url url="http://www.jp.FreeBSD.org/PAO/" name="PAO: FreeBSD Mobile Computing Package"> FreeBSD is a version of the UNIX operating system that runs on PC hardware. It uses a different set of support for PCMCIA devices, APM, and other mobility related issues. + +<item> +<url url="http://www.monarch.cs.cmu.edu/" name="The CMU Monarch Project"> Implementations of Mobile-IPv4 and Mobile-IPv6 for FreeBSD + +<item> +<url url="http://www.yy.cs.keio.ac.jp/~sanpei/note-list.html" name="XF86Config Archive">. A database of XF86Config files used by Linux and FreeBSD users. If you need an XF86Config file for your notebook or laptop, check out this site. (Some documents available in Japanese only.) + +<item> +AFAIK there is no IrDA support yet. + +</enum> + +<sect1>OS/2 +<p> +At <url url="http://o2ss.com/users/DrMartinus/" name="The Notebook/2 Site"> by Dr. Martinus you may find information about different notebooks and PCMCIA cards working with OS/2. + +<sect1>NOVELL Netware +<p> +The client side with DOS/Windows9x style operating systems seems to be no problem, since there are many PCMCIA cards with drivers for Netware available. For Linux connections see the <tt>mars_nwe</tt> package. Also the Caldera Linux distribtion is well known for its Novell support. +<p> +I hadn't time to build a Netware server on a laptop yet and couldn't check wether there are network connections possible (PCMCIA driver for Netware server). + +<sect1>Debian GNU/Hurd (hurd-i386) +<p> +The GNU Hurd is a totally new operating system being put together by the GNU group. In fact, the GNU Hurd is the final component which makes it possible to built an entirely GNU OS -- and Debian GNU/Hurd is going to be one such (possibly even the first) GNU OS. The current project is founded on the i386 architecture, but expect the others to follow soon. +<p> +The <url url="http://www.urbanophile.com/arenn/hacking/hurd/hurd-hardware.html" name="GNU Hurd Hardware Compatibility Guide"> states that Hurd should work on laptops, but PCMCIA support isn't ready yet. + +<sect>ToDo +<p> + +<enum> + +<item> +mention the corresponding kernel options in the Linux Compatibility Check sections</item> + +<item> +write more Hardware sections</item> + +</enum> + +<sect>Revision History +<p> +v0.1 13 January 1999, first draft +<p> +v0.2 15 January 1999, minor changes +<p> +v0.3 28 January 1999, APM chapter started, minor changes +<p> +v0.4 8 February, APM chapter rewritten, removed some lint +<p> +v0.5 17 February 1999, added small USB chapter, added Dealing with Limited Resources chapter, added Solutions with Laptops chapter, minor editorial changes, released draft to the public +<p> +v1.0 19 February 1999, added Sound and Keyboard chapter, minor changes, release to the LDP +<p> +v1.1 28 February 1999, spelling, grammar, style checked and many additional information added by W. Wade Hampton, added CD Drive, Harddisk and Kernel chapters, many minor changes +<p> +v1.2 5 March 1999, added Debian-Laptop-Mailing-List, added information about <tt>apmcd</tt> and <tt>suspendd</tt> to APM chapter, changed some URLs, minor changes +<p> +v1.3 8 March 1999, minor changes +<p> +v1.4 25 March 1999, added ACPI information, added chapters Appendix C - NeoMagic Chip NM20xx by Cedric Adjih and Appendix D - Annotated Bibliography , minor changes +<p> +v1.5 4 April 1999, added chapters about setting up E-Mail by Peter Englmaier and Noise Reduction, minor changes +<p> +v1.6 26 June 1999, rewrite of APM chapter, added install method via LapLink cable, URLs changed or added, spell checking, minor changes +<p> +v1.7 28 September 1999, changed <htmlurl ..> SGML tags to <url ..>, ACPI chapter separated, touchpad chapter separated and improved, preface rewritten, added information about <tt>divine</tt>, <tt>noflushd</tt> and <tt>parted</tt>, new chapter Linux Tools to Repartition a Hard Disk, added appendix E about specific laptops, some URLs updated, minor changes +<p> +v2.0 2 October 1999, added information about <tt>gphoto</tt>, <tt>kmc_utils</tt>, Memory Technology Devices and HUT Mobile IP; changed structur of document (moved chapters Accessories, Laptop Distribution and chapter about partitioning), new DVD chapter, started Aviation chapter, started OS/2 chapter, started Blind and Visually Impaired Users chapter, changed entity &tilde; in URLs to ˜ to improve SGML-Tools PS output (otherwise ˜ is missing), link to new Lucent WinModem driver, minor additions and changes +<p> +v2.1 2 November 1999, added information about email with UUCP, the use of CVS and other tools to synchronize two machines, the <tt>noatime</tt> mount option, GPS systems, presentation tools, and hard disk form factors, started chapter about the Hurd, changed URL of PCMCIA-CS package and LDP, reworked credits chapter, reworked APM chapter, minor changes +<p> +v2.2 2 December 1999, reorganized the chapters about Cellular Phones, Pagers, Calculators, Digital Cameras, Wearable Computing and Noise Reduction, many minor changes and bug fixes + +<p> +v2.2a 3 November 2000, links updated + +<p> +v2.2b 27 February 2003, links updated (TuxMobil.org, tldp.org, +linux-on-laptops.com) + +<sect>Credits +<p> +I would like to thank the many people who assisted with corrections and suggestions. Their contributions have made this work far better than I could ever have done alone. Especially I would like to thank, in order of appearance: + +<itemize> + +<item> +First of all Kenneth E. Harker <kharker at cs.utexas.edu>, from his page <url url="http://www.linux-on-laptops.com/" name="Linux on Laptops"> I have included much material into this HOWTO, but didn't always quote him verbatim. + +<item> +The other HOWTO authors from the <url url="http://tldp.org/" name="LINUX DOCUMENTATION PROJECT - LDP">. + +<item> +The members of the <url url="http://irda.sourceforge.net" name="Linux/IrDA Project">. + +<item> +The members of the Linux-Laptop Mailing List. + +<item> +The members of the Debian-Laptop Mailing List. + +<item> +The visitors and contributors of my <url url="http://tuxmobil.org/" name="TuxMobil"> pages. + +<item> +David Hinds, the maintainer of the <url url="http://pcmcia.sourceforge.org" name="PCMCIA-CS"> package. + +<item> +Frank Schneider <SPATZ1 at T-ONLINE.DE>. + +<item> +Stefan Martig <martig at iamexwi.unibe.ch>. + +<item> +Michele Andreoli, maintainer of <url url="http://mulinux.firenze.linux.it/" name="muLinux">. + +<item> +Klaus Franken <kfr at klaus.franken.de>. + +<item> +W. Wade, Hampton <whampton at staffnet.com>, did much of spell, grammar and style checking and added many valuable information. + +<item> +Anderson MacKay <mackay at rice.edu>, <url url="http://linux.rice.edu" name="RLUG - Rice University Linux User Group ">, gave many different detailed recommendations. + +<item> +Sean 'Shaleh' Perry, <shaleh at livenet.net>, Debian maintainer of <tt>anacron</tt> and other packages, for Debian support. + +<item> +Bob Toxen <bob at cavu.com>. + +<item> +Peter Sprenger <spre at lugs.ch>. + +<item> +Felix Braun <fbraun at atdot.org>. + +<item> +Steve Rader <rader at wiscnet.net>. + +<item> +<url url="http://www.felch01.demon.co.uk/laptop-howto.html" name="Richard Worwood"> <richard at felch01.demon.co.uk>, for mirroring of the HOWTO. + +<item> +Marcel Ovidiu Vlad <marceluc at leland.Stanford.EDU>. + +<item> +Ludger Berse <lberse01 at cityweb.de>. + +<item> +Cedric Adjih <cedric.adjih at inria.fr>, wrote the chapter about the NeoMagic chipset. + +<item> +Peter Englmaier <ppe at pa.uky.edu>, provided the chapter about a sophisticated email setup. + +<item> +Michael Wiedmann <mw at miwie.in-berlin.de>, <url url="http://www.in-berlin.de/User/miwie/pia/" name="PIA - X11 based PalmPilot Address Manager"> , found many spelling errors and more. + +<item> +Adam Spiers <adam at thelonious.new.ox.ac.uk>. + +<item> +Lionel, &dquot;trollhunter&dquot; Bouchpan-Lerust-Juery, <trollhunter at linuxfr.org>, for providing the <url url="http://infonomade.linuxfr.org/portables/ressourcesfr.html#howto" name="French translation"> and <url url="http://infonomade.linuxfr.org/indexen.html" name="information about wearables"> . + +<item> +Nathan Myers <ncm at linuxlaptops.com>, from <url url="http://www.linuxlaptops.com" name="LL - LinuxLaptops"> for numerous additions. + +<item> +Ben Attias <hfspc002 at csun.edu>. + +<item> +Igor Pesando <ipesando at to.infn.it>. + +<item> +Geert Van der Plas <Geert.VanderPlas at esat.kuleuven.ac.be>, provided information about the touchpad driver included in the GPM. + +<item> +Chandran Shukla <chandran at xmission.com>. + +<item> +Harald Milz <hm at suse.de>, from <url url="http://www.suse.de" name="SuSE"> provided numerous additions. + +<item> +<url url="http://www.snafu.de/~ingo.dietzel/" name="Ingo Dietzel"> <ingo.dietzel at berlin.snafu.de>, for his patience with the project. + +<item> +Emerson, Tom # El Monte <TOMEMERSON at ms.globalpay.com>, for his idea about laptop bags. + +<item> +Thomas Traber <traber at inetmail.de>. + +<item> +Bill Gjestvang <datawolf at ibm.net>. + +<item> +Leandro Noferin <lnoferin at cybervalley.org>, for proofreading the <it>italian</it> parts. + +<item> +Stephane Bortzmeyer <stephane at sources.org> for his suggestions about email with UUCP, the use of CVS or related tools to synchronize two machines, and the <tt>noatime</tt> mount option. + +<item> +Peter Teuben <teuben at astro.umd.edu>, for some suggestions about hard disks. + +<item> +<url url="http://www.guido.germano.com" name="Guido Germano"> <guido at germano.com>, for information about the Macintosh Powerbook 145B. + +<item> +Joel Eriksson <joel.eriksson at alfa.telenordia.se>, for information about Atari laptops. + +<item> +Gilles Lamiral <lamiral at mail.dotcom.fr> for providing the PLIP Install-HOWTO. + +<item> +Alessandro Grillo <Alessandro_Grillo at tivoli.com>, started the Italian translation. + +<item> +Gledson Evers <pulga_linux at bol.com.br>, started the Portuguese translation. + +<item> +Dan Kegel <dank at alumni.caltech.edu>, pointed me to the Toshiba Linux page. + +<item> +<url url="http://www.geocities.com/SiliconValley/5161" name="Jaime Robles"> <ea4abw at amsat.org>, gave me some information about the HAM-HOWTO. + +<item> +<url url="http://home.pages.de/~lufthans/" name="LuftHans"> <LuftHans at asu.edu>, announced this HOWTO to the maintainer of the Hardware-HOWTO. + +<item> +<url url="http://www.cs.hut.fi/~jtm" name="Jari Malinen"> <jtm at mart2.cs.hut.fi>, for support with HUT Mobile IP. + +<item> +John Beimler <john at radiomind.com>, provided the URL of <tt>photopc</tt>. + +<item> +Steven G. Johnson <stevenj at MIT.EDU>, provided the information about Apple/Macintosh m86k machines. + +<item> +Ulrich Oelmann <ulrich.oelmann at tu-clausthal.de>, gave valuable additions about the installation with <tt>muLinux</tt>. + +<item> +Lucio Pileggi <lucio at ing.unipi.it>, provided information about the Siemens S25 cellular phone. + +<item> +Eric <dago at tkg.att.ne.jp> wrote how to transfer pictures from a digital camera. + +<item> +Sorry, but probably I have forgotten to mention everybody who helped. + +</itemize> + +<sect>Appendix A - Survey about Micro Linuxes +<p> +Because of their small or non-existent footprint, micro-Linuxes are especially suited to run on laptops -- particularly if you use a company-provided laptop running Windows9x/NT. Or for installation purposes using another non Linux machine. There are several <it>micro</it> Linux distributions out there that boot from one or two floppies and run off a ramdisk. + +See <url url="http://www.linuxhq.com" name=" http://www.linuxhq.com "> or <url url="http://www.txdirect.net/users/mdfranz/tinux.html" name=" http://www.txdirect.net/users/mdfranz/tinux.html "> for details. You may find a FAQ and a mailing list about boot-floppies at <url url="http://os.inf.tu-dresden.de/~sr1/boot-floppies/faq.html" name=" http://os.inf.tu-dresden.de/~sr1/boot-floppies/faq.html ">. Also a BootDisk-HOWTO is available. Thanks to Matthew D. Franz maintainer of <it>Trinux</it> for this tips and collecting most of the following URLs. See also the content of Console/Mini Distributions at <url url="http://ma.us.mirrors.freshmeat.net/appindex/console/mini-distributions.html" name="FreshMeat">. + +<enum> + +<item> +<url url=" http://mulinux.firenze.linux.it/" name="MuLinux"> by Michele Andreoli</item> + +<item> +tomsrtbt <url url="http://www.toms.net/~toehser/rb/" name=" http://www.toms.net/~toehser/rb/"> &dquot;The most Linux on one floppy. (distribution or panic disk).&dquot; by Tom Oehser</item> + +<item> +Trinux <url url="http://www.trinux.org" name=" http://www.trinux.org "> &dquot;A Linux Security Toolkit&dquot; by Matthew D. Franz</item> + +<item> +LRP &dquot;Linux Router Project&dquot; <url url="http://www.psychosis.com/linux-router/" name="http://www.psychosis.com/linux-router/"></item> + +<item> +hal91 <url url="http://home.sol.no/~okolaas/hal91.html" name="http://home.sol.no/~okolaas/hal91.html "></item> + +<item> +floppyfw <url url="http://www.zelow.no/floppyfw/" name="http://www.zelow.no/floppyfw/"> by Thomas Lundquist</item> + +<item> +minilinux <url url="http://alberti.crs4.it/softw are/mini-linux/" name=" http://alberti.crs4.it/softw are/mini-linux/"> (seems no more valid) or <url url="http://www.kiarchive.ru/pub/linux/mini-linux/" name=" http://www.kiarchive.ru/pub/linux/mini-linux/"> </item> + +<item> +monkey <url url="http://www.spsselib.hiedu.cz/monkey/docs/english.htm" name=" http://www.spsselib.hiedu.cz/monkey/docs/english.htm "> </item> + +<item> +DLX <url url="http://www.wu-wien.ac.at/usr/h93/h9301726/dlx.html" name="http://www.wu-wien.ac.at/usr/h93/h9301726/dlx.html"> by Erich Boem</item> + +<item> +C-RAMDISK <url url="http://metalab.unc.edu/pub/Linux/kernel/images/" name=" http://metalab.unc.edu/pub/Linux/kernel/images/"> </item> + +<item> +BABEL <url url="http://celsius-software.hypermart.net/babel/" name=" http://celsius-software.hypermart.net/babel/"> &dquot;A mini-distribution to run games&dquot;</item> + +<item> +Xdenu <url url="http://xdenu.tcm.hut.fi/" name=" http://xdenu.tcm.hut.fi/"> , quotating Alan Cox: &dquot;<tt>Xdenu</tt> is a small distribution program that installs as a set of DOS zips onto a DOS partition and gives you a complete X11 client workstation.&dquot;</item> + +<item> +LOAF <url url="http://www.ecks.org/loaf/" name=" http://www.ecks.org/loaf/"> </item> + +<item> +pocket-linux <url url="http://pocket-linux.coven.vmh.net/" name=" http://pocket-linux.coven.vmh.net/"></item> + +<item> +FLUF <url url="http://www.upce.cz/~kolo/fluf.htm" name=" http://www.upce.cz/~kolo/fluf.htm "></item> + +<item> +YARD <url url="http://www.croftj.net/~fawcett/yard/" name=" http://www.croftj.net/~fawcett/yard/"> </item> + +<item> +TLinux <url url="http://members.xoom.com/ror4/tlinux/" name=" http://members.xoom.com/ror4/tlinux/"> </item> + +<item> +ODL <url url="http://linux.apostols.org/guru/wen/" name=" http://linux.apostols.org/guru/wen/"></item> + +<item> +SmallLinux by Steven Gibson <url url ="http://smalllinux.netpedia.net/" name=" http://smalllinux.netpedia.net/"> Three disk micro-distribution of Linux and utilities. Based on kernel 1.2.11. Root disk is ext2 format and has <tt>fdisk</tt> and <tt>mkfs.ext2</tt> so that a harddisk install can be done. Useful to boot up on old machines with less than 4MB of RAM.</item> + +<item> +cLIeNUX by Rick Hohensee client-use-oriented Linux distribution <url url="ftp://ftp.blueznet.com /pub/colorg" name="ftp://ftp.blueznet.com /pub/colorg"> </item> + +<item> +linux-lite by Paul Gortmaker for very small systems with less than 2MB RAM and 10MB harddisk space (1.x.x kernel) <url url="http://metalab.unc.edu/pub/Linux/kernel" name=" http://metalab.unc.edu/pub/Linux/kernel "></item> + +<item> +See also the packages at MetaLab formerly known as SunSite <url url="http://metalab.unc.edu/pub/Linux/system/recovery/!INDEX.html" name=" http://metalab.unc.edu/pub/Linux/system/recovery/!INDEX.html "> and the Boot-Disk-HOWTO</item> + +<item> +You may also consider some of the boot floppies provided by various distributions falling into this category, e.g. the boot/rescue floppy of Debian/GNU Linux. </item> + +<item> +If you like to build your own flavour of a boot floppy you may do so manually, as described in the BootDisk-HOWTO or using some helper tools, for instance <tt>mkrboot</tt> (provided at least as a Debian/GNU Linux package) or <tt>pcinitrd</tt>, which is part of the PCMCIA-CS package by David Hinds. + +<item> +Also you might try to build your Linux system on a ZIP drive. This is described in the ZIP-Install-mini-HOWTO. + +</enum> + +<sect>Appendix B - Dealing with Limited Resources or Tuning the System +<p> +<sect1>Related HOWTOs +<p> + +<enum> + +<item> +LBX-HOWTO + +<item> +Small-Memory-HOWTO + +</enum> + +<sect1>Introduction +<p> +As mentioned in the introduction laptops sometimes have less resources if you compare them to desktops. To deal with limited space, memory, CPU speed and battery power, I have written this chapter. + +<sect1>Small Space +<p> +<sect2>Introduction +<p> +There are different types of techniques to gain more disk space, such as sharing of space, freeing unused or redundant space, filesystem tuning and compression. Note: some of these techniques use memory instead of space. As you will see, there are many small steps necessary to free some space. + +<sect2>Techniques +<p> + +<enum> + +<item> +Stripping: Though many distributions come with stripped binaries today it is useful to check this. For details see <tt>man strip</tt>. To find every unstripped file you can use the <tt>file</tt> command or more convenient the tool <tt>findstrip</tt>. Attention: don't strip libraries, sometimes the wrong symbols are removed due to a bad programming technique. Or use the <tt>--strip-unneeded</tt> option.</item> + +<item> +Perforation: <tt>zum(1)</tt>reads a file list on stdin and attempts to perforate these files. Perforation means, that series of null bytes are replaced by <tt>lseek</tt>, thus giving the file system a chance of not allocating real disk space for those bytes. Example: <tt>find . -type f | xargs zum</tt> </item> + +<item> +Remove Odd Files and Duplicates: Check your system for core files, emacs recovery files <#FILE#> vi recovery files <FILE>.swp, RPM recovery files <FILE>.rpmorig and <tt>patch</tt> recovery files. Find duplicates, you may try <tt>finddup</tt>. Choose a system to name your backup, temporary and test files, e.g. with a signature at the end. + +<item>Clean Temporary Files: , e.g. <file>/tmp</file>, there is even a tool <tt>tmpwatch</tt>. + +<item>Shorten the Log Files: usually the files in <file>/var/log</file>. </item> + +<item> +Remove Files: Remove files which are not &dquot;necessary&dquot; under all circumstances such as man pages, documentation <file>/usr/doc</file> and sources e.g. <file>/usr/src</file> . + +<item> +Unnecessary Libraries: You may use the <tt>binstats</tt> package to find unused libraries (Thanks to Tom Ed White). + +<item> +Filesystem: Choose a filesystem which treats disk space economically e.g. <tt>rsfs</tt>. Tune your filesystem e.g. <tt>tune2fs</tt>. Choose an appropriate partition and block size. </item> + +<item> +Reduce Kernel Size: Either by using only the necessary kernel features and/or making a compressed kernel image <tt>bzImage</tt>. </item> + +<item> +Compression: I didn't check this but AFAIK you may compress your filesystem with <tt>gzip</tt> and decompress it on the fly. Alternatively you may choose to compress only certain files. You can even execute compressed files with <tt>zexec</tt></item> + +<item> +Compressed Filesystems: +<p> +- For e2fs filesystems there is a compression version available <tt>e2compr</tt> , see <url url="http://debs.fuller.edu/e2compr/" name="http://debs.fuller.edu/e2compr/"> . +<p> +- DMSDOS which enables your machine to access Windows95 compressed drives (drivespace, doublestacker). If you don't need DOS/Windows95 compatibility, i.e. if you want to compress Linux-only data, this is really discouraged by the author of the program. See <url url="http://fb9nt-ln.uni-duisburg.de/mitarbeiter/gockel/software/dmsdos/" name="http://fb9nt-ln.uni-duisburg.de/mitarbeiter/gockel/software/dmsdos/"> .</item> + +<item> +Partition Sharing: You may share swap-space (see Swap-Space-HOWTO) or data partitions between different OS (see <tt>mount</tt>). For mounting MS-DOS Windows95 compressed drives (doublespace, drivespace) you may use <tt>dmsdos</tt> <url url="http://metalab.unc.edu/pub/Linux/system/filesystems/dosfs/" name=" http://metalab.unc.edu/pub/Linux/system/filesystems/dosfs/">.</item> + +<item> +Libraries: Take another (older) library, for instance <tt>libc5</tt> , this library seems to be smaller than <tt>libc6</tt> aka <tt>glibc2</tt> . + +<item> +Kernel: If your needs are fitted with an older kernel version, you can save some space. + +<item> +GUI: Avoid as much Graphical User Interface (GUI) as possible. + +<item>Tiny Distributions: There are some distributions available which fit from one 3.5&dquot; floppy to 10MB disk space and fit for small memories, too. See appendix A and below. + +<item>External Storage Devices (Hard Disks, ZIP Drives, NFS, SAMBA): Since many notebooks may be limited in their expandability, using the parallel port is an attractive option. There are external harddisks and ZIP Drives available. Usually they are also connectable via PCMCIA. Another way is using the resources of another machine through NFS or SAMBA etc. + +</enum> + +<sect1>Harddisk Speed +<p> +Use the tool <tt>hdparm</tt> to set up better harddisk performance. Though I have seen laptop disk enabled with <it>striping</it>, I can't see a reason to do so, because IMHO aka RAID0 striping needs at least two different disks to increase performance. +<p> +See UNIX and LINUX Computing Journal: <url url="http://www.diverge.org/ulcj/199910tfsp.shtml" name="Tunable Filesystem Parameters in /proc"> How to increase, decrease and reconfigure filsystem behavior from within /proc. + +<sect1>Small Memory +<p> +<sect2>Related HOWTOs +<p> + +<enum> + +<item> +Small-Memory-mini-HOWTO by Todd Burgess <tburgess@uoguelph.ca > <url url="http://eddie.cis.uoguelph.ca/~tburgess" name=" http://eddie.cis.uoguelph.ca/~tburgess"> + +<item> +Modules-mini-HOWTO + +<item> +Kerneld-mini-HOWTO + +</enum> + +<sect2>Techniques +<p> +Check the memory usage with <tt>free</tt> and <tt>top</tt>. + +<url url="http://www.complang.tuwien.ac.at/ulrich/mergemem/" name="Mergemem Project ">. Many programs contain <it>memory areas of the same content</it> that remain undetected by the operating system. Typically, these areas contain data that have been generated on startup and remain unchanged for longer periods. With <tt>mergemem</tt> such areas are detected and shared. The sharing is performed on the operating system level and is invisible to the user level programs. <tt>mergemem</tt> is particularily useful if you run many instances of interpreters and emulators (like Java or Prolog) that keep their code in private data areas. But also other programs can take advantage albeit to a lesser degree. + +You may also reduce the <it>kernel size</it> as much as possible by removing any feature which is not necessary for your needs and by modularizing the kernel as much as possible. + +Also you may shutdown every service or <it>daemon</it> which is not needed, e.g. <tt>lpd</tt>, <tt>mountd</tt>, <tt>nfsd</tt> and close some <it>virtual consoles</it>. Please see Small-Memory-mini-HOWTO for details. + +And of coarse use <it>swap space</it>, when possible. + +If possible you use the resources of another machine, for instance with X, VNC or even <tt>telnet</tt>. For more information on Virtual Network Computing (VNC), see <url url="http://www.uk.research.att.com/vnc" name="http://http://www.uk.research.att.com/vnc/"> . + +<sect1>Low CPU Speed +<p> +You may want to overdrive the CPU speed but this can damage your hardware and I don't have experience with it. For some examples look at Adorable Toshiba Libretto - Overclocking <url url="http://www.cerfnet.com/~adorable/libretto.html" name="http://www.cerfnet.com/~adorable/libretto.html">. + +<sect1>Power Saving Techniques +<p> + +<enum> + +<item> +If you don't need infrared support, disable it in the BIOS or shutdown the IrDA device driver. There are also some IrDA features of the kernel which are useful for saving power. + +<item> +PCMCIA services consume much power, so shut them down if you don't need them. + +<item> +I'm not sure to which extend the <it>backlight</it> consumes power. WARNING: AFAIK this device can only bear a limited number of uptime circles. So avoid using screensavers. + +<item> +For some examples to build batteries with increased uptime up to 8 hours look at Adorable Toshiba Libretto <url url="http://www.cerfnet.com/~adorable/libretto.html" name="http://www.cerfnet.com/~adorable/libretto.html">. + +<item> +For information about APM look at the APM chapter above. + +<item> +<url url="http://www-leland.stanford.edu/~bbense/toys/" name="A hacked rclock ">. Booker C. Bense has hacked the <it>rclock</it> program to include a simple battery power meter on the clock face. + +<item> +<url url="http://www.jaist.ac.jp/~daisuke/Linux/xbatstat.html" name="xbatstat">. A battery level status checker for Linux and X. + +<item> +The &dquot;noatime&dquot; option when mouting filesystems tells the kernel +to <em>not</em> update the <it>access time</it> information of the file. This +information, although sometimes useful, is not used by most people (do +you know that <tt>ls -lu</tt> gives you the access time?). Therefore, +you can safely disable it, then preventing disk access each time you +<tt>cat</tt> a file. Here is an example of a <file>/etc/fstab</file> +with this power-saving option: +<tscreen> +<verb> +/dev/hda7 /var ext2 defaults,noatime 0 2 +</verb> +</tscreen> + +<item> +<url url="ftp://tsx-11.mit.edu/pub/linux/sources/sbin/hdparm-3.0.tar.gz" name="hdparm"> <it>hdparm</it> is a Linux IDE disk utility that lets you set spin-down timeouts and other disk parameters. It works also for some SCSI features. + +<item> +<url url="http://www.complang.tuwien.ac.at/ulrich/linux/tips.html" name="Mobile Update Daemon "> This is a drop-in replacement for the standard <tt>update</tt> daemon, <tt>mobile-update</tt> minimizes disk spin ups and reduces disk uptime. It flushes buffers only when other disk activity is present. To ensure a consistent file system call <tt>sync</tt> manually. Otherwise files may be lost on power failure. <tt>mobile-update</tt> does not use APM. So it works also on older systems. + +<item> +<url url="http://www.tuebingen.linux.de/kobras/noflushd/" name="noflushd">: <tt>noflushd</tt> monitors disk activity and spins down disks that have been idle for more than <timeout> seconds. It requires a kernel >=2.2.11 . Useful in combination with <tt>hdparm</tt> and <tt>mount</tt> with <it>noatime</it> option to bring down disk activity. + +<item> +<url url="http://www2.prestel.co.uk/hex/toshiba.html" name="Toshiba Linux Utilities "> This is a set of Linux utilities for controlling the fan, supervisor passwords, and hot key functions of Toshiba Pentium notebooks. There is a KDE package <it>Klibreta</it>, too. + +<item> +At Kenneth E. Harker's page there is a recommendation for LCDproc <url url="http://lcdproc.omnipotent.net/" name="LCDProc"> . &dquot;LCDproc is a small piece of software that will enable your Linux box to display live system information on a 20x4 line backlit LCD display. This program shows, among other things, battery status on notebooks.&dquot; I tried this package and found that it connects only to the external Matrix-Orbital 20x4 LCD display <url url="http://www.matrix-orbital.com/" name="http://www.matrix-orbital.com/">, which is a LCD display connected to a serial port. I can't see any use for a laptop yet. + +<item> +<url url="http://www.loonie.net/~eschenk/diald.html" name="Diald: Dial Daemon "> . The Diald daemon provides on demand Internet connectivity using the SLIP or PPP protocols. Diald can automatically dial in to a remote host when needed or bring down dial-up connections that are inactive. + +<item> +KDE <url url="http://www.kde.org" name="http://www.kde.org"> provides <it>KAPM</it>, <it>Kbatmon</it> and <it>Kcmlaptop</it>. Written by Paul Campbell <it>kcmlaptop</it> is a set of KDE control panels that implements laptop computer support functions, it includes a dockable battery status monitor for laptops - in short a little icon in the KDE status bar that shows how much battery time you have left. It also will warn you when power is getting low and allows you to configure power saving options. + +Similar packages you may find at the GNOME project <url url="http://www.gnome.org/" name=" http://www.gnome.org/"> . See the software maps at both sites. + +<item> +Please see Battery Powered Linux Mini-HOWTO by Hanno Mueller, hanno@lava.de <url url="http://www.lava.de/~hanno/" name="http://www.lava.de/~hanno/"> for more information. + +</enum> + +<sect1>Kernel +<p> +<sect2>Related HOWTOs +<p> +<itemize> + +<item> +Kernel-HOWTO + +<item> +BootPrompt-HOWTO + +</itemize> + +<p> +Many kernel features are related to laptops. For instance APM, IrDA, PCMCIA and some options for certain laptops, e.g. IBM ThinkPads. In some distributions they not configured. And the kernel is usually bigger than necessary. So it's seems a good idea to customize the kernel. Though this task might seem difficult for the beginner it is highly recommended. Since this involves dangerous operations you need to be careful. But, if you can install a better kernel successfully, you've earned your intermediate Linux sysadmin merit badge. - Since this topic is already covered in other documents I want handle this here. + +<sect1>Tiny Applications and Distributions +<p> +A small collection yet, but I'm looking for more information. + +<enum> + +<item> +BOA - &dquot;Lightweight and High Performance WebServer. <tt>boa</tt> is a single-tasking HTTP server. That means that unlike traditional web servers, it does not fork for each incoming connection, nor does it fork many copies of itself to handle multiple connections. It internally multiplexes all of the ongoing HTTP connections, and forks only for CGI programs (which must be separate processes.) Preliminary tests show boa is capable of handling several hundred hits per second on a 100 MHz Pentium.&dquot; + +<item> +MGR - a graphical windows system, which uses much less resources than X. + +<item> +Low Bandwidth X: +<p> +Alan Cox in LINUX REDUX February 1998 &dquot; .. there are two that handle <it>normal</it> applications very nicely. LBX (Low Bandwidth X) is the <it>official</it> application of the X Consortium (now OpenGroup www.opengroup.org). Dxpc <url url="http://ccwf.cc.utexas.edu/~zvonler/dxpc" name="http://ccwf.cc.utexas.edu/~zvonler/dxpc"> is the alternative most people prefer. These systems act as proxy X11 servers and compress datastreams by well over 50 percent for normal requests, often reaching a reduction to 25 percent of the original bandwidth usage. With dxpc, X windows applications are quite usable over a 28.8 modem link or across the Internet.&dquot; + +<item> +blackbox - &dquot;This is a window manager for X. It is similar in many respects to such popular packages as Window Maker, Enlightenment, and FVWM2. You might be interested in this package if you are tired of window managers that are a heavy drain on your system resources, but you still want an attractive and modern-looking interface.&dquot; + +<item> +xfce - <url url="http://www.xfce.org" name="xfce"> is a lightweight and stable desktop environment for various UNIX systems. + +<item> +linux-lite - distribution based on a 1.x.x kernel for systems with only 2MB memory and 10MB harddisk. URL see above. + +<item> +smallLinux - <url url ="http://smalllinux.netpedia.net/" name=" http://smalllinux.netpedia.net/"> . Three disk micro-distribution of Linux and utilities. Based on kernel 1.2.11. Root disk is ext2 format and has <tt>fdisk</tt> and <tt>mkfs.ext2</tt> so that a harddisk install can be done. Useful to boot up on old machines with less than 4MB of RAM. + +<item> +cLIeNUX - client-use-oriented Linux distribution. + +<item> +minix - not a Linux but a UNIX useful for very small systems, such as 286 CPU and 640K RAM <url url="http://www.cs.vu.nl/~ast/minix.html" name="http://www.cs.vu.nl/~ast/minix.html"> . There is even X support named mini-x by David I. Bell <url url="ftp://ftp.linux.org.uk/pub/linux/alan/" name="ftp://ftp.linux.org.uk/pub/linux/alan/"> . + +<item> +<tt>screen</tt> - tiny but powerful console manager. John M. Fisk <fiskjm@ctrvax.vanderbilt.edu> in LINUX GAZETTE July 1, 1996 :&dquot;It's a GUI, GUI, GUI, GUI world! &dquot; -- or so the major OS manufacturers would have you belief. Truth is, that while this is increasingly the case, there are times when the command line interface (CLI) is still a very good choice for getting things done. It's fast, generally efficient, and is a good choice on memory or CPU constrained machines. And don't forget that there are still a lot of very nifty things that can be done <it>at the console</it>.&dquot; + +<item> +tinyirc - &dquot;A tiny, stripped down IRC Client. Doesn't have most of the more advance commands in the ircII family of IRC Clients, nor does it have any color, but it works, and it's tiny.&dquot; + +</enum> + +<sect1>Hardware Upgrade +<p> +You may also take into account to upgrade the hardware itself, though this may have some caveats, see chapter Open a Laptop Case above. If you need a survey about the possibilities, you can take a look at <url url="http://www.upgrade.de" name="http://www.upgrade.de">, this page is also available in French and English. + +<sect>Appendix C - NeoMagic Chip NM20xx +<p> +<sect1>Introduction +<p> +Hence the NeoMagic chipset series NM20xx is one of the most used graphic chips in laptops in our times, I will spent a few words on them. Though a long time this chip was only supported by commercial X servers, since the middle of 1998 RedHat provided a binary X server manufactured by PrecisionInsight. Since version 3.3.3 this X server is also available by XFree86. + +<sect1>Textmode 100x37 +<p> +This chapter is a courtesy of Cedric Adjih <htmlurl url="mailto:cedric.adjih@inria.fr" name="< cedric.adjih@inria.fr >">. I changed some minor parts. +<p> +An apparently little known fact about the Neomagic chipset NM20xx is that you can run text mode in 100x37 (i.e. 800x600). This text mode is very nice (as opposed to the 80x25 which is ugly). I tried this with a HP OmniBook 800 and suppose it might work with other laptops using the NeoMagic chip, too. The following that I wrote was much longer than I expected so I wrote it as a kind of mini-howto :-) : + +The main problem is that is a bit difficult to set up, and if you're going wrong with SVGATextMode/restoretextmode some results on the LCD might be frightening. Although I didn't manage to break my LCD with many many attempts going wrong, DISCLAMER: THIS MIGHT DAMAGE YOUR HARDWARE. YOU HAVE BEEN WARNED. FOLLOW THE FOLLOWING INSTRUCTIONS AT YOUR OWN RISKS. I'M NOT RESPONSIBLE IF SOMETHING BAD HAPPENS. + +<sect2>Survey +<p> +You need to do <it>three</it> main steps: +<enum> +<item> +Enable Linux to boot in 800x600 textmode. The problem is that you won't see any text before the following two steps aren't done.</item> + +<item> +Automatically run <tt>restoretextmode</tt> with correct register data.</item> + +<item> +Automatically run <tt>SVGATextMode</tt>.</item> +</enum> + + +<sect2>More Details +<p> +All the files I have modified, are available for now at <url url="http://starship.python.net/crew/adjih/data/cda-omni-trick.tar.gz" name="http://starship.python.net/crew/adjih/data/cda-omni-trick.tar.gz"> + +<sect3>Enabling Linux to Boot in 800x600 +<p> +Recent kernels (2.2.x) need to be compiled with CONFIG_VIDEO_GFX_HACK defined. Default is off. (look in <file>/usr/src/linux-2.2.x/arch/i386/boot/video.S</file>) + +This is done by passing the parameter <tt>vga=770</tt> to older kernels or <tt>vga=7</tt> to 2.2.x kernels. Example with <file>lilo.conf</file>: + +<code> +image=/boot/bzImage-modif +label=22 +append=&dquot;svgatextmode=100x37x8_SVGA&dquot; #explained later +vga=7 +read-only +</code> + +<sect3>Running <tt>restoretextmode</tt> and <tt>SVGATextMode</tt> at Boot Time +<p> +You must arrange to run <tt>restoretextmode <name of some textreg.dat file></tt> and <tt>SVGATextMode 100x37x8_SVGA</tt> at boot time. + +An example <file>textreg.dat</file> for restoretextmode (obtained using <tt>savetextmode</tt>) is in my tar archive in <file>tmp/</file>, and an example <file>/etc/TextConfig</file>. + +Since I'm lazy, I've simply put <tt>SVGATextMode</tt> and <tt>restoretextmode</tt> in the <file>/etc/rc.boot/kbd</file> file from my Debian/GNU Linux which get executed at boot time (also available in the tar archive). + +<sect3>Now the Key Point +<p> +Annoying things will be displayed if you don't use the right SVGATextMode in the right video text mode: this is why I also pass the environmental variable <tt>&dquot;svgatextmode=100x37x8_SVGA&dquot;</tt> (arbitrary name) to the kernel (using append=xxx in lilo.conf) when I also set <tt>vga=7</tt>: the script <file>/etc/rc.boot/kbd</file> tests this variable and calls <tt>restoretextmode</tt> and <tt>SVGATextMode</tt> IF AND ONLY IF. + +<sect2>Road Map +<p> +<enum> +<item> +Recompile the kernel 2.2.x with CONFIG_VIDEO_GFX_HACK</item> + +<item> +Insert the restoretextmode with the correct parameter in the initialisation script, with no other changes.</item> + +<item> +Boot with normal text mode (80x25) but restoretextmode: you should see the screen going to 100x37, but with only 80x25 usable. Don't use SVGATextMode yet.</item> + +<item> +It is much better to conditionnalize your initialize code as I did, to keep the possibility of booting in both modes: you may test this now with some reboots (starting restoretextmode or not).</item> + +<item> +Boot with 100x37 text mode using parameter <tt>vga=7</tt> (lilo.conf), you should see white background at some point, but the characters will be black on black. This is ok. You'll have to reboot blindly now.</item> + +<item> +Insert the <path>/SVGATextMode 100x37x8_SVGA after the restoretextmode in initialization scripts.</item> + +<item> +Reboot with <tt>vga=7</tt> (lilo.conf)</item> + +<item> +Should be OK now. Enjoy.</item> +</enum> + +<sect>Appendix D - Annotated Bibliography +<p> +<itemize> + +<item> +Linux guides and HOWTOs, available at the Linux Documentation Project (LDP) <url url="http://metalab.unc.edu/LDP" name="http://metalab.unc.edu/LDP"> . These sources of information are highly recommended. + +<item> +I found two books about PC hardware which contain a dedicated chapter about repairing laptops. + +Author: Scott Mueller + +Title: Upgrading and Repairing PCs + +Publisher: QUE Corporation. + +Author: Marc Misani + +Title: The Complete Hardware Upgrade and Maintainance Guide + +Publisher: unknown + +Both books don't know about Linux and both are quite short about laptops. The book by Marc Minasi provides a little more information about laptops. + +<item> +Authors: Alessandro Rubini, Andy Oram +Title: Linux Device Drivers + +<item> +Author: Stephen J. Bigelow + +Title: Maintain and Repair Your Notebook, Palmtop, or Pen Computer + +Publisher: McGraw Hill Text, September 1993 + +Review by Booknews, Inc. , January 1, 1994: A guide to performing routine maintenance and simple repairs to notebook, palmtop and pen computers. Covers such topics as how to diagnose and replace faulty LCD and plasma displays, and how to protect circuitry from electrostatic damage. Written with beginners in mind -- but some hardware experience would be helpful in understanding the subtleties and cautions involved. Annotation copyright Book News, Inc. Portland, Or. Though this book seems outdated I don't know a newer one. + +<item> +Author: Frank van Gilluwe + +Title: The Undocumented PC + +Publisher: Addison Wesley Developers Press + +Review by Craig Hart: There are two editions. Edition 1 has a purple cover, edition 2 has a grey marble background photo with brown-on-yellow text panel. Edition 2 is not much better than edition one - only about 10%; of the information has changed, although a lot of typographical errors have been corrected. This is an excellent book, because it not only lists the <it>raw</it> data required to program something, but it has lot's of explanations, how-to's and example programs. + +<item> +Authors: <url url="http://www.reischl.com" name="Gerald Reischl"> / Heinz Sundt + +Title: Die mobile Revolution + +Publisher: Frankfurt: Ueberreuter 1999 + +Some speculations about the future of mobile communication. + +</itemize> + +<sect>Appendix E - Resources for Specific Laptops +<p> +Certain laptops have found some more enthusiastic Linux users, than other models. This list is probably not comprehensive: + +<sect1>IBM ThinkPad +<p> +ThinkPad Configuration Tool for Linux <url url="http://jhunix.hcf.jhu.edu/~thood/tpctlhome.htm" name="tpctl"> +<p> +Mailing list <url url="http://www.topica.com/lists/linux-thinkpad/" name="linux-thinkpad">. + +<sect1>Toshiba Laptops +<p> +<url url="http://www2.prestel.co.uk/hex/toshiba.html" name="Toshiba Linux Utilities "> This is a set of Linux utilities for controlling the fan, supervisor passwords, and hot key functions of Toshiba Pentium notebooks. There is a KDE package <it>Klibreta</it>, too. +<p> +See also <url url="http://www.buzzard.org.uk/toshiba/" name="Toshiba Linux Utilities"> +<p> +Mailing lists: <url url="http://www.onelist.com/subscribe.cgi/linux-on-portege" name="linux-on-portege"> , Linux on Toshiba Satellite 40xx linux-tosh-40xx <majordomo@geekstuff.co.uk>. +<p> +Toshiba itself offers now <url url="http://www.tce.co.jp/linux/" name=" Toshiba Linux Support">. + +<sect1>COMPAQ Concerto Aero +<p> +<url url="http://www.inetdirect.net/stg/pen/chris/concerto.html" name="COMPAQ Concerto Fan's Home Page"> and <url url="http://www.reed.edu/~pwilk/aero/aero.faq" name="Aero-FAQ">. +<p> +The latest version of the <url url="http://www.cs.nmsu.edu/~pfeiffer/#pen" name="Linux Compaq Concerto Pen Driver"> is available from Joe Pfeiffer's home page. + +<sect1>DELL Laptops +<p> +Mailing list at <url url="http://www.egroups.com/group/linux-dell-laptops" name="linux-dell-laptops"> + +</article> + diff --git a/LDP/retired/Linux+XFS-HOWTO.sgml b/LDP/retired/Linux+XFS-HOWTO.sgml new file mode 100644 index 00000000..4d5cef55 --- /dev/null +++ b/LDP/retired/Linux+XFS-HOWTO.sgml @@ -0,0 +1,632 @@ +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> +<!-- for extra DocBook help check http://www-106.ibm.com/developerworks/linux/library/l-docbk.html --> + +<article> + <articleinfo> + <title>Linux + XFS HOWTOLinux on Steroids + + Russel + Ingram + +
+ ringram@gargoylecc.com +
+
+
+ + v1.1, May 12, 2002 + + + + v1.1 + 2002-05-12 + ri + + Updated sgi cvs info to match current state; made various changes/clarifications based on reader feedback + + + + v1.02 + 2001-10-08 + ri + + Added some note, blockquote and ulink tags. + Corrected error in command section of "Finishing Up". + Changed note about e2fsprogs-devel to refer to libuuid. + + + + v1.01 + 2001-10-04 + ri + + Corrected error in "Finishing up" section; various formatting changes + + + + + + This document describes how to build a Linux system that runs + on top of the SGI XFS journaling filesystem. + + + + + Introduction + + Introduction to XFS for Linux + +This document describes how to build a Linux system that runs + on top of the SGI XFS journaling filesystem. From the XFS FAQ: "XFS + is a journalling filesystem developed by SGI and used in SGI's IRIX + operating system. It is now also available under GPL for linux. It + is extremely scalable, using btrees extensively to support large + sparse files, and extremely large directories. The journalling capability + means no more waiting for fsck's or worrying about meta-data corruption." + Essentialy XFS is the filesystem SGI designed for its highend server + systems, hence the subtitle of this document, "Linux on Steroids". + :-) + + + + Foreword, Feedback, & Credits + +As a fairly new member of the Irix System Administrator community + I have fallen in love with the robustness of the filesystem that + has been developed to support Irix (XFS of course). So, needless + to say I've been following the porting effort to Linux for quite + some time and have dreamed of being able to run my Linux systems + on top of an all XFS filesystem since the beginning. The project + has come to a point (actually nearly a year ago at the time of this + writing) that this could actually be a reallity. However, as is + the case with a great deal of programming/porting projects, the documentation + for such task is not always as readily available or easy to follow + as one might hope. This document is an attempt to remedy that situation. + + + +The information contained in this document is based on messages + from Jason Walker and Russell Cattelan taken from the XFS development + mailing list, information gathered from various places on the SGI + Open Source Development web site, and from my own experiences setting + up such a system. + + +Please feel free to email me at ringram@gargoylecc.com if you + have any corrections or if any imformation/URLs/etc. is missing. + The more feedback I get on this HOWTO the more helpful it will be + for all. + + +The latest version of this document can be found at + +Gargoyle Computer Consulting + . + + + + Copyright & Disclaimer + +This document is copyright(c) 2001 Russel Ingram and it is a + FREE document. You may redistribute it under terms of the GNU General + Public License. + + +The information contained in this document is, to the best of + Russel's knowledge, correct. However, the XFS Linux port is written + by humans and thus, there is the chance that mistakes, bugs, etc. + might happen from time to time. + + +No person, group, or other body is responsible for any damage + on your computer(s) and any other losses by using the information + in this document. i.e. + + + + + + +THE AUTHOR IS NOT RESPONSIBLE FOR ANY DAMAGES INCURRED DUE TO + ACTIONS TAKEN BASED ON THE INFORMATION IN THIS DOCUMENT. + + + + + + Preparation for XFS Installation + + Downloading the Linux 2.4.x-XFS Kernel Source + +Currently the only place to get the source code for the XFS enabled + Linux kernel is straight from SGI's Open Source Development site + via CVS. + + + Note + two distinct trees are available: + + + linux-2.5-xfs: development tree + + + linux-2.4-xfs: stable bug fix only tree + + + + + + My experience has been with the 2.4 tree, but I imagine everything +will work the same with the development tree. Both trees are kept +in sync with their respective mainline kernel tree at least to the +point of major release numbers. + + +Here are the steps to download the kernel source tree: + + + +A. Normally the linux kernel source is installed in the /usr/src + directory, so you should start off by switching to that directory. + + + +$ cd /usr/src + + + +B. Next, you should set the CVSROOT environment variable so that + it points to the proper cvs server. + + + + +If you are running sh, bash, ksh, etc...: + +$ export CVSROOT=':pserver:cvs@oss.sgi.com:/cvs' + + + + + +If you are running csh or tcsh: + +$ setenv CVSROOT :pserver:cvs@oss.sgi.com:/cvs + + + + + +If you plan on updating your kernel often (to keep up with the + latest changes) you might want to put this in your login script. + + + +C. Then log in to the cvs server. + + + +$ cvs login (the password is "cvs") + + + +This needs to be done only ONCE, not everytime you access CVS. + + + +D. Now grab linux-2.4-xfs. The first time you will want to do + something like: + + + +$ cvs -z3 co linux-2.4-xfs + + + +After you have checked the code out, you can use: + + + +$ cvs -z3 update linux-2.4-xfs + + + +to update your copy to the latest version from the CVS server. + + + + + XFS Support as Modules or Compiled Into the Kernel? + +The option to build XFS support for the Linux kernel as modules + is available and will work (or so I am told) with the help of an + initial RAM disk and a couple of additions to the lilo configuration. + I have not tried this (yet), so I will not include documentation + on how this is done other than just to qoute from a message to the + development mailing list from Russell Cattelan: + +
+ + + RussellCattelan + + + +Actually running xfs as a module isn't very hard. in the + directory cmd/xfs/misc there is a modified mkinitrd the will always + generate a ram disk with pagebuf xfs_support and xfs. + + +Once that is done just add the initrd line in lilo.conf AND + + + +append = "ramdisk_size=25000" + + + +The default size is 4096 which isn't nearly large enough to hold + xfs. + + +This is from my laptop. + + + +punch[12:57am]-=>mount +/dev/ide/host0/bus0/target0/lun0/part8 on / type xfs (rw,noatime) +none on /proc type proc (rw) +/dev/ide/host0/bus0/target0/lun0/part6 on /boot type ext2 (rw,noatime) +none on /dev/pts type devpts (rw,mode=0620) +/dev/ide/host0/bus0/target0/lun0/part1 on /mnt/windows type vfat (rw,nosuid,nodev,umask=0) +/dev/ide/host0/bus0/target0/lun0/part9 on /blam type xfs (rw) + +punch[12:57am]-=>lsmod +Module Size Used by +autofs 13180 1 (autoclean) +usb-uhci 24918 0 (unused) +usbcore 35339 0 [usb-uhci] +3c59x 25149 1 (autoclean) +maestro 29757 0 (unused) +soundcore 6085 2 [maestro] +vfat 13075 1 (autoclean) +fat 37733 0 (autoclean) [vfat] +xfs 447888 2 +xfs_support 13954 0 [xfs] +pagebuf 39935 2 [xfs] + + +image=/boot/vmlinuz-2.4.0-XFS-test13-pre4 +label=t13p4 +root=/dev/hda8 +initrd=/boot/initrd-2.4.0-XFS-test13p4.img +append="ramdisk_size=25000" +read-only + + +
+ +It seems to me that compiling the support into the kernel would + be much simpler, so that is how I am doing it at this point. I will + try it as a module at a later time and add more detailed instructions + then. If anyone has time to document this method before I get around + to it please email it to me and I will include it with credit given + where credit is due. :-) + +
+
+ + Kernel Configuration and Installation + + Configuring your kernel for XFS support + + Note + + If you have never configured and compiled a new linux kernel + you might consider reading the Linux Kernel HOWTO before doing this + step. It can be found at the + + Linux Documentation Project (LDP) + + or one of its mirrors. + + + +After having downloaded the cvs source tree the actual kernel + source will be in /usr/src/linux-2.4-xfs(-beta)/linux, so you should + switch to that directory before running the make config command of + your choice. The main things that must be included in your kernel + to provide XFS support are "Page Buffer support" and (duh) + "SGI XFS filesystem support." Both options are available + in the "File systems" section of the kernel configuration. + You will need to have "Prompt for development and/or incomplete + code/drivers" selected under "Code maturity level options" + for those options to be available to you. Optionally, you may also + want to select "Enable XFS Debug mode" and "Enable + XFS Vnode Tracing" under "SGI XFS filesystem support." + These options may slow your XFS implementation some, but may be useful + in tracing the cause of a crash if a crash occurs. + + + + Building the kernel and modules + +As with any kernel build, the following commands must be run + to actually build the new kernel: + + + +$ make dep +$ make bzImage +$ make modules + + + + + Installing the new kernel and modules + +Again this is standard for any kernel installation: + + + +$ make modules_install +$ cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.0-XFS + + + + + Add a new entry to your lilo configuration and re-install lilo + + + +$ vi /etc/lilo.conf + + + +Add a new image section to your lilo.conf file similar to the + following: + + + +image=/boot/vmlinuz-2.4.0-XFS label=xfs read-only root=/dev/hda2 + + + +The "root=" line should match the "root=" + line from the existing image sections in your lilo.conf file. Don't + forget to run lilo when you're through editing lilo.conf to make + the changes effective. + + + + Build and install the XFS utilities + +There are a number of tools that come with the XFS filesystem that allow +you to build and manage your XFS filesystems that must be built as well. +These tools are in the /usr/src/linux-2.4-xfs(-beta)/cmd/xfsprogs directory. + + + Note + These tools rely on the /usr/lib/libuuid.a shared library. If you + do not have this library installed you will need it in order for + the XFS utilities to compile. You can find the rpm package for + your version of Linux from Rpmfind.net by searching for "/usr/lib/libuuid.a." The debian package that contains libuuid is uuid-dev. There will no doubt be other distributions that package this library in another place. A good way to find the correct package on those distributions is to search on the Google Linux search engine. + + + + +Change to that directory: + + + +$ cd ../cmd/xfsprogs + + + +Build and install the xfs utilities: + + + +$ make install + + + + + Boot the new kernel + + +$ reboot + + + + Note + + Unless you changed the default label to boot in your lilo.conf + file you will need to enter "xfs" at the "LILO Boot:" + prompt in order to boot the new kernel image. + + + + + + Filesystem Migration + +The final part of this whole process is probably actually the + trickiest and most dangerous as far as the possibility of losing + your data goes. I strongly suggest that you make a complete backup + of the system (or at least all important data) before attempting + the migration to XFS. This part is also the most difficult to explain + as there are probably hundreds of ways you can do this based on + the set up of your existing filesystem. I will give you the basic + commands for creating the new filesystems, try to give some pointers + on how to go about shuffling filesystems, and in general just relay + to you the way I went about migrating my own filesystems. + + + Migrating the / filesystem + +Probably the trickiest part of creating a fully XFS system is + migrating the / filesystem since that is the system that supports + the entire rest of the system and it cannot actually be unmounted + while the system is running. If you have extra partitions that + can be mounted as / then you will be able to do it something like + this(I am using /dev/hda4 as the spare partition and /dev/hda2 as + / for this example): + + + +$ mkfs -t ext2 /dev/hda4 +$ mkdir /mnt/temp +$ mount -t ext2 /dev/hda4 /mnt/temp +$ cd / +$ tar lcf - .|(cd /mnt/temp; tar xpvf - ) + + + +Notice I have used tar here to copy the files from the / fs to + the spare partition. Alternatively you could use cp -dpR, but if + you use tar like I've shown here with the -l flag it will copy only + files from within the / fs (i.e. if you have another partition mounted + as /usr it won't copy those). + + +The next step will be to change all references to /dev/hda2 to + /dev/hda4 in /etc/fstab and in /etc/lilo.conf and run lilo. You'll + then need to reboot the system again. + + +After rebooting the system /dev/hda4 will be mounted as / and + your original / filesystem (/dev/hda2) will not be mounted. You + can now create the new XFS filesystem on /dev/hda2. + + + +$ mkfs -t xfs /dev/hda2 + + + +Then mount the new xfs fs: + + + +$ mount -t xfs /dev/hda2 /mnt/temp + + + +And copy the original / fs back to its original home: + + + +$ cd / +$ tar lcf - .|(cd /mnt/temp; tar xpvf -) + + + +Once again you will need to change all instances of /dev/hda4 + in /etc/fstab and /etc/lilo.conf and run lilo. You will also need + to change the filesystem type for / in /etc/fstab. It should now + look something like this: + + + +/dev/hda2 / xfs defaults 1 1 + + + + Note + + On some linux distributions the options given to the out-of-box + fstab may be more in depth than just "defaults." For + instance, on Debian systems they use "defaults,errors=remount-ro." + The mount options are different for every filesystem with the exception + of the keyword "defaults." Unless you know the specific + XFS mount options you want you should stick with just the defaults + option. In the Debian example given, the errors option is not available + with XFS and will cause your filesystem not to mount. + + + Additionally, filesystem labels are becoming more popular so you may see an + entry in your fstab that looks something like this: + +LABEL=/ / ext2 defaults 1 1 + + The easiest way to avoid problems is to simply replace the referenced label + with the proper device file name (i.e. if /dev/hda1 is labeled / replace "LABEL=/" + with "/dev/hda1"). + + + +Now reboot the system with the new xfs / filesystem. + + +Of course there are a lot of other ways to accomplish the root + filesystem migration and if you think you have a good one I would + definitely like to hear it and will put it in this doc if it seems + like a simpler way than what is here. I, myself, didn't have a + spare partition to work with but had a CD burner so I burnt a cd + of my root filesystem to mount as root while I created the new xfs + /. In all cases, however, the basic commands for creating and mounting + the new filesystem will be the same. + + + + Finishing up + +The last of the process is fairly simple and essentially the + same process of swapping around partitions while making new filesystems + as was done for /. I recommend that you do the rest of this process + with the system in single user mode so you can unmount everything + other than / and do all of the swapping without having to reboot + a million times. You can boot to single user mode by either issueing + a runlevel change command to the init process like so: + + + +$ telinit 1 + + + +or by rebooting and asking for single user mode at the Lilo prompt: + + + + +LILO Boot: xfs single + + + +This will boot the system and drop you into a root shell with + no outside connections or virtual terminals so there is no chance + of any of the filesystems being in use by other users or processes + (causing them to be busy so you can't unmount them). Now you can + mount the spare partition, as before, copy one of the remaining filesystems + to be migrated onto it (you will probably have to remove the existing + contents leftover from /), unmount the old filesystem, create the + xfs filesystem on it, remount it as xfs, and copy the old filesystem + back onto it. Lets say you have a /dev/hda3 partition mounted as + /usr. The process would go something like this: + + + +$ mount -t ext2 /dev/hda4 /mnt/temp +$ cd /usr +$ tar lcf - .|(cd /mnt/temp; tar xpvf - ) +$ cd /mnt/temp +$ umount /usr +$ mkfs -t xfs /dev/hda3 +$ mount -t xfs /dev/hda3 /usr +$ tar lcf - .|(cd /usr; tar xpvf - ) + + + +Don't forget to change the filesystem type in /etc/fstab for + /usr to xfs. + + +That's all there is to it. The rest of the filesystems to be + migrated will work the same way, then you can reboot to full miltiuser + mode and you've got your "Linux on Steroids!" + + + +
diff --git a/LDP/retired/Loopback-Encrypted-Filesystem-HOWTO.sgml b/LDP/retired/Loopback-Encrypted-Filesystem-HOWTO.sgml new file mode 100644 index 00000000..65d54277 --- /dev/null +++ b/LDP/retired/Loopback-Encrypted-Filesystem-HOWTO.sgml @@ -0,0 +1,400 @@ + + + + +
+ + + +Loopback Encrypted Filesystem HOWTO +<author>Copyright by Ryan T. Rhea, +<tt/rhear@cs.winthrop.edu/ +<date>v1.1, 29 November 1999 + +<abstract> +This document explains how to setup and then use a filesystem +that, when mounted by a user, dynamically and transparently +encrypts its contents. The filesystem is stored in a regular +file, which can be hidden or named non-conspicuously such that it +would most likely be overlooked. This allows for a high level of +secure storage of data. +<p> +<bf>Archived Document Notice:</bf> This document has been archived by the LDP +because it does not apply to modern Linux systems. It is no longer +being actively maintained. +</p> +</abstract> + +<!-- Table of contents --> +<toc> + +<!-- Begin the document --> + +<sect>Before you begin + +<p> +This process requires the kernel source code, knowledge of +compiling this +code, and a lot of patience. I highly recommend having a boot +disk ready. +Also, be sure to have a backup before you permanently store your +important +data on the encrypted filesystem - it can be corrupted like any +other +filesystem. + +As a minimum, you will have to patch to at least version 2.2.9 of +the linux +kernel before continuing. There are further instructions on +applying patches +in the <ref id="Details"> section later in this document. + +Kernel source can be found at: + +<tscreen> +<url url="ftp://ftp.kerneli.org/"> +</tscreen> + +There is a HOWTO on the process of recompiling kernels at: + +<tscreen> +<url url="http://metalab.unc.edu/LDP/HOWTO/"> +</tscreen> + +This document may be reproduced and distributed in whole or in +part, without fee, subject to the following conditions: + +<itemize> +<item>The copyright notice and this permission notice must be +preserved complete on all complete or partial copies. + +<item>Any translation or derived work must be approved by the +author +in writing before distribution. + +<item>If you distribute this work in part, instructions for +obtaining +he complete version of this manual must be included, and a means +for obtaining a complete version provided. + +<item>All source code in this document is placed under the GNU +General Public License, available via anonymous FTP from: +</itemize> + +<tscreen> +<url url="ftp://prep.ai.mit.edu/pub/gnu/COPYING/"> +</tscreen> + +<sect>Introduction + +<p> +The process uses the device '/dev/loop*' (where * can be 0-7 on +most installations) to mount a loopback filesystem. The same +process can be used without encryption to store a linux +filesystem on a non-linux partition. There is a HOWTO on this at +the LDP site mentioned previously. + +Different types of encryption can be used, including XOR, DES, +twofish, blowfish, cast128, serpent, MARS, RC6, DFC, and IDEA. +The program 'losetup' (loopback setup) is what associates your +encrypted file with a filesystem and it's cipher type. According +to Alexander +Kjeldaas, who maintains kerneli.org and the international crypto +patches, DES +and losetup are currently incompatible. This is due to +differences in the way +the two handle parity bits. There are no plans to support DES as +it is much +more insecure than the other ciphers. + +Twofish, blowfish, cast128, and serpent are all licensed free for +any use. +The others may or may not have licensing restrictions. Several +of them are +candidates for the AES standard. The finalists will provide +royalty free use +of their ciphers worldwide. + +This document uses the serpent algorithm because it is strong yet +remarkably fast, and it's freely distributable under the GPL. +According to +it's documentation, serpent uses a 128-bit block cipher designed +by Ross +Anderson, Eli Biham and Lars Knudsen. It provides users with the +highest +practical level of assurance that no shortcut attacks will be +found. The +documentation on serpent as well as the source code can be found +at: + +<tscreen> +<url url="http://www.cl.cam.ac.uk/~rja14/serpent.html"> +</tscreen> + +Also, this document assumes that the ciphers are compiled +directly into the +kernel. You may install them as modules, but the technique is +not discussed +in this document. You will have to edit the file +'/etc/conf.module'; the +process is discussed in detail in the kernel compilation HOWTO +referenced previously. + +<sect>Summary + +<p> +There are many steps involved in the process. I will provide +<ref id="Details"> for these steps in the next section. I thought +it would +be nice to provide a summary first to provide reference (if you +are experienced with unix/linux you probably don't need the +details anyway). Here they are summarized as follows: + +<enum> +<item>Download the newest international crypto patch (I used +'patch-int-2.2.10.4' at the time this document was written) from: + +<p><tscreen> +<url url="http://ftp.kerneli.org/pub/kerneli/"> +</tscreen> + +<p><item>Patch the kernel + +<p><item>Run 'config' (or 'menuconfig' or 'xconfig') to configure +your +'MakeFile' for the new kernel. The options to enable encryption +are +scattered. First of all, before you will see any other options +you must +enable 'Prompt for development and/or incomplete code/drivers' +under 'Code +Maturity level options'. Under 'Crypto options' enable 'crypto +ciphers' and +'serpent'. Once again, this document assumes you are using +serpent, but try +whatever you want. Remember that DES is known to be incompatible +as of +2.2.10.4 - it may never be supported at all. There are several +important options to select under 'Block Devices'. These include +'Loopback +device support', 'Use relative block numbers as basis for +transfer functions +(RECOMMENDED)', and 'General encryption support'. DO NOT select +'cast 128' or +'twofish' encryption here. Also note that you don't need any of +the crypto +options under the various network categories. I will not go any +further into +configuration of the kernel, it is out of the scope of this +document and can +be found at the LDP site. + +<p><item>Compile the new kernel. + +<p><item>Edit '/etc/lilo.conf' to add the new kernel image. Run +'lilo -v' to +add the kernel to the boot loader. + +<p><item>Download the source for the newest 'util-linux' (I used +'util-linux-2.9v') package from: + +<p><tscreen> +<url url="ftp://ftp.kernel.org/pub/linux/utils/util-linux/"> +</tscreen> + +<p><item>Extract the 'util-linux' source. + +<p><item>Apply the corresponding patch found in your +'/usr/src/linux/Documentation/crypto/' directory. + +<p><item>CAREFULLY read the 'INSTALL' file! This package +contains the +sources for many system dependent files (important tools such as +'login', 'passwd', and 'init'). If you don't carefully edit the +MCONFIG +file before compiling these sources have a boot disk and/or +shotgun ready +because your system will be quite confused. Basically you want +to set almost +all of the 'HAVE_*' fields equal to yes so that the important +authentication +tools are not compiled and written over. The tools you do want +rebuilt +are 'mount' and 'losetup' to accommodate the new encryption +schemes. I +suggest that you refer to the <ref id="Details"> section below +for this step. + +<p><item>Compile and install the 'util-linux' source + +<p><item>Reboot the machine with the new kernel. + +<p><item>Edit '/etc/fstab', adding an entry for your mount point +as follows: + +<p><tscreen><code> +/dev/loop0 /mnt/crypt ext2 user,noauto,rw,loop 0 0 +</code></tscreen> + +<p><item>Create the directory that will hold your filesystem, as +in +'/mnt/crypt' above. + +<p><item>As the user, create your encrypted file as follows: + +<p><tscreen><verb> +dd if=/dev/urandom of=/etc/cryptfile bs=1M count=10 +</verb></tscreen> + +<p><item>Run losetup as follows: + +<p><tscreen><verb> +losetup -e serpent /dev/loop0 /etc/cryptfile +</verb></tscreen> + +You only have one chance to enter the password, be careful. If +you want to +double-check your password, you can use the command: + +<p><tscreen><verb> +losetup -d /dev/loop0 +</verb></tscreen> + +This will deactivate your loop device. Next you will run losetup +again to +test your password, as follows: + +<p><tscreen><verb> +losetup -e serpent /dev/loop0 /etc/cryptfile +</verb></tscreen> + +<p><item>Make your ext2 filesystem as follows: + +<p><tscreen><verb> +mkfs -t ext2 /dev/loop0 +</verb></tscreen> + +<p><item>Now you can mount the encrypted filesystem with: + +<p><tscreen><verb> +mount -t ext2 /dev/loop0 /mnt/crypt +</verb></tscreen> + +<p><item>When your done, you want to unmount and protect your +filesystem as +follows: + +<p><tscreen><verb> +umount /dev/loop0 +losetup -d /dev/loop0 +</verb></tscreen> + +</enum> + + +<sect>Details<label id="Details"> + +<p><bf/Kernel Patches:/ + +You can upgrade from '2.2.x' releases by patching. Each patch +that is released for '2.2.x' contains bugfixes. New features +will be added to the Linux '2.3.x' development kernel. To +install by patching, get all the newer patch files and do the +following: + +<tscreen><verb> +cd /usr/src +gzip -cd patchXX.gz | patch -p0 +</verb></tscreen> + +Repeat xx for all versions bigger than the version of your +current source tree, IN ORDER. + +The default directory for the kernel source is '/usr/src/linux'. +If your source is installed somewhere else, I would suggest using +a symbolic link from '/usr/src/linux'. + + +<p><bf/Editing 'MCONFIG' for the 'util-linux' package +compilation:/ + +The following are excerpts from the 'MCONFIG' file I used to +compile the 'util-linux' package. Note that this is fairly +specific for my setup, which is loosely based on RedHat 5.2. The +point is to make sure you don't overwrite any important system +tools such as 'login', 'getty', or 'passwd'. Anyway, here are +the +important lines as follows: + +<tscreen><code> +CPU=$(shell uname -m | sed s/I.86/intel/) + +LOCALEDIR=/usr/share/locale + +HAVE_PAM=no + +HAVE_SHADOW=yes + +HAVE_PASSWD=yes + +REQUIRE_PASSWORD=yes + +ONLY_LISTED_SHELLS=yes + +HAVE_SYSVINIT=yes + +HAVE_SYSVINIT_UTILS=yes + +HAVE_GETTY=yes + +USE_TTY_GROUP=yes + +HAVE_RESET=yes + +HAVE_SLN=yes + +CC=gcc +</code></tscreen> + +<p><bf/Suggestions:/ + +Note that you could use any of the eight loopback devices, from +'dev/loop0' +to '/dev/loop7'. Use an inconspicuous directory for the mount +point. I would +suggest creating a folder with 700 permissions inside your home +folder. The +same goes for the file that holds the data. I use a filename +like 'sysfile' +or 'config.data' inside the '/etc' folder. This will usually get +overlooked. + +I created very simple Perl scripts to mount and unmount the +filesystem with one command. Write these, make them executable +(chmod u+x), and store them somewhere in your path. + +<tscreen><code> +#!/usr/bin/perl -w +# +#minimal utility to setup loopback encryption filesystem +#Copyright 1999 by Ryan T. Rhea +`losetup -e serpent /dev/loop0 /etc/cryptfile`; +`mount /mnt/crypt`; +</code></tscreen> + +Name the above script 'loop', and then you can be on your way +with one command ('loop') and a password. + +<tscreen><code> +#!/usr/bin/perl -w +# +#minimal utility to deactivate loopback encryption filesystem +#Copyright 1999 by Ryan T. Rhea +`umount /mount/crypt`; +`losetup -d /dev/loop0`; +</code></tscreen> + +Name the second one 'unloop', and then typing 'unloop' will +quickly deactivate your filesystem. + +</article> diff --git a/LDP/retired/Loopback-Root-FS.sgml b/LDP/retired/Loopback-Root-FS.sgml new file mode 100644 index 00000000..8e35cac8 --- /dev/null +++ b/LDP/retired/Loopback-Root-FS.sgml @@ -0,0 +1,743 @@ +<!DOCTYPE LINUXDOC SYSTEM> + +<article> + +<title>The Loopback Root Filesystem HOWTO +<author>by Andrew M. Bishop, <tt><htmlurl url="mailto:amb@gedanken.demon.co.uk" name="amb@gedanken.demon.co.uk"></tt> +<date>v1.1, 24 September 1999 + +<abstract> +This HOWTO explains how to use the Linux loopback device to create a Linux +native filesystem format installation that can be run from a DOS partition +without re-partitioning. Other uses of this same technique are also discussed. +</abstract> + +<toc> + +<sect>Introduction + +<p> + +<sect1>Copyright + +<p> +The Loopback Root Filesystem HOWTO +Copyright (C) 1998,99 Andrew M. Bishop (amb@gedanken.demon.co.uk). + +This documentation is free documentation; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +The GNU General Public License is available from <htmlurl url="http://www.fsf.org/" name="http://www.fsf.org/"> +or, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA + +<sect1>Revision History + +<p> +<descrip> +<tag>Version 1.0.0</tag>Initial Version (June 1998) +<tag>Version 1.0.1-1.0.3</tag>Slight Modifications, kernel version changes, typos etc. (1998 - July 1999) +<tag>Version 1.1</tag>Added Copyright Information and Re-Submitted (September 1999) +</descrip> + +<sect>Principles of Loopback Devices and Ramdisks + +<p> +First I will describe some of the general principles that are used in the +setting up of a loopback filesystem as the root device. + + +<sect1>Loopback Devices + +<p> +A <bf>loopback device</bf> in Linux is a virtual device that can be used like any +other media device. + +<p> +Examples of normal media devices are hard disk partitions like +<tt>/dev/hda1</tt>, <tt>/dev/hda2</tt>, <tt>/dev/sda1</tt>, or entire disks like +the floppy disk <tt>/dev/fd0</tt> etc. They are all devices that can be used to +hold a files and directory structures. They can be formatted with the +filesystem that is required (ext2fs, msdos, ntfs etc.) and then mounted. + +<p> +The loopback filesystem associates a file on another filesystem as a complete +device. This can then be formatted and mounted just like any of the other +devices listed above. To do this the device called <tt>/dev/loop0</tt> or +<tt>/dev/loop1</tt> etc is associated with the file and then this new virtual +device is mounted. + + +<sect1>Ramdisk Devices + +<p> +In Linux it is also possible to have another type of virtual device mounted as a +filesystem, this is the <bf>ramdisk device</bf>. + +<p> +In this case the device does not refer to any physical hardware, but to a +portion of memory that is set aside for the purpose. The memory that is +allocated is never swapped out to disk, but remains in the disk cache. + +<p> +A ramdisk can be created at any time by writing to the ramdisk device +<tt>/dev/ram0</tt> or <tt>/dev/ram1</tt> etc. This can then be formatted and +mounted in the same way that the loopback device is. + +<p> +When a ramdisk is used to boot from (as is often done on Linux installation +disks or rescue disks) then the disk image (the entire contents of the disk as a +single file) can be stored on the boot floppy in a compressed form. This is +automatically recognised by the kernel when it boots and is uncompressed into +the ramdisk before it is mounted. + + +<sect1>The Initial Ramdisk Device + +<p> +The <bf>initial ramdisk</bf> device in Linux is another important mechanism that +we need to be able to use a loopback device as a the root filesystem. + +<p> +When the initial ramdisk is used the filesystem image is copied into memory and +mounted so that the files on it can be accessed. A program on this ramdisk +(called <tt>/linuxrc</tt>) is run and when it is finished a different device is +mounted as the root filesystem. The old ramdisk is still present though and is +mounted on the directory <tt>/initrd</tt> if present or available through the +device <tt>/dev/initrd</tt>. + +<p> +This is unusual behaviour since the normal boot sequence boots from the +designated root partition and keeps on running. With the initial ramdisk option +the root partition is allowed to change before the main boot sequence is +started. + + +<sect1>The Root Filesystem + +<p> +The root filesystem is the device that is mounted first so that it appears as +the directory called <tt>/</tt> after booting. + +<p> +There are a number of complications about the root filesystem that are due to +the fact that it contains all files. When booting the <tt>rc</tt> scripts are +run, these are either the files in <tt>/etc/rc.d</tt> or <tt>/etc/rc?.d</tt> +depending on the version of the <tt>/etc/init</tt> program. + +<p> +When the system has booted it is not possible to unmount the root partition or +change it since all programs will be using it to some extent. This is why the +initial ramdisk is so useful because it can be used so that the final root +partition is not the same as the one that is loaded at boot time. + + +<sect1>The Linux Boot Sequence + +<p> +To show how the initial ramdisk operates in the boot sequence, the order of +events is listed below. + +<p> +<enum> +<item>The kernel is loaded into memory, this is performed by <tt>LILO</tt> or +<tt>LOADLIN</tt>. You can see the <tt>Loading...</tt> message as this happens. +<item>The ramdisk image is loaded into memory, again this is performed by +<tt>LILO</tt> or <tt>LOADLIN.</tt> You can see the <tt>Loading...</tt> message +again as this happens. +<item>The kernel is initialised, including parsing the command line options and +setting of the ramdisk as the root device. +<item>The program <tt>/linuxrc</tt> is run on the initial ramdisk. +<item>The root device is changed to that specified in the kernel parameter. +<item>The init program <tt>/etc/init</tt> is run which will perform the user +configurable boot sequence. +</enum> + +This is just a simplified version of what happens, but is sufficient to explain +how the kernel starts up and where the initial ramdisk is used. + + +<sect>How To Create a Loopback Root Device + +<p> +Now that the general principles are explained the method of creating the +loopback device can be explained. + + +<sect1>Requirements + +<p> +To create the loopback root device will require a number of things. + +<p> +<itemize> +<item>A working Linux system. +<item>A way to copy large files onto the target DOS partition. +</itemize> + +Most important is access to an installed Linux system. This is because the loop +device can only be created under Linux. This will mean that it is not possible +to bootstrap a working system from nothing. The requirements of the Linux +system that you use is that you can compile a kernel on it. + +<p> +Once the loopback device is created it will be a large file. I have used an 80 +MB files, but while this was sufficient for an X terminal it may not be enough +if you want to use it for much else. This file must be copied onto the DOS +partition, so either a network or a lot of floppy disks must be used. + +<p> +The software that you will require includes + +<itemize> +<item><tt>LOADLIN</tt> version 1.6 or above +<item>A version of <tt>mount</tt> that supports loopback devices +<item>A version of the kernel that supports the required options. +</itemize> + +All of these should be standard for recent Linux installations. + + +<sect1>Creating the Linux Kernel + +<p> +I created the loopback device using Linux kernel version 2.0.31, other versions +should also work, but they must have at least the options listed below. + +<p> +The kernel options that you will need to enable are the following: +<itemize> +<item>RAM disk support (<tt>CONFIG_BLK_DEV_RAM</tt>). +<item>Initial RAM disk (initrd) support (<tt>CONFIG_BLK_DEV_INITRD</tt>). +<item>Loop device support (<tt>CONFIG_BLK_DEV_LOOP</tt>). +<item>fat fs support (<tt>CONFIG_FAT_FS</tt>). +<item>msdos fs support (<tt>CONFIG_MSDOS_FS</tt>). +</itemize> + +The first two are for the RAM disk device itself and the initial ram disk +device. The next one is the loop back filesystem option. The last two are the +msdos filesystem support which is required to mount the DOS partitition. + +<p> +Compiling a kernel without modules is the easiest option, although if you do +want modules then it should be possible although I have not tried it. If +modules are used then you should make sure that you have the options above +compiled in and not as modules themselves. + +<p> +Depending on the kernel version that you have you may need to apply a kernel +patch. It is a very simple one that allows the loopback device to be used as +the root filesystem. +<itemize> +<item>Kernel versions before 2.0.0; I have no information about these. +<item>Kernel version 2.0.0 to 2.0.34; you need to apply the kernel patch for + 2.0.x kernels as shown below. +<item>Kernel version 2.0.35 to 2.0.x; no kernel patch is required. +<item>Kernel version 2.1.x; you need to apply the kernel patch for 2.0.x or + 2.2.x kernels as shown below, depending on the exact 2.1.x version. +<item>Kernel version 2.2.0 to 2.2.10; you need to apply the kernel patch for + 2.2.x kernels as shown below. +<item>Kernel version 2.3.x; you need to apply the kernel patch for 2.2.x kernels + as shown below. +</itemize> + +<p> +For 2.0.x kernels the file <tt>/init/main.c</tt> needs to have a single line +added to it as shown by the modified version below. The line that says +<tt>"loop", 0x0700</tt> is the one that was added. + +<p> +<tscreen><verb> +static void parse_root_dev(char * line) +{ + int base = 0; + static struct dev_name_struct { + const char *name; + const int num; + } devices[] = { + { "nfs", 0x00ff }, + { "loop", 0x0700 }, + { "hda", 0x0300 }, + +... + + { "sonycd", 0x1800 }, + { NULL, 0 } + }; + +... + +} +</verb></tscreen> + +<p> +For 2.2.x kernels the file <tt>/init/main.c</tt> needs to have three lines added +to it as shown by the modified version below. The line that says <tt>"loop", +0x0700</tt> and the ones either side of it are the ones that were added. + +<p> +<tscreen><verb> +static struct dev_name_struct { + const char *name; + const int num; +} root_dev_names[] __initdata = { +#ifdef CONFIG_ROOT_NFS + { "nfs", 0x00ff }, +#endif +#ifdef CONFIG_BLK_DEV_LOOP + { "loop", 0x0700 }, +#endif +#ifdef CONFIG_BLK_DEV_IDE + { "hda", 0x0300 }, + +... + + { "ddv", DDV_MAJOR << 8}, +#endif + { NULL, 0 } +}; +</verb></tscreen> + +Once the kernel is configured it should be compiled to produce a <tt>zImage</tt> +file (<tt>make zImage</tt>). This file will be <tt>arch/i386/boot/zImage</tt> +when compiled. + + +<sect1>Creating the Initial Ramdisk Device + +<p> +The initial ramdisk is most easily created as a loopback device from the start. +You will need to do this as root, the commands that you need to execute are +listed below, they are assumed to be run from root's home directory +(<tt>/root</tt>). + +<p> +<tscreen><verb> +mkdir /root/initrd +dd if=/dev/zero of=initrd.img bs=1k count=1024 +mke2fs -i 1024 -b 1024 -m 5 -F -v initrd.img +mount initrd.img /root/initrd -t ext2 -o loop +cd initrd +[create the files] +cd .. +umount /root/initrd +gzip -c -9 initrd.img > initrdgz.img +</verb></tscreen> + +There are a number of steps to this, but they can be described as follows. +<enum> +<item>Create a mount point for the initial ramdisk (an empty directory). +<item>Create an empty file of the size required. Here I have used 1024kB, you may +need less or more depending on the contents, (the size is the last parameter). +<item>Make an ext2 filesystem on the empty file. +<item>Mount the file onto the mount point, this uses the loopback device. +<item>Change to the mounted loopback device. +<item>Create the files that are required (see below for details). +<item>Move out of the mounted loopback device. +<item>Unmount the device. +<item>Create a compressed version for use later. +</enum> + +<bf>Contents Of The Initial Ramdisk</bf> + +The files that you will need on the ramdisk are the minimum requirements to be +able to execute any commands. + +<itemize> +<item><tt>/linuxrc</tt> The script that is run to mount the msdos file system +(see below). +<item><tt>/lib/*</tt> The dynamic linker and the libraries that the programs +need. +<item><tt>/etc/*</tt> The cache used by the dynamic linker (not strictly needed, +but does stop it complaining). +<item><tt>/bin/*</tt> A shell interpreter (<tt>ash</tt> because it is smaller +than <tt>bash</tt>. The <tt>mount</tt> and <tt>losetup</tt> programs for +handling the DOS disk and setting up the loopback devices. +<item><tt>/dev/*</tt> The devices that will be used. You need +<tt>/dev/zero</tt> for <tt>ld-linux.so</tt>, <tt>/dev/hda*</tt> to mount the +msdos disk and <tt>/dev/loop*</tt> for the lopback device. +<item><tt>/mnt</tt> An empty directory to mount the msdos disk on. +</itemize> + +The initial ramdisk that I used is listed below, the contents come to about +800kB when the overhead of the filesystem are taken into account. + +<p> +<tscreen><verb> +total 18 +drwxr-xr-x 2 root root 1024 Jun 2 13:57 bin +drwxr-xr-x 2 root root 1024 Jun 2 13:47 dev +drwxr-xr-x 2 root root 1024 May 20 07:43 etc +drwxr-xr-x 2 root root 1024 May 27 07:57 lib +-rwxr-xr-x 1 root root 964 Jun 3 08:47 linuxrc +drwxr-xr-x 2 root root 12288 May 27 08:08 lost+found +drwxr-xr-x 2 root root 1024 Jun 2 14:16 mnt + +./bin: +total 168 +-rwxr-xr-x 1 root root 60880 May 27 07:56 ash +-rwxr-xr-x 1 root root 5484 May 27 07:56 losetup +-rwsr-xr-x 1 root root 28216 May 27 07:56 mount +lrwxrwxrwx 1 root root 3 May 27 08:08 sh -> ash + +./dev: +total 0 +brw-r--r-- 1 root root 3, 0 May 20 07:43 hda +brw-r--r-- 1 root root 3, 1 May 20 07:43 hda1 +brw-r--r-- 1 root root 3, 2 Jun 2 13:46 hda2 +brw-r--r-- 1 root root 3, 3 Jun 2 13:46 hda3 +brw-r--r-- 1 root root 7, 0 May 20 07:43 loop0 +brw-r--r-- 1 root root 7, 1 Jun 2 13:47 loop1 +crw-r--r-- 1 root root 1, 3 May 20 07:42 null +crw-r--r-- 1 root root 5, 0 May 20 07:43 tty +crw-r--r-- 1 root root 4, 1 May 20 07:43 tty1 +crw-r--r-- 1 root root 1, 5 May 20 07:42 zero + +./etc: +total 3 +-rw-r--r-- 1 root root 2539 May 20 07:43 ld.so.cache + +./lib: +total 649 +lrwxrwxrwx 1 root root 18 May 27 08:08 ld-linux.so.1 -> ld-linux.so.1.7.14 +-rwxr-xr-x 1 root root 21367 May 20 07:44 ld-linux.so.1.7.14 +lrwxrwxrwx 1 root root 14 May 27 08:08 libc.so.5 -> libc.so.5.3.12 +-rwxr-xr-x 1 root root 583795 May 20 07:44 libc.so.5.3.12 + +./lost+found: +total 0 + +./mnt: +total 0 +</verb></tscreen> + +The only complex steps about this are the devices in <tt>dev</tt>. Use the +<tt>mknod</tt> program to create them, use the existing devices in <tt>/dev</tt> +as a template to get the required parameters. + + +<bf>The /linuxrc file</bf> + +The <tt>/linuxrc</tt> file on the initial ramdisk is required to do all of the +preparations so that the loopback device can be used for the root partition when +it exits. +<p> +The example below tries to mount <tt>/dev/hda1</tt> as an msdos partition and +if it succeeds then sets up the files <tt>/linux/linuxdsk.img</tt> as +<tt>/dev/loop0</tt> and <tt>/linux/linuxswp.img</tt> as <tt>/dev/loop1</tt>. + +<p> +<tscreen><verb> +#!/bin/sh + +echo INITRD: Trying to mount /dev/hda1 as msdos + +if /bin/mount -n -t msdos /dev/hda1 /mnt; then + + echo INITRD: Mounted OK + /bin/losetup /dev/loop0 /mnt/linux/linuxdsk.img + /bin/losetup /dev/loop1 /mnt/linux/linuxswp.img + exit 0 + +else + + echo INITRD: Mount failed + exit 1 + +fi +</verb></tscreen> + +The first device <tt>/dev/loop0</tt> will become the root device and the second +one <tt>/dev/loop1</tt> will become the swap space. + +<p> +If you want to be able to write to the DOS partition as a non-root user when you +have finished then you should use <tt>mount -n -t msdos /dev/hda1 /mnt -o +uid=0,gid=0,umask=000,quiet</tt> instead. This will map all accesses to the DOS +partition to root and set the permissions appropriately. + + +<sect1>Creating The Root Device + +<p> +The root device that you will be using is the file <tt>linuxdsk.img</tt>. You +will need to create this in the same way that the initial ramdisk was created, +but bigger. You can install any Linux installation that you like onto this +disk. + +<p> +The easiest way might be to copy an existing Linux installation into it. An +alternative is to install a new Linux installation onto it. + +<p> +Assuming that you have done this, there are some minor changes that you must +make. + +<p> +The <tt>/etc/fstab</tt> file must reference the root partition and the +swap using the two loopback devices that are setup on the initial ramdisk. + +<p> +<tscreen><verb> +/dev/loop0 / ext2 defaults 1 1 +/dev/loop1 swap swap defaults 1 1 +</verb></tscreen> + +This will ensure that when the real root device is used the kernel will not be +confused about where the root device is. It will also allow the swap space to +be added in the same way a swap partition is normally used. You should remove +any other reference to a root disk device or swap partition. + +<p> +If you want to be able to read the DOS partition after Linux has started then +you will need to make a number of extra small changes. + +<p> +Create a directory called <tt>/initrd</tt>, this is where the initial ramdisk +will be mounted once the loopback root filesystem is mounted. +<p> +Create a symbolic link called <tt>/DOS</tt> that points to <tt>/initrd/mnt</tt> +where the real DOS parition will be mounted. +<p> +Add a line into the rc file that mounts the disks. This should run the command +<tt>mount -f -t msdos /dev/hda1 /initrd/mnt</tt>, this will create a 'fake' +mount of the DOS partition so that all programs (like <tt>df</tt>) will know that +the DOS partition is mounted and where to find it. If you used different +options in the <tt>/linuxrc</tt> file that obviously you should use them here +also. + +<p> +There is no need to have a Linux kernel on this root device since that is +already loaded earlier. If you are using modules however then you should +include them on this device as normal. + + +<sect1>Creating the Swap Device + +<p> +The root device that you will be using is the file <tt>linuxswap.img</tt>. The +swap device is very simple to create. Create an empty file as was done for the +initial ramdisk and then run <tt>mkswap linuxswap.img</tt> to intialise it. + +<p> +The size of the swap space will depend on what you plan to do with the installed +system, but I would recommend between 8MB and the amount of RAM that you have. + + +<sect1>Creating the MSDOS Directory + +<p> +The files that are going to be used need to be moved onto the DOS partition. + +<p> +The files that are required in the DOS directory called <tt>C:\LINUX</tt> are +the following: + +<itemize> +<item><tt>LINUXDSK.IMG</tt> The disk image that will become the root device. +<item><tt>LINUXSWP.IMG</tt> The swap space. +</itemize> + +<sect1>Creating the Boot Floppy + +<p> +The boot floppy that is used is just a normal DOS format bootable floppy. +<p> +This is created using <tt>format a: /s</tt> from DOS. + +<p> +Onto this disk you will need to create an <tt>AUTOEXEC.BAT</tt> file (as below) +and copy the kernel, compressed initial ramdisk and <tt>LOADLIN</tt> executable. + +<itemize> +<item><tt>AUTOEXEC.BAT</tt> The DOS automatically executed batch file. +<item><tt>LOADLIN.EXE</tt> The <tt>LOADLIN</tt> program executable. +<item><tt>ZIMAGE</tt> The Linux kernel. +<item><tt>INITRDGZ.IMG</tt> The compressed initial ramdisk image. +</itemize> + +The <tt>AUTOEXEC.BAT</tt> file should contain just one line as below. + +<tscreen><verb> +\loadlin \zImage initrd=\initrdgz.img root=/dev/loop0 ro +</verb></tscreen> + +This specifies the kernel image to use, the initial ramdisk image, the root +device after the initial ramdisk has finished and that the root partition is to +be mounted read-only. + +<sect>Booting the System + +<p> +To boot from this new root device all that is required is that the floppy disk +prepared as described above is inserted for the PC to boot from. + +<p> +You will see the following sequence of events. +<enum> +<item>DOS boots +<item>AUTOEXEC.BAT starts +<item>LOADLIN is run +<item>The Linux kernel is copied into memory +<item>The initial ramdisk is copied into memory +<item>The Linux kernel is started running +<item>The <tt>/linuxrc</tt> file on the initial ramdisk is run +<item>The DOS partition is mounted and the root and swap devices set up +<item>The boot sequence continues from the loopback device +</enum> + +When this is complete you can remove the boot floppy and use the Linux system. + +<sect1>Possible Problems With Solutions + +<p> +There are a number of stages where this process could fail, I will try to +explain what they are and what to check. + +<p> +DOS booting is easy to recognise by the message that it prints <tt>MS-DOS +Starting ...</tt> on the screen. If this is not seen then the floopy disk is +either not-bootable or the PC is not bootable from the floppy disk drive. + +<p> +When the <tt>AUTOEXEC.BAT</tt> file is run the commands in it should be echoed +to the screen by default. In this case there is just the single line in the +file that starts <tt>LOADLIN</tt>. + +<p> +When <tt>LOADLIN</tt> executes it will do two very visible things, firstly it +will load the kernel into memory, secondly it will copy the ramdisk into memory. +Both of these are indicated by a <tt>Loading...</tt> message. + +<p> +The kernel starts by uncompressing itself, this can give <bf>crc</bf> errors if +the kernel image is corrupted. Then it will start running the initialisation +sequence which is very verbose with diagnostic messages. Loading of the initial +ramdisk device is also visible during this phase. + +<p> +When the <tt>/linuxrc</tt> file is run there is no diagnostic messages, but you +can add these yourself as an aid to debugging. If this stage fails to set up +the loopback device as the root device then you may see a message that there is +no root device and the kernel aborts. + +<p> +The normal boot sequence of the new root device will now continue and this is +quite verbose. There may be problems about the root device being mounted +read-write, but the <tt>LOADLIN</tt> command line option '<tt>ro</tt>' should +stop that. Other problems that can occur are that the boot sequence is confused +about where the root device is, this is probably due to a problem with +<tt>/etc/fstab</tt>. + +<p> +When the boot sequence has completed, the remaining problem is that programs are +confused about whether the DOS partition is mounted or not. This is why it is a +good idea to use the fake mount command described earlier. This makes life a +lot easier if you want to access the files on the DOS device. + + +<sect1>Reference Documents + +<p> +The documents that I used to create my first loopback root filesystem were: + +<p> +<itemize> +<item>The Linux kernel source, in particular <tt>init/main.c</tt> +<item>The Linux kernel documentation, in particular +<tt>Documentation/initrd.txt</tt> and <tt>Documentation/ramdisk.txt</tt>. +<item>The <tt>LILO</tt> documentation. +<item>The <tt>LOADLIN</tt> documentation +</itemize> + + +<sect>Other Loopback Root Device Possibilities + +<p> +Once the principle of booting a filesystem in a file on a DOS partition has been +established there are many other things that you can now do. + + +<sect1>DOS Hard-disk Only Installation + +<p> +If it is possible to boot Linux from a file on a DOS harddisk by using a boot +floppy then it is obviously also possible to do it using the harddisk itself. +<p> +A configuration boot menu can be used to give the option of running +<tt>LOADLIN</tt> from within the <tt>AUTOEXEC.BAT</tt>. This will give a much +faster boot sequence, but is otherwise identical. + + +<sect1>LILO Booted Installation + +<p> +Using <tt>LOADLIN</tt> is only one option for booting a Linux kernel. There is +also <tt>LILO</tt> that does much the same but without needing DOS. +<p> +In this case the DOS format floppy disk can be replaced by an ext2fs format one. +Otherwise the details are very similar, with the kernel and the initial ramdisk +being files on that disk. +<p> +The reason that I chose the <tt>LOADLIN</tt> method is that the arguments that +need to be given to <tt>LILO</tt> are slightly more complex. Also it is more +obvious to a casual observer what the floppy disk is since it can be read under +DOS. + + +<sect1>VFAT / NTFS Installation + +<p> +I have tried the NTFS method, and have had no problems with it. The NTFS +filesystem driver is not a standard kernel option in version 2.0.x, but is +available as a patch from <htmlurl +url="http://www.informatik.hu-berlin.de/~loewis/ntfs/" +name="http://www.informatik.hu-berlin.de/~loewis/ntfs/">. In version 2.2.x the +NTFS driver is included as standard in the kernel. +<p> +The only changes for the VFAT or NTFS options are in the initial ramdisk, the +file <tt>/linuxrc</tt> needs to mount a file system of type vfat or ntfs rather +that msdos. +<p> +I know of no reason why this should not also work on a VFAT partition. + + +<sect1>Installing Linux without Re-partitioning + +<p> +The process of installing Linux on a PC from a standard distribution requires +booting from a floppy disk and re-partitioning the disk. This stage could +instead be accomplished by a boot floppy that creates an empty loopback device +and swap file. This would allow the installation to proceed as normal, but it +would install into the loopback device rather than a partition. +<p> +This could be used as an alternative to a <tt>UMSDOS</tt> installation, it would +be more efficient in disk usage since the minimum allocation unit in the ext2 +filesystem is 1kB instead of up to 32kB on a DOS partition. It can also be used +on VFAT and NTFS formatted disks which are otherwise a problem. + + +<sect1>Booting From a Non-bootable device + +<p> +This method can also be used to boot a Linux system from a device that is not +normally bootable. + +<p> +<itemize> +<item>CD-Rom +<item>Zip Disks +<item>Parallel port disk drives +</itemize> + +Obviously there are many other devices that could be used, NFS root filesystems +are already included in the kernel as an option, but the method described here +might also be used instead. + +</article> diff --git a/LDP/retired/MGR-HOWTO.sgml b/LDP/retired/MGR-HOWTO.sgml new file mode 100644 index 00000000..73783b00 --- /dev/null +++ b/LDP/retired/MGR-HOWTO.sgml @@ -0,0 +1,601 @@ +<!doctype linuxdoc system> +<article> +<title>The MGR Window System HOWTO +<author>Vincent Broman +</author> +<date>v0.1, 1996-05-30 +<abstract> +Information on the installation, configuration and running of the MGR Window +System. +<p> +<bf>Archived Document Notice:</bf> This document has been archived by the LDP +because it does not apply to modern Linux systems. It is no longer +being actively maintained. +</p> +</abstract> + +<toc> + +<sect>This HOWTO +<p><verb> + Copyright Vincent Broman 1995. + Permission granted to make and distribute copies of this HOWTO + under the conditions of the GNU General Public License.</verb> + <sect1>Archiving +<p> + This HOWTO is archived in + <tt>ftp://archimedes.nosc.mil/pub/Mgr/MGR-HOWTO.sgml</tt>, + and also distributed from + <tt>ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/MGR-HOWTO</tt>. + In nearby directories the same document may appear in + alternate formats like <tt>MGR-HOWTO.txt</tt>. + <sect1>Authentication +<p> + Copies of the MGR distribution due to Broman should be accompanied + by PGP signature files, signed by "Vincent Broman <broman@nosc.mil>". + <sect1>Credit for the HOWTO +<p> + While Vincent Broman first put together this HOWTO, + much of the information and text was obtained from FAQs, + READMEs, etc. written by Stephen Uhler, Michael Haardt, + and other public-spirited net-persons. + Email corrections and suggested changes to <tt>broman@nosc.mil</tt>. + + Uhler was the main architect of <bf>MGR</bf> -- see the Credit section below. + +<sect>What is the MGR window system? +<p> + <sect1>Function +<p> + <bf>MGR</bf> (ManaGeR) is a graphical window system. + The <bf>MGR</bf> server + provides a builtin window manager and windowed graphics terminal + emulation on color and monochrome bitmap displays. <bf>MGR</bf> is + controlled by mousing pop-up menus, by keyboard interaction, and by + escape sequences written on pseudo-terminals by client software. +<p> + <bf>MGR</bf> provides each client window with: termcap-style terminal + control functions, graphics primitives such as line and circle + drawing; facilities for manipulating bitmaps, fonts, icons, and + pop-up menus; commands to reshape and position windows; and a + message passing facility enabling client programs to rendezvous + and exchange messages. Client programs may ask to be informed + when a change in the window system occurs, such as a reshaped + window, a pushed mouse button, or a message sent from another + client program. These changes are called events. + <bf>MGR</bf> notifies a + client program of an event by sending it an ASCII character string + in a format specified by the client program. Existing + applications can be integrated into the windowing environment + without modification by having <bf>MGR</bf> imitate keystrokes in response + to user defined menu selections or other events. + + <sect1>Requirements +<p> + <bf>MGR</bf> currently runs on Linux, FreeBSD, + Sun 3/4 workstations with SunOS, and + Coherent. Various older versions of <bf>MGR</bf> run on the Macintosh, + Atari ST MiNT, Xenix, 386-Minix, DEC 3100, and the 3b1 Unix-pc. + Many small, industrial, real-time systems under OS9 or Lynx in Europe + use (another variant of) Mgr for their user interface. + The programming interface is implemented in C and in ELisp, + although supporting clients written in other languages is quite + easy. + + Running <bf>MGR</bf> requires much less in resources than X, or even gcc. + It does not have the user-base, software repertory, or high-level + libraries of X or MS-Windows, say, but it is quite elegant + and approachable. + + It has been said that <bf>MGR</bf> is to X as Unix was to Multics. + + <sect1>How do MGR, X11, and 8.5 compare? +<p> + <bf>MGR</bf> consists of a server with builtin window manager and terminal + emulator, and clients which run in this terminal emulator and use it + to communicate with the server. No resource multiplexing is done. + + X11 consists of a server and clients, which usually connect to the + server using a socket. All user visible things like terminal + emulators, window managers etc are done using clients. No resource + multiplexing is done. + + 8.5, the Plan 9 window system, is a resource multiplexer, as each + process running in a window can access <tt>/dev/bitblt</tt>, + <tt>/dev/mouse</tt> and + <tt>/dev/kbd</tt> in its own namespace. These are multiplexed to the + <tt>/dev/bitblit</tt>, <tt>/dev/mouse</tt> and <tt>/dev/kbd</tt> + in the namespace of 8.5. + This approach allows one to run 8.5 in an 8.5 window, + a very clean design. 8.5 further has an integrated window manager + and terminal emulator. + +<sect>Installing MGR +<p> + The latest source distribution can be FTPed from the directory + <tt>ftp://archimedes.nosc.mil/pub/Mgr/69</tt> + or Mosaiced from <tt>http://archimedes.nosc.mil/Mgr/69</tt>. + The same should be found at + <tt>ftp://sunsite.unc.edu/pub/Linux/apps/MGR</tt> and its mirrors. + Older versions of this distribution + from Haardt can be found on <tt>tsx-11.mit.edu</tt> and perhaps elsewhere. + Pre-Linux versions of <bf>MGR</bf> from Uhler and others have been found at + <tt>ftp://bellcore.com/pub/mgr</tt>, but I think they are gone now. + I have saved a copy of everything about <bf>MGR</bf> seen on the Internet, + but I am not aware of anything weighty + that is missing from this Linux/Sun distribution. + <bf>MGR</bf> has been through a lot of versions and releases, + but the current *Linux* version number is 0.69. This version number + could jump to 1.0 when stable 256-color VGA code for Linux appears + (for more than one video card type). + RCS version numbers have increased from Bellcore's 4.3 up to our 4.13 now. + + Required tools to build this distribution of <bf>MGR</bf> are m4 (GNU, or + perhaps another supporting the -D option), make (GNU, or perhaps + another supporting include) and *roff for the docs. Also sh, + awk, and POSIX install. Binary distributions are not assembled often + so you need an ANSI C compiler environment, e.g. gcc. + + A Linux installation requires Linux 0.99.10 or better + (1.2.13 is what I actually test on now), + an HGC, EGA, VGA, or SVGA graphics card, and a mouse. Mouses supported + are: serial Microsoft mouse, serial MouseSystems 3 and 5 byte + mouse, serial MMSeries mouse, serial Logitech mouse, PS/2 mouse, + or a bus mouse. + With Buckey (Meta) hot keys enabled, even a mouseless system could + do a certain amount of useful work under <bf>MGR</bf>. + The VGA 640x480 monochrome graphics mode is + supported out of the box, as is 640x350 and 640x200. To run + 800x600, or other modes that your BIOS can initialize and which + do not require bank-switching, you need to run a small program + (supplied as <tt>src/vgamisc/regs.exe</tt>) + under DOS or an emulator to read the VGA registers + and write a header file which you place in the + directory <tt>src/libbitblit/linux</tt>, + so that it can be <tt>#include</tt>'d + by the <tt>vga.c</tt> file there. + Samples of these files are supplied, but please create your own. + Some VGA cards can use 128k + windows, and these might run higher monochrome resolutions. + + The Linux-colorport code also runs in the standard + 320x200x256 color VGA mode without difficulty, because no bank switching + is required. If you think of how few 64000 pixels is, you would + realize this color mode is quite limited. + Non-fast, but simple, bank-switching code has + been added in version 0.65, and it works with a Tseng ET4000 card + in 640x480x256 and 800x600x256 modes. The S3 code does not + work in super VGA resolutions, yet. Supporting new super VGA cards + requires writing one function to switch banks and then making sure that + the desired screen mode can be initialized from a register dump, + possibly with hand-tweaking. The Linux color servers generally + mangle the screen fonts, necessitating use of restorefont as in runx. + If someone were to extract the VGA initialization code out of X, + this might make MGR work on a lot more color systems. + + Suns with SunOS 4.1.2+ and <tt>bwtwo</tt>, <tt>cgthree</tt>, or + <tt>cgsix</tt> frame buffers are supported. + Their speed handling color is good. + Coherent installations should refer to the + <tt>Versions/README.Coh</tt> file in the source distribution. + Porting the + latest-and-greatest <bf>MGR</bf> to another POSIX-like system which + provides <tt>select()</tt> and pty's and direct access to a bitmapped + frame-buffer ought to be straightforward, just implementing the + <tt>libbitblit</tt> library based on the <tt>sunmono</tt> or + <tt>colorport</tt> code, say. + + If you want to install everything, you need 7 MB disk space for + binaries, fonts, manual pages etc. The sources are about 4.5 MB, + plus object files during compilation. + + Normally, <tt>/usr/mgr</tt> should be either the directory or a link to the + directory where you install <bf>MGR</bf> stuff for runtime use. Typing +<tscreen><verb> +cd /usr/mgr; tar xvfz whereveryouputit/mgrusr-0.69.tgz +</verb></tscreen> + and optionally +<tscreen><verb> +cd /usr/mgr; tar xvfz wherever/morefonts-0.69.tgz +</verb></tscreen> + will unpack these. The source can be put anywhere, e.g. typing +<tscreen><verb> +cd /usr/src/local/mgr; tar xvfz wherever/mgrsrc-0.69.tgz +</verb></tscreen> + to unpack the sources from <tt>archimedes.nosc.mil</tt>. + + The source tree can be compiled from one top-level Makefile which + invokes lower-level Makefiles, all of which &dquot;include&dquot; + a <tt>&dquot;Configfile&dquot;</tt> + at the top level. The <tt>Configfile</tt> is created by an interactive sh + script named <tt>Configure</tt>, which asks you questions, + then runs m4 on a <tt>Configfile.m4</tt>. + So you type something like this: + +<tscreen><verb> +chdir /usr/src/local/mgr +sh ./Configure +make first +make depend +make install +make clean +</verb></tscreen> + + It might be wise, before running make, to eyeball the <tt>Configfile</tt> + generated by the <tt>Configure</tt> script, checking that it looks reasonable. + (At least one m4 poops out (Sun <tt>/usr/bin/m4</tt>), + creating a very short <tt>Configfile</tt>. + If this happens, try hand editing a copy of <tt>Configfile.sun</tt> or + <tt>Configfile.lx</tt>) + One can also <tt>make all</tt> in any directory with a Makefile + as soon as the libraries have been compiled and installed. + The server, libraries, and some clients have been linted, but several + clients are K&R C code that generates many compiler warnings. +<p> + Several flags in MGRFLAGS can be added/omitted in the Configfile + to change some + optional features in the server, viz: +<descrip> +<tag/-DWHO/ muck utmp file so &dquot;who&dquot; works +<tag/-DVI/ code for clicking the mouse in vi moving the cursor +<tag/-DDEBUG/ enable debugging output selectable with -d options. +<tag/-DFASTMOUSE/ XOR the mouse track +<tag/-DBUCKEY/ for hot-key server commands without mousing +<tag/-DPRIORITY/ for priority window scheduling instead of + round-robin; the active window gets higher priority +<tag/-DCUT/ for cut/paste between windows and a global snarf buffer +<tag/-DMGR_ALIGN/ forces window alignment for fast scrolling (monochrome) +<tag/-DKILL/ kills windows upon tty i/o errors +<tag/-DSHRINK/ use only some of the screen ($MGRSIZE in environment) +<tag/-DNOSTACK/ don't permit event stacking +<tag/-DBELL/ audibly ring the bell +<tag/-DKBD/ read <tt>mgr</tt> input from the sun kbd, instead of stdin. + This permits redirection of console msgs to a window. +<tag/-DFRACCHAR/ fractional character movement for proportional fonts +<tag/-DXMENU/ extended menu stuff (experimental) +<tag/-DMOVIE/ movie making extension which logs all operations to a + file for later replay -- not quite working under Linux +<tag/-DEMUMIDMSBUT/ Emulate a missing middle mouse button by chording +</descrip> + Not all combinations of these options have been tested on all systems. + + The BITBLITFLAGS macro should contain <tt>-DBANKED</tt> if you're trying + out the super VGA color. +<p> + C code for the static variables in the server containing icons and fonts + is generated by a translator from icon and font files. + + Not all the clients are compiled and installed by the Makefiles. + Clients found under <tt>src/clients</tt> having capitalized names or + not compiled by the supplied Makefiles may have problems compiling + and/or running, but they may be interesting to hack on. + Most of the screen drivers found under the <tt>libbitblit</tt> directory are + of mainly archeological interest. Grave robbing can be profitable. +<p> + At some point check that your <tt>/etc/termcap</tt> and/or + <tt>terminfo</tt> file + contain entries for <bf>MGR</bf> terminals such as found in the <tt>misc</tt> + directory. If all your software checks $TERMCAP in the environment, + this is not needed, as long as you run <tt>eval `set_termcap`</tt> + in each window. +<p> + <bf>MGR</bf> works better if run setuid root, because it wants to chown + ptys and write in the utmp file. This helps the ify iconifier + client work better and the event passing mechanism be more secure. + On Linux, root permissions are <em>required</em> in order to do in/out on the + screen device. Otherwise, you decide whether to trust it. +<p> + In versions around 0.62 there are troubles on the Sun with using + the csh as the default shell. Programs seem to run in a different + process group than the foreground process group of the window's pty, + in contradiction to man pages and posix specs. + There is no trouble with bash, sh, or rc. Ideas why? + +<sect>Running MGR +<p> + The only file <em>required</em> in an <bf>MGR</bf> installation is the server + itself. That would give you terminal emulator windows with shells + running in them and cutting and pasting with the mouse, + but no nice clocks, extra fonts, fancy graphics, + etc. Depending on options, a monochrome server needs about 200K of RAM + plus dynamic space for windows, bitmaps, etc. +<p> + If <tt>/usr/mgr/bin</tt> is in your PATH, + then just type &dquot;<tt>mgr</tt>&dquot; to start up. + After enjoying the animated startup screen, press any key. + When the hatched background and mouse pointer appear, hold down + the left mouse button, highlight the &dquot;new window&dquot; menu item, and + release the button. Then drag the mouse from corner to corner + where you want a window to appear. The window will have your + default shell running in it. Hold down the left mouse button over + an existing window to see another menu for doing things to that + window. Left-clicking on an obscured window raises it to the top. + The menu you saw that pops-up over the empty background + includes the quit command. + For people with a two button mouse: + press both buttons together to emulate the missing middle button + used by some clients. +<p> + The quit submenu includes the &dquot;really quit&dquot; option, + a suspend option which should only be used if you run a + job-control shell, and a screen saver and locker option, which + waits for you to type your login password when you come back + to your machine. +<p> + When trying to run <bf>MGR</bf>, if you get: +<descrip> +<tag/can't find the screen/ + make sure you have a <tt>/dev</tt> entry for your display device, + e.g. on + a Sun <tt>/dev/bwtwo0</tt>. If not, as root cd to <tt>/dev</tt>, and type + &dquot;MAKEDEV bwtwo0&dquot;. Otherwise, you might need the + <tt>-S/dev/bwtwo0</tt> + or (on Linux) the <tt>-S640x480</tt> command line option when starting <tt>mgr</tt>. + On Linux, you might also make sure that <tt>/usr/mgr/bin/mgr</tt> was + installed setuid root. + +<tag/can't find the mouse/ + make sure <tt>/dev/mouse</tt> exists, usually as a symbolic link to the + real device name for your mouse. If you haven't permission to + write in <tt>/dev</tt>, then something like a <tt>-m/dev/cua0</tt> + option can be + given when starting <tt>mgr</tt>. Also, make sure you've supplied the + right mouse protocol choice when you configured <tt>mgr</tt>. The mouse + may speak Microsoft, even if that is not the brand name. + +<tag/can't get a pty/ + make sure all of <tt>/dev/[tp]ty[pq]?</tt> + are owned by root, mode 666, + and all programs referenced with the &dquot;shell&dquot; option in + your <tt>.mgrc</tt> startup file (if any) exist and are executable. + +<tag/none but the default font/ + make sure <bf>MGR</bf> is looking in the right + place for its fonts. Check the <tt>Configfile</tt> in the source or + see whether a <tt>-f/usr/mgr/font</tt> option to <tt>mgr</tt> fixes the problem. + +<tag/completely hung (not even the mouse track moves)/ + login to your machine from another terminal (or rlogin) and kill the + <tt>mgr</tt> process. + A buckey-Q key can quit <bf>MGR</bf> if the keyboard still works. +</descrip> + + <sect1>Applications not aware of MGR +<p> + Any tty-oriented application can be run in an <bf>MGR</bf> window + without further ado. Screen-oriented applications using + termcap or curses can get the correct number of lines and + columns in the window by your using <tt>shape(1)</tt> + to reshape the window or using + <tt>set_termcap(1)</tt> to obtain the correct termcap entry. + + <sect1>MGR Applications (clients) distributed with the server +<p> +<descrip> +<tag/bdftomgr/ converts some BDF fonts to MGR fonts +<tag/browse/ an icon browser +<tag/bury/ bury this window +<tag/c_menu/ vi menus from C compiler errors +<tag/clock/ digital display of time of day +<tag/clock2/ analog display of time of day +<tag/close/ close this window, iconify +<tag/color/ set the foreground and background color for text in this window +<tag/colormap/ read or write in the color lookup table +<tag/cursor/ change appearance of the character cursor +<tag/cut/ cut text from this window into the cut buffer +<tag/cycle/ display a sequence of icons +<tag/dmgr/ crude ditroff previewer +<tag/fade/ fade a home movie script from one scene to another +<tag/font/ change to a new font in this window +<tag/gropbm/ a groff to PBM driver using Hershey fonts +<tag/hpmgr/ hp 2621 terminal emulator +<tag/ico/ animate an icosahedron or other polyhedron +<tag/iconmail/ notification of mail arrival +<tag/iconmsgs/ message arrival notification +<tag/ify/ iconify and deiconify windows +<tag/loadfont/ load a font from the file system +<tag/maze/ a maze game +<tag/mclock/ micky mouse clock +<tag/menu/ create or select a pop-up menu +<tag/mgr/ bellcore window system server and window manager +<tag/mgrbd/ boulder-dash game +<tag/mgrbiff/ watch mailbox for mail and notify +<tag/mgrload/ graph of system load average +<tag/mgrlock/ lock the console +<tag/mgrlogin/ graphical login controller +<tag/mgrmag/ magnify a part of the screen, optionally dump to file +<tag/mgrmail/ notification of mail arrival +<tag/mgrmode/ set or clear window modes +<tag/mgrmsgs/ message arrival notification +<tag/mgrplot/ Unix &dquot;plot&dquot; graphics filter +<tag/mgrsclock/ sandclock +<tag/mgrshowfont/ browse through mgr fonts +<tag/mgrsketch/ a sketching/drawing program +<tag/mgrview/ view mgr bitmap images +<tag/mless/ start up less/more in separate window, menu added for less +<tag/mnew/ startup up any program in a separate, independent window +<tag/mphoon/ display the current phase of the moon +<tag/mvi/ start up vi in a separate window, with mouse pointing +<tag/oclose/ (old) close a window +<tag/omgrmail/ (old) notification of mail arrival +<tag/pbmrawtomgr, pgmrawtomgr, ppmrawtomgr/ convert raw PBM/PGM/PPM image files to mgr bitmap format +<tag/pbmstream/ split out a stream of bitmaps +<tag/pbmtoprt/ printer output from PBM +<tag/pgs/ ghostscript patch and front end, a PS viewer +<tag/pilot/ a bitmap browser, or image viewer +<tag/resetwin/ cleanup window state after client crashes messily +<tag/rotate/ rotate a bitmap 90 degrees. +<tag/screendump/ write graphics screen dump to a bitmap file +<tag/set_console/ redirect console messages to this window +<tag/set_termcap/ output an appropriate TERM and TERMCAP setting +<tag/setname/ name a window, for messages and iconifying +<tag/shape/ reshape this window +<tag/square/ square this window +<tag/squeeze/ compress mgr bitmap using run-length encoding +<tag/startup/ produce a skeleton startup file for current window layout +<tag/texmgr/ TeX dvi file previewer +<tag/text2font, font2text/ convert between mgr font format and text dump +<tag/unsqueeze/ uncompress mgr bitmap using run length encoding +<tag/vgafont2mgr, mgrfont2vga/ convert between mgr font format and VGA +<tag/window_print/ print an image of a window +<tag/zoom/ an icon editor +<tag/bounce, grav, grid, hilbert, mgreyes, stringart, walk/ graphics demos +</descrip> + + <sect1>MGR-aware clients distributed separately, see &dquot;SUPPORT&dquot; file +<p> +<descrip> +<tag/calctool/ on-screen calculator +<tag/chess/ frontend to <tt>/usr/games/chess</tt> +<tag/gnu emacs/ editor with <tt>lisp/term/mgr.el</tt> mouse & menu support +<tag/gnuplot/ universal scientific data plotting +<tag/metafont/ font design and creation +<tag/origami/ folding editor +<tag/pbmplus/ portable bitmap format conversions, manipulations +<tag/plplot/ slick scientific data plotting +</descrip> +<p> + The Emacs support in <tt>misc/mgr.el</tt> and <tt>misc/mailcap</tt> +includes very usable MIME support, via Rmail and metamail. +<p> + A general image viewer could be cobbled together from <tt>pilot</tt> +and the netPBM filters, but I have not taken the time to do it. + +<sect>Programming for MGR +<p> + The <bf>MGR</bf> programmers manual, the C language applications interface, + is found in the doc directory in troff/nroff form. It covers + general concepts, the function/macro calls controlling the server, + a sample application, with an index and glossary. + + Porting client code used with older versions of <bf>MGR</bf> sometimes + requires the substitution of +<tscreen><verb> + #include <mgr/mgr.h> +</verb></tscreen> + for +<tscreen><verb> + #include <term.h> + #include <dump.h> +</verb></tscreen> + and clients using old-style B_XOR, B_CLEAR, et al instead of + BIT_XOR, BIT_CLR, et al can be accommodated by writing +<tscreen><verb> + #define OLDMGRBITOPS + #include <mgr/mgr.h> +</verb></tscreen> + + Compiling client code generally requires compiler options like + the following. +<tscreen><verb> + -I/usr/mgr/include -L/usr/mgr/lib -lmgr +</verb></tscreen> + + One can get some interactive feel for the <bf>MGR</bf> server functions by + reading and experimenting with the <tt>mgr.el</tt> terminal driver for GNU + Emacs which implements the <bf>MGR</bf> interface library in ELisp. + + The usual method of inquiring state from the server has the + potential of stumbling on a race condition if the client also + expects a large volume of event notifications. The problem arises + if an (asynchronous) event notification arrives when a + (synchronous) inquiry response was expected. If this arises in + practice (unusual) then the <bf>MGR</bf> state inquiry functions would have + to be integrated with your event handling loop. + + The only major drawing function missing from the <bf>MGR</bf> protocol, it + seems, is an area fill for areas other than upright rectangles. + There is new code for manipulating the global colormap, as well as + (advisory) allocation and freeing of color indices owned by windows. + + If you are thinking of hacking on the server, you can find the mouse + driver in <tt>mouse.*</tt> and <tt>mouse_get.*</tt>, + the grotty parts of the keyboard + interface in <tt>kbd.c</tt>, and the interface to the display in the + <tt>src/libbitblit/*</tt> directories. The main procedure, much + initialization, and the top level input loop are in <tt>mgr.c</tt>, and the + interpretation of escape sequences is in <tt>put_window.c</tt>. + +<sect>More documentation +<p> + The programmer's manual is essential for concepts. + + Nearly all the clients supplied come with a man page which is installed + into <tt>/usr/mgr/man/man1</tt> or <tt>man6</tt>. + Other useful man pages are <tt>bitblit.3</tt>, <tt>font.5</tt>, and + <tt>bitmap.5</tt>. + There is some ambiguity in the docs in distinguishing the + internal bitmap format found in your frame-buffer and the external + bitmap format found in files, e.g. icons. + + The <tt>mgr.1</tt> man page covers command line options, commands in + the <tt>~/.mgrc</tt> startup file, mouse and menu interaction with the server, + and hot-key shortcuts available on systems with such hot-keys. + + Many of the fonts in <tt>/usr/mgr/font/*</tt> are described to some + extent in <tt>/usr/mgr/font/*.txt</tt>, e.g. <tt>/usr/mgr/font/FONTDIR.txt</tt> + gives X-style font descriptions for the fonts obtained + in .bdf format. Font names end in <tt>WxH</tt>, where <tt/W/ and <tt/H/ + are the + decimal width and height in pixels of each character box. + +<sect>Credit for MGR +<p> + Stephen Uhler, with others working at Bellcore, was the original + designer and implementer of <bf>MGR</bf>, so Bellcore has copyrighted much + of the code and documentation for <bf>MGR</bf> under the following conditions. + +<verb> + * Permission is granted to copy or use this program, EXCEPT that it + * may not be sold for profit, the copyright notice must be reproduced + * on copies, and credit should be given to Bellcore where it is due. +</verb> + + One required showing of the copyright notice is the startup title screen. + + Other credits to: +<itemize> +<item> Stephen Hawley for his wonderful icons. +<item> Tommy Frandsen for the VGA linux library. +<item> Tom Heller for his Gasblit library. +<item> Andrew Haylett for the Mouse driver code. +<item> Dan McCrackin for his gasblit->linux patches. +<item> Dave Gymer, dgymer@gdcarc.co.uk, for the Startrek effect fix. +<item> Alex Liu for first releasing a working Linux version of <bf>MGR</bf>. +<item> Lars Aronsson (aronsson@lysator.liu.se) for text2font and + an ISO8859-1 8-bit font. +<item> Harry Pulley (hcpiv@grumpy.cis.uoguelph.ca, + hcpiv@snowhite.cis.uoguelph.ca) for the Coherent port. +<item> Vance Petree & Grant Edwards & Udo Munk for their work on Hercules. +<item> Udo Munk for his work on serial mouse initialization & select. +<item> Norman Bartek & Hal Snyder at Mark Williams Co. for their help + with some bugs & with Coherent device drivers. +<item> Extra thanks to Zeyd Ben Halim for lots of helpful patches, + especially the adaptation of selection. +<item> Bradley Bosch, brad@lachman.com, for lots of patches from his 3b1 + port, which fix bugs and implement new and desirable features. +<item> Andrew Morton, applix@runxtsa.runx.oz.au, who first wrote the + cut-word code. +<item> Kapil Paranjape, kapil@motive.math.tifr.res.in, for the EGA + support. +<item> Michael Haardt for MOVIE support fixes, bug fixes, separation of the + libbitblit code into output drivers, expansion of the libmgr, and + origami folding of the code. +<item> Yossi Gil for many fonts. +<item> Carsten Emde, carsten@thlmak.pr.net.ch, for mphoon. +<item> Vincent Broman for middle mouse-button emulation, linting, Sun cgsix + support, VGA colormap acess, integration of the sunport code + into Haardt's layering scheme, font gathering, the screen saver, + and continued maintenance. +<item> Kenneth Almquist, ka@socrates.hr.att.com, for helpful bug reports. +<item> Tim Pierce, twpierce@midway.uchicago.edu, for the port to FreeBSD + 2.0R with Trident VGA. +</itemize> + + All bitmap fonts from any source are strictly public domain in the + USA. The 583 fixed-width fonts supplied with <bf>MGR</bf> were obtained + from Uhler, the X distribution, Yossi Gil, and elsewhere. + The Hershey vector fonts and the code for rendering them + are probably freely redistributable. + +</article> diff --git a/LDP/retired/MIPS-HOWTO.sgml b/LDP/retired/MIPS-HOWTO.sgml new file mode 100644 index 00000000..3ff9b6d8 --- /dev/null +++ b/LDP/retired/MIPS-HOWTO.sgml @@ -0,0 +1,1651 @@ +<!doctype linuxdoc system> +<!-- $Id: MIPS-HOWTO.sgml,v 1.1 2005/01/18 13:37:51 gferg Exp $ --> + +<article> + +<title>Linux/MIPS HOWTO +<author>Ralf Bächle, <tt/ralf@gnu.org/ +<date>May 12, 2004 +<abstract> +This FAQ describes the MIPS port of the Linux operating system, common +problems and their solutions, availability and more. It also tries to +be helpful to other people who might read this FAQ in an attempt to +find information that actually should be covered elsewhere. +</abstract> +<toc> +<sect>The home of the Linux MIPS port<p> + Linux/MIPS is a port of the widespread UNIX clone Linux to the MIPS + architecture. Linux/MIPS runs on a large number of technically very + different systems ranging from small embedded systems to large + desktop machines and servers from SGI and DEC.<p> + + Here you will find links to all the resources you need + to work with Linux on MIPS, whether you are starting out getting + Linux running on your own platform, or developing an end user + application or product based on a Linux/MIPS system. + + If you are looking for a commercial Linux product with associated + support, take a look at the <ref id="commercial" name="Commercial Linux"> page. + If you have input regarding the contents of these pages, see the + <ref id=documentation name="Documentation"> page for contact info. Webserver + contact is <htmlurl url="mailto:webmaster@linux-mips.org" + name="webmaster@linux-mips.org">. + +<p> + +<sect>Mailing lists and other net resources<p> + <sect1>Mailing lists<p> + There are two Linux/MIPS-oriented mailing lists: + + <descrip> + <tag><em>linux-mips@linux-mips.org</em><p> + This mailing list currently has the most traffic. It is especially of + interest as a good number of active developers are subscribed to this list. + + <tag><em>linux-cvs@linux-mips.org</em><p> + This is an announcement only mailing list to which a message for every CVS + commit into linux-mips.org's, CVS archive of the Linux/MIPS community, is + being sent. This allows following the development as it happens. + </descrip> + + Subscription to this lists is handled via <htmlurl + url="mailto:ecartis@linux-mips.org" name="Ecartis (ecartis@linux-mips.org)">, + just send an email with the words <em>subscribe <list-name></em>. In + order to unsubscribe, send <em>unsubscribe linux-mips</em>. + Sending the word help will reveal further secrets about the advanced use of + Ecartis. At <url url="http://www.linux-mips.org/ecartis"> you'll also find + a web-based interface to Ecartis. + + Note linux-mips.org is using the ECN TCP extension as described in + RFC 3168. The bug is known for years yet still defective firewalls + that are dropping TCP SYN packets with ECN bits set are in use. If you + can reach linux-mips.org yet don't receive any email from any of the + linux-mips.org mailing lists you may have this problem.<p> + + <p>The archives for these two lists in UNIX mbox format are located on + ftp.linux-mips.org in /pub/linux/mips/archives. A fully searchable archive + in HTML format of the above lists and some Linux/MIPS related historic + lists can be found at <url url="http://www.linux-mips.org/archives/">. + + <sect1>IRC channel.<p> + There is an IRC channel named #mipslinux for Linux/MIPS which may be found on + irc.freenode.net. + +<sect>Kernel<p> + The current version of the Linux kernel can be found on + <url url="http://www.kernel.org" name="kernel.org"> and will tend to be + somewhat ahead of the MIPS/Linux version (see CVS below) but behind in some + MIPS-specific regards. Older and more stable versions of the kernel for MIPS + are available for download - see the section on <ref id="distributions" + name="Distributions"> for locations. + + <sect1>Anonymous CVS servers.<p> + For those who always want to stay on the bleeding edge, and want to avoid + having to download patch files or full tarballs, we also have an anonymous + CVS server. Using CVS, you can checkout the Linux/MIPS source tree with + the following commands:<p> + + <verb> + cvs -d :pserver:cvs@ftp.linux-mips.org:/home/cvs login + (Only needed the first time you use anonymous CVS, the password is "cvs") + cvs -d :pserver:cvs@ftp.linux-mips.org:/home/cvs co <repository> + </verb> + where you insert linux, libc, gdb or faq for <repository>. + + There is a mailing list for information on what gets committed to this + repository. + + <sect1>Web CVS server.<p> + Via <url url="http://www.linux-mips.org/cvsweb">, you have + direct access to the new Linux/MIPS kernel sources, and a few other projects + hosted in the same CVS archive. The intuitive interface allows you to + follow the development at the click of your mouse. + +<sect><label id="distributions">Distributions.<p> + A distribution is a complete collection of kernel, user programs, toolchain + and libraries necessary to get a system up and running. It may include an + install procedure to get the files copied correctly onto the target storage + device. See the READMEs on the links below for more information. + + <sect1>Commercial Embedded<p> See the section on <ref id="commercial" + name="commercial"> distributions. + + <sect1>RedHat 7.1 based<p> A complete distribution based on RedHat's 7.1, + ported by H.J. Lu, can be found at <url + url="ftp://ftp.linux-mips.org/pub/linux/mips/redhat/7.1/">. + + <sect1>Maciej W. Rozycki<p> A little-endian only distribution is maintained + by <htmlurl url="mailto:macro@ds2.pg.gda.pl" name="Maciej"> at <url + url="ftp://ftp.ds2.pg.gda.pl/pub/macro/"> or the <url + url="ftp://ftp.rfc822.org/pub/mirror/ftp.ds2.pg.gda.pl/pub/macro/" + name="mirror">. + + <sect1>MIPS Technologies<p> + MIPS maintain a version of the above, including complete installable CD-ROM + images, at <url + url="ftp://ftp.mips.com/pub/linux/mips/installation/redhat7.1/">. + + <sect1>Debian<p> + A Debian distribution for both little and big endian machines can be found at + <url url="http://www.debian.org/ports/mips/">. + At the time of writing (January 2002) we are using a 2.4 kernel; kernel + code is shared with the ports being done by people from <htmlurl + url="http://www.mips.com" name="MIPS Technologies, Inc.">). + + <sect1>MIPS Technologies UK (formerly Algorithmics)<p> + Algorithmics is now part of MIPS Technologies and their Linux work is + now merged with MIPS Technologies (above). The group + wrote the floating point trap handler and emulator used in this + kernel - essential for MIPS CPUs to run floating point operations + reliably and correctly.<p> + + MIPS Technologies UK also maintain a GNU <ref id="algorithmics-gcc" + name="toolchain"> and provide both free snapshots and a commercially + supported version - worth thinking about for commercial Linux + developments. You can download the free subset (subject to + registration) from <url + url="http://www.mips.com/products/software_products.html">. + <p> + You can contact the compiler group at <url url="mailto:sde@mips.com">. + +<sect>Toolchains<p> + A toolchain is a complete collection of compiler and binutils programs and + can be run either as a cross-compiler, or native on the target (if + performance allows). + + <sect1><label id="algorithmics-gcc">MIPS SDE<p> + Not a complete distribution, just a Linux toolchain. But it's a toolchain + built and maintained for MIPS with commercial support available, and free + snapshots.<p> + + MIPS Technologies UK maintain their own source tree for the + toolchain components. They resynchronize infrequently with + mainstream GNU releases (which inevitably have bugs for minor + architectures such as MIPS) and focus on providing the most + reliable, best-performing compiler for the largest range of MIPS + CPUs.<p> + This is the same compiler which is at the heart of our + MIPS SDE embedded toolkit. You can now get it in RPM format: + <p> + Native big-endian <url +url="ftp://ftp.mips.com/pub/tools/software/sde-for-linux/sdelinux-5.01-1.mips.rpm">; + native little-endian <url url="ftp://ftp.mips.com/pub/tools/software/sde-for-linux/sdelinux-5.01-1.mipsel.rpm">; + Linux/386 cross for big-endian target <url url="ftp://ftp.mips.com/pub/tools/software/sde-for-linux/sdelinux-5.01-4eb.i386.rpm">; + and Linux/386 cross for little-endian target <url url="ftp://ftp.mips.com/pub/tools/software/sde-for-linux/sdelinux-5.01-4.i386.rpm">. + <p> + MTUK would like to hear how well it worked, so contact them on <htmlurl url="mailto:sde@mips.com">. + + <sect1>Commercial Embedded<p> + + See the section on <ref id="commercial" name="commercial"> distributions - + these all include appropriate toolchain deliverables. + + <sect1>H.J. Lu<p> + + <htmlurl url="mailto:hjl@lucon.org" name ="H.J. Lu"> distributes a toolchain + as part of his Red Hat 7.1 port. It can be found at <url + url="ftp://ftp.linux-mips.org/linux/mips/redhat/7.1/">. + + <sect1>Maciej W. Rozycki<p> + + A stable set of toolchain components provided by <htmlurl + url="mailto:macro@ds2.pg.gda.pl" name="Maciej"> can be downloaded from <url + url="ftp://ftp.ds2.pg.gda.pl/pub/macro/"> or the <url + url="ftp://ftp.rfc822.org/pub/mirror/ftp.ds2.pg.gda.pl/pub/macro/" + name="mirror">. This is based on gcc 2.95.3 (patched) and up-to-date + binutils. + + <sect1>Dan Kegel<p> + Dan Kegel has a page at <url url="http://kegel.com/crosstool/"> with a + nice script to automatize the build procedure. + +<sect>Commercial Linux<p> + + <label id="commercial">The following companies provide commercial, supported + Linux/MIPS solutions for the embedded market, on a number of different + platforms. + <itemize> + <item><url url="http://www.mvista.com/" name="MontaVista"> + <item><url url="http://www.redhat.com/" name="Red Hat"> + <item><url url="http://www.lineo.com/" name="Lineo"> + <item><url url="http://www.lynuxworks.com/" name="LynuxWorks"> + <item><url url="http://www.timesys.com/" name="TimeSys"> + <item><url url="http://www.elinos.com/" name="ELinOS"> + </itemize> + +<sect>Web resources<p> + <sect1>Webservers<p> + The following webservers are relevant for Linux/MIPS developers. + <descrip> + <tag><url url="http://www.linux-mips.org/"><p> + This server covers most of Linux/MIPS. If you need something chances are + it's already there.<p> + + <tag><url url="http://www.mips.com/content/Products/SoftwareTools/"><p> + This sites has MIPS own version of Linux/MIPS based distributions and tools + for their processors and evaluation boards.<p> + + <tag><url url="http://www.debian.org/ports/mips/"><p> + This is Debian's MIPS/Linux site.<p> + + <tag><url url="http://www.playstation2-linux.com"><p> + This is Sony's Linux/MIPS server for the Playstation 2. + Also in <url url="http://www.ps2linux.com/" name="Japanese">.<p> + + <tag><url url="http://www.ltc.com/~brad/mips/mips-cross-toolchain/"><p> + Bradley D. LaRonde's HowTo on building a cross toolchain for MIPS/Linux.<p> + + <tag><url url="http://linux.junsun.net/porting-howto/"><p> + Jun Sun's porting guide has some useful information and tips for porting to + new platforms.<p> + </descrip> + + <sect1>Anonymous FTP servers.<p> + The primary anonymous FTP servers for Linux/MIPS are + <descrip> + <tag><url url="ftp://ftp.linux-mips.org"><p> + This server should satisfy almost all of your Linux/MIPS related ftp + desires. Really.<p> + <tag><url url="ftp://ftp.mips.com/pub/linux"><p> + This is the server of MIPS, Inc. itself. Among other things it offers a + recent Redhat-based distribution and a support area for MIPS' evaluation + boards.<p> + <tag><url url="ftp://ftp.ds2.pg.gda.pl/pub/macro/"><p> + Maciej W. Rozycki's FTP server.<p> + </descrip> + + <sect1>The Linux-VR project<p> + <label id="linux-vr"> + The Linux VR project has worked on support for a variety of NEC VR41xx, + Toshiba TMPR39xx and Philips PR3170-based systems. Most of this code has + been merged into the Linux/MIPS CVS tree. The projects web pages which + used to be at <em>www.linux-vr.org</em> are now archived at + <url url="http://www.linux-mips.org/linux-vr/">.<p> + The Linux-VR CVS archive is at + <url url="http://www.linux-mips.org/cvsweb/linux-vr">; it can also be + checked out by CVS. + +<sect>Supported Hardware platforms + <label id="hardware-platforms"> + <p>Check also the section on <ref id="cpus" name="Supported CPUs"> for which + processor types are supported, + if you are using a platform for which multiple CPU options exist. + + <p>See below for the following categories of platforms + <itemize> + <item><ref id="activedev" name="Actively supported development boards"> + <item><ref id="active" name="Actively supported workstations"> + <item><ref id="legacy" name="Legacy only / unsupported"> + <item><ref id="never" name="Never to be supported"> + </itemize> + + <sect1><label id="activedev">Actively supported development boards<p> + + The following list covers development boards for which there is active + support for the port, and which are maintained continuously. Expect these + ports to work reliably. Refer also the the section on <ref id="commercial" + name="commercial Linux ports"> - these companies may provide additional + hardware support. + + <sect2>Broadcom BCM91250A + <p>An evaluation board for the SiByteTM BCM1250 dual processor SOC (system on + chip) and is implemented in the standard ATX form factor. A high performance + board. See <url url="http://www.broadcom.com/"> for details. + + <sect2>MIPS Malta<p> + + The MIPS Technologies Malta board and all its CPU options are supported. See + the Developers pages under <url url="http://www.mips.com/" + name="www.mips.com">. + + <sect1><label id="active">Actively supported workstations<p> + + <p> + The following list covers machines for which there is active support for + the port, and which are maintained continuously. Expect these ports to work + reliably. + + <sect2>Cobalt Qube and Raq<p> + + The Cobalt Qube product series are low cost headless server systems + based on a IDT R5230. Sun has announced the end of life for the MIPS + based Qube and Raq systems but other Linux distributions are supported. + Biggest problem with this port is a limit of about 700kB for the size of + the boot image. This is a limitation of the firmware and is beginning to + seriously bite until somebody develops a workaround. + + <sect2>DECstation series<p> + The following DECstation models are actively supported: + <itemize> + <item>2100, codename PMAX + <item>5000/xx (Personal DECstation), codename MAXine + <item>5000/1xx, codename 3MIN + <item>5000/200, codename 3MAX + <item>5000/2x0, codename 3MAX+ + <item>5900/2x0 (identical to the 3MAX+). + </itemize> + These days, most of the work is done by + <htmlurl url="mailto:hkoerfg@web.de" + name="Harald Koerfgen (hkoerfg@web.de)"> and others. On the + Internet, DECstation-related information can be found at + <url url="http://decstation.unix-ag.org/">. + + The DECstation family ranges from the DECstation 2100 with an R2000/R2010 + chipset at 12 MHz, to the DECstation 5000/260 with a 60 MHz R4400SC. See the + section on Legacy Platforms below for other DEC machines. Note: Other x86 and + Alpha-based machines were also sold under the name DECstation. + + <sect2>Silicon Graphics Indy<p> + + The Indy is currently the best supported Silicon Graphics machine. + + <sect2>Silicon Graphics Origin 200 and 2000<p> + + <htmlurl url="mailto:ralf@gnu.org" name="Ralf Bächle (ralf@gnu.org)"> + and a team of SGI employees are currently working on a port to the + Origin 200. While still in it's early stages, it's running in + uniprocessor and multiprocessor mode and has drivers for the built-in IOC3 + Ethernet and SCSI hostadapters.<p> + + <sect2>Sony Playstation and Playstation 2<p> + + Sony Computer Entertainment have produced a port of Linux for the + PlayStation 2 which was released in 2002. For further details and + information about obtaining Linux for PlayStation 2, please visit + <url url="http://playstation2-linux.com">. + + Another site in Japanese can be found at <url url="http://www.ps2linux.com">. + + The older Sony Playstation is based on an R3000 derivative and uses a set of + graphics chips developed by Sony themselves. Sony doesn't support Linux for + this system but apparently a Russian group has released a Linux port on + www.runix.ru, now <url url="http://www.runix.biz/">. + +<sect1><label id="legacy">Unsupported / Legacy support only<p> + + The platforms listed here may once have been supported, but there may not have + been active maintenance for them. Expect problems with these platforms, and + consult the mailing list for information on them. + + <sect2>Acer PICA<p> + The <em>Acer PICA</em> is derived from the <em>Mips Magnum 4000</em> design. + It has a R4400PC CPU running at 133MHz or optionally 150MHz plus a 512KB + (optionally 2MB) second level cache; the Magnum's G364 gfx card was replaced + with a S3 968 based one. The system is supported with the exception of the + X server. + + <sect2>Baget/MIPS series<p> + The Baget series includes several boxes which have R3000 processors: Baget + 23, Baget 63, and Baget 83. Baget 23 and 63 have BT23-201 or BT23-202 + motherboards with R3500A (which is basically a R3000A chip) at 25 MHz and + R3081E at 50 MHz respectively. The BT23-201 board has VME bus and VIC068, + VAC068 chips as system controllers. The BT23-202 board has PCI as internal + bus and VME as internal. Support for BT23-201 board has been done by + <htmlurl url="mailto:rajko@mech.math.msu.su" name="Gleb Raiko + (rajko@mech.math.msu.su)"> and + <htmlurl url="mailto:vroganov@msiu.ru" + name="Vladimir Roganov (vroganov@msiu.ru)"> + with a bit of help from <htmlurl url="mailto:zimin@msiu.ru" + name="Serguei Zimin (zimin@msiu.ru)">. Support for BT23-202 is under + development along with Baget 23B which consists of 3 BT23-201 boards + with shared VME bus.<p> + + Baget 83 is mentioned here for completeness only. It has only 2MB RAM and + it's too small to run Linux. The Baget/MIPS code has been merged with the + DECstation port. The source for both is available at <url + url="http://decstation.unix-ag.org/">. + + <sect2>DECstation + <p>These DECstation models are orphaned because nobody is working on them, + but support for them should be relatively easy to achieve. + <itemize> + <item>3100, identical to the 2100 except the R2000A/R2010A @ 16 MHz + <item>5100, codename MIPSMATE, almost identical to the 2100 but with an + R3000/R3010 chipset. + </itemize> + + The other members of the DECstation family, besides the x86 based ones, + should be considered as VAXen with the CPU replaced by a MIPS CPU. + There is absolutely no information available about these machines and support + for them is unlikely to ever happen unless the VAXLinux port comes back to + life. These are: + <itemize> + <item>5400, codename MIPSFAIR + <item>5500, codename MIPSFAIR2 + <item>5800, codename ISIS + </itemize> + + <sect2>MIPS Magnum 4000 / Olivetti M700-10<p> + These two machines are almost completely identical. Back during the + ACE initiative, Olivetti licensed the Jazz design and marketed the machine + with Windows NT as the OS. MIPS Computer Systems, Inc. bought the + Jazz design and marketed it as the MIPS Magnum 4000 series of machines. + Magnum 4000 systems were marketed with Windows NT and RISC/os as the + operating systems.<p> + + The firmware on the machine depended on the operating system which was + installed. Linux/MIPS supports only + the little endian firmware on these two types of machines. Since the + M700-10 was only marketed as an NT machine, all M700-10 machines have this + firmware installed. The MIPS Magnum case is somewhat more complex. If + your machine has been configured big endian for RISC/os, then you need + to reload the little endian firmware. This firmware was originally + included on a floppy with the delivery of every Magnum. If you don't + have the floppy anymore you can download it via anonymous ftp from + <url url="ftp://ftp.linux-mips.org/pub/linux/mips/misc/magnum-4000">.<p> + + It is possible to reconfigure the M700 for headless operation by setting + the firmware environment variables ConsoleIn and ConsoleOut to + multi()serial(0)term(). Also, try the command <sl>listdev</sl> which will + show the available ARC devices. + + In some cases, like where the G364 graphics card is missing but the console + is still configured to use normal graphics, it will be necessary to set + the configuration jumper JP2 on the board. After the next reset, the machine + will reboot with the console on COM2. + + <sect2>MIPS Magnum 4000SC<p> + The MIPS Magnum 4000SC is the same as a Magnum 4000 (see above) with + the exception that it uses an R4000SC CPU. + + <sect2>NEC machines<p> + The NEC uniprocessor machines are OEM <em>Acer PICA</em> systems, see + that section for details. The SMP systems are different from that. The + Linux/MIPS developers have no technical documentation as necessary to write + an OS. As long as that does not change, this will pretty much stay a show- + stopper, preventing a port to NEC's SMP systems. + + <sect2>Netpower 100<p> + The <em>Netpower 100</em> is apparently an <em>Acer PICA</em> in disguise. + It should therefore be supported but this is untested. If there is a + problem then it is probably the machine detection. + + <sect2>Nintendo 64<p> + The <em>Nintendo 64</em> is R4300-based game console with 4MB RAM. Its + graphics chips were developed by Silicon Graphics for Nintendo. Right now + this port has pipe dream status and will continue to be in that state until + Nintendo decides to publish the necessary technical information. The + question remains as to whether porting the Linux/MIPS code to this platform + is a good idea. + + <sect2>Phillips Nino<p> + Linux 2.4 supports the Nino. Support was removed from 2.5 at the request + of it's maintainer who does not want to maintain it anymore. + + <sect2>Silicon Graphics Challenge S<p> + This machine is very similar to the Indy, the differences are that it doesn't + have a keyboard or graphics card, but has an additional SCSI WD33C95-based + adapter. This WD33C95 hostadapter is currently not supported. + + <sect2>Silicon Graphics Indigo<p> + This machine is only being mentioned here because people have occasionally + confused it with Indys or the Indigo 2. The Indigo is a different + R3000-based architecture however, and is yet unsupported. + + <sect2>Silicon Graphics Indigo2<p> + This machine is the successor to the Indigo and is very similar to the Indy. + It is now supported, but is lacking in several areas. You will have + to use serial console. If you have an Indigo2 and still want to run Linux on + it, contact either <htmlurl url="mailto:flo@rfc822.org" + name="Florian Lohoff (flo@rfc822.org)">. + + <sect2>Silicon Graphics Onyx 2<p> + The Onyx 2 is basically an Origin 2000 with additional graphics + hardware. As of now, writing Linux support for the graphics hardware has + not yet been done. Aside from that, Linux should run just as well as + on a normal, headless Origin 2000 configuration.<p> + + <sect2>Silicon Graphics Power Series<p> + This is a very old series of R3000 SMP systems. There is no hardware + documentation for these machines, few of them even exist anymore, and the + hardware is weird. In short, the chances that Linux will ever run on them + are approximating zero. Not that we want to discourage any takers ... + + <sect2>SNI RM200<p> + If your machine has both EISA and PCI slots, then it is an RM200C (please + see below). Due to the slight architectural differences of the RM200 and + the RM200C, this machine isn't currently supported in the official sources. + <htmlurl url="mailto:engel@numerik.math.uni-siegen.de" + name="Michael Engel (engel@numerik.math.uni-siegen.de)"> has managed to get + his RM200 working partially, but the patches haven't yet been included in the + official Linux/MIPS sources. + + <sect2>SNI RM200C<p> + In contrast to the RM200 (see above), this machine has EISA and PCI slots. + This machine was somewhat supported in 2.0 and 2.1, then nobody took care of + this port for a long time until recently. So it's not usable in 2.2 and + 2.4 but works again in 2.6. + + <sect2>SNI RM300C<p> + The RM300 is technically very similar to the RM200C. It should be supported + by the current Linux kernel, but we haven't yet received any reports. + + <sect2>SNI RM400<p> + The RM400 isn't supported. + + <sect2>SNI RW320<p> + This machine is a OEM variant of the SGI Indigo and therefore also + unsupported. + + <sect2>NEC VR41xx-based platforms<p> + The Linux VR project is porting Linux to devices based on the NEC VR41xx + microprocessors. Many of these devices were originally designed to run + Windows CE. The project has produced working kernels with basic drivers + for the Vadem Clio, Casio E-105, Everex Freestyle, and more. The + <ref id="linux-vr" name="Linux-VR"> has developped support for these + systems. + + <sect2>Toshiba TMPR39xx/Philips PR31700 platforms<p> + + Similar to the VR41xx, devices with these processors were originally + intended for running Windows CE. However, there are working kernels + with basic drivers for <em>Sharp Mobilon</em> and the <em>Compaq + C-Series</em>. The <ref id="linux-vr" name="Linux-VR"> has developped + support for these systems. + + <sect1><label id="never">Hardware we're never going to support<p> + <sect2>IBM RS6000<p> + + As the name says, these are IBM machines which are based on the RS6000 + processor series, and, as such, they're not the subject of the Linux/MIPS + project. People frequently confuse the IBM RS6000 with the MIPS R6000 + architecture. However, the Linux/PPC project might support these machines. + Checkout <url url="http://www.penguinppc.org/"> for further information. + + <sect2>VaxStation<p> + As the name already implies, this machine is a member of Digital Equipment's + VAX family. It's mentioned here because people often confuse it with + Digital's MIPS-based DECstation family due to the similar type numbers. These + two families of architectures share little technical similarities. These + systems are subject of the Linux/VAX project at + <url url="http://www.linux-vax.org/">. + + <sect2>SGI VisPC<p> + This is actually an x86-based system, therefore not covered by this FAQ. + There is some limited Linux support available for the older Visual + Workstations. The current series of Visual Workstations is an officially + supported SGI product. Please see <url url="http://oss.sgi.com"> and + <url url="http://www.sgi.com"> for more information. + + <sect2>Motorola 68k-based machines<p> + Examples are the SGI Iris 1000, Iris 2000 and Iris 3000 + series. As these machines are not based on MIPS processors, and therefore + not subject of the Linux/MIPS project. In other words if you're looking into + this document for more information you're lookin at the wrong place. Also + these are <sl>very</sl> old machines, much more than ten years old by now. + As such chances for the to ever be supported a small. For more on Linux on + Motorola 68000 based systems see <url url="http://www.linux-m68k.org">. + + <sect><label id="cpus">Supported CPUs<p> + <label id="supported-cpus"> + <sect1>MIPS32 architecture<p> + All CPUs and cores that conform to the MIPS32 specification, including the + MIPS 4K series, Alchemy Au1000/1500. + + <sect1>MIPS64 architecture<p> + All CPUs and cores that conform to the MIPS64 specification, including the + MIPS 5K and 10K series, Sibyte SB1 core / SB1250 SOC. + + <sect1>R2000, R3000 family<p> + Linux supports the R2000, R3000 family and many processors that were derived + from these the two original MIPS processors such as the R3081. + + <sect1>R4000 family<p> + Linux supports many of the members of the R4000 family. Currently, these + are: R4000PC, R4400PC, R4300, R4600, R4700.<p> + + Not supported are the R4000MC and R4400MC CPUs (that is multiprocessor + systems), as well as R5000 systems with a CPU-controlled second level cache. + This means that the cache is controlled by the R5000 itself, in contrast to + some external cache controller. The difference is important because, + unlike other systems, especially PCs, on MIPS the cache is architecturally + visible and needs to be controlled by software.<p> + Special credit goes to <htmlurl url="mailto:grim@zigzegv.ml.org" + name="Ulf Carlsson (ulfc@engr.sgi.com)"> who provided the CPU module for + debugging the R4000SC / R4400SC support. + + There is some confusion about version numbering of R4000 and R4400 CPUs + on SGI systems. These two processor types are basically identical with the + main difference being the R4000 only having primary caches of each 8kb + while the R4400 has twice that. Consequently these two processors do + identify themselves both as type 4 in the c0_PrId register but a different + version number while marketing decieded to market the somewhat improved + R4400 as a great and new product. R4000 processors have version numbers upto + 3.0; R4400 processors do identify themselves as version 4.0 and newer. + As a consequence of the R4400 being sold as new product they also started + counting the marketing version numbers again at 1.0. The IRIX <em>hinv</em> + command uses the hardware version numbers while Linux in the hope to minimize + the confusion is using marketing's version numbers that is the Linux version + numbers are consistent with those used by the the MIPS literature such as + processor errata. + + <sect1>R5000 family<p> + The R5000 and many similar family members such R5230 and R5260 are supported + by Linux. Support include support for the internal second level cache + controller as well as the external cache controllers used by the SGI IP22. + + <sect1>R6000<p> + Sometimes people confuse the R6000, a MIPS processor, with RS6000, a series + of workstations made by IBM. So, if you're reading this in hope of finding + out more about Linux on IBM machines, then you're reading the wrong + document.<p> + + The R6000 is currently not supported. It is a 32-bit MIPS ISA 2 processor; + apretty interesting and weird piece of silicon. It was developed and + produced by a company named <sl>BIT Technology</sl>. Later, NEC took over + the semiconductor production. It was built using ECL technology, the same + technology that was, and still is, being used to build extremely fast chips + like those used in some Cray computers. The processor had its TLB + implemented as part of the last couple of lines of the external primary + cache, a technology called <sl>TLB slice</sl>. That means its MMU is + substantially different from those of the R3000 or R4000 series, which is + also one of the reasons why the processor isn't supported. + + <sect1>RM7000 family<p> + The RM7000 and some similar family members are supported by Linux + including support for tertiary caches. + + <sect1>R8000<p> + The R8000 is currently unsupported partly because this processor is + relatively rare and has only been used in a few SGI machines, and partly + because the Linux/MIPS developers don't have such a machine.<p> + + The R8000 is a pretty interesting piece of silicon. Unlike the other + members of the MIPS family it is a set of seven chips. It's cache and TLB + architecture are pretty different from the other members of the MIPS family. + It was born as a quick hack to get the floating point crown back to + Silicon Graphics before the R10000 is finished. + + <sect1>R10000<p> + The R10000 is supported as part of the mips64 kernel which currently is + supported on the IP22 (SGI Indy, Challenge S and Indigo 2) and + Origin.<p> + + Due to the very hard-to-handle way this processor works in non-cachecoherent + systems, it will probably be some time until we support this processor + in such systems. As of today, these systems are the SGI O2 and + Indigo <p> + + <sect1>Processors without TLB<p> + For embedded purposes, there are special derivates of the above CPU + available which often lack a full TLB. We don't support those types nor + should you ever expect such support to be added.<p> + + Hackers may want to take a look at a Linux subset named Microcontroller + Linux, or short, ucLinux. This would be supportable on TLB-less processors. + Given the little difference between CPU types with and without TLB, we still + recommend that you choose a processor with TLB. It's going to save you a lot + of engineering. + + <sect1>Processors with partial or no FPU<p> + Linux/MIPS version 2.4 and later feature a full FPU emulation and therefore + can support these processors while maintaining the full binary compatibility + to fpu-full versions. + +<sect>Technical FAQ + <sect1>Reporting bugs<p> + Before reporting a bug please make sure the answer to your problem isn't + already in this document. You may also want to use the search engine at + <url url="http://www.linux-mips.org/archives/linux-mips"> to search the + mailing list archives for references to your problem.<p> + + If this all didn't turn up anything, it seems time to write a bug report. + Inexperienced kernel bug reporters should read + <htmlurl name="REPORTING-BUGS" + url="http://www.linux-mips.org/cvsweb/~checkout~/linux/REPORTING-BUGS"> + (since Linux 2.1 this file ships as part of the kernel) to ensure the bug + report contains all the information needed. In particular the step of + decoding Ooops messages is important; without it's hard if possible at all to + make sense from the numbers in the register dump. For most problems it's + important to know exactly what system you're using. Remember a system + consists of more than just a processor and MIPS systems tend to differ much + more than Intel systems. In general you should not post large files such + as System.map or others until you've been explicitly asked to. Even + if you think you've discovered a generic kernel bug you may still want to + cc linux-mips@linux-mips.org, just in case. + + <sect1>Installation of Linux/MIPS and common problems.<p> + <sect2>NFS booting fails.<p> + + Usually, the reason for this is that people have unpacked the tar archive + under IRIX, not Linux. Since the representation of device files over NFS is + not standardized between various Unices, this fails. The symptom is that + the system dies with the error message ``Warning: unable to open an initial + console.'' right after mounting the NFS filesystem.<p> + + For now, the workaround is to use a Linux system (doesn't need to be MIPS) + to unpack the installation archive onto the NFS server. The NFS server + itself may be any type of UNIX.<p> + + <sect2>Kernel doesn't compile.<p> + Not all machines supported by Linux/MIPS are equally well maintained; in + general those that are used by more users experience more scrutiny and + therefore are better maintained.<p> + + Kernels downloaded from kernel.org in general don't have uptodate MIPS + support so they may not compile at all or work as well as those from + linux-mips.org - where optimal MIPS support is the only focus.<p> + + <sect2>Self-compiled kernels crash when booting.<p> + + When I build my own kernel, it crashes. On an Indy the crash message looks + like the following (the same problem hits other machines as well but may + look completely different): + + <verb> + Exception: <vector=UTLB Miss> + Status register: 0x300004803<CU1,CU0,IM4,IPL=???,MODE=KERNEL,EXL,IE> + Cause register: 0x8008<CE=0,IP8,EXC=RMISS> + Exception PC: 0x881385cc, Exception RA: 0x88002614 + exception, bad address: 0x47c4 + Local I/O interrupt register 1: 0x80 <VR/GIO2> + Saved user regs in hex (&gpda 0xa8740e48, &_regs 0xa8741048): + arg: 7 8bfff938 8bfffc4d 880025dc + tmp: 8818c14c 8818c14c 10 881510c4 14 8bfad9e0 0 48 + sve: 8bfdf3e8 8bfffc40 8bfb2720 8bfff938 a8747420 9fc56394 0 9fc56394 + t8 48 t9 8bfffee66 at 1 v0 0 v1 8bfff890 k1 bad11bad + gp 881dfd90 fp 9fc4be88 sp 8bfff8b8 ra 88002614 + + PANIC: Unexpected exception + </verb> + + This problem is caused by a still unfixed bug in Binutils newer than + version 2.7. As a workaround, change the following line in + arch/mips/Makefile from: + + <verb> + LINKFLAGS = -static -N + </verb> + + to: + + <verb> + LINKFLAGS = -static + </verb> + + <sect2>Booting the kernel on the Indy fails with PROM error messages<p> + <verb> + >> boot bootp()/vmlinux + 73264+592+11520+331680+27848d+3628+5792 entry: 0x8df9a960 + Setting $netaddres to 192.168.1.5 (from server deadmoon) + Obtaining /vmlinux from server deadmoon + + Cannot load bootp()/vmlinux + Illegal f_magic number 0x7f45, expected MIPSELMAGIC or MIPSEBMAGIC. + </verb> + + This problem only happens for Indys with very old PROM versions which cannot + handle the ELF binary format which Linux uses. A solution for this problem + is in the works. + + <sect2>IP22 has forgotten it's ethernet address<p> + IP22 uses the Dallas DS1286 RTC chip to store time and firmware variables. + This chip contains a builtin battery for ten years but by now this decade + is almost over and experience has shown that some of these RTC batteries + have a much shorter battery life, so the RTCs start becoming forgetful. + Software may also accidentally have overwritten the RTC's content. + + If you have determined that a defective RTC chip is the cause of the + problem you can get a new RTC from <url url="http://www.maxim-ic.com/"> or + other sources. Be paranoid, make sure you don't get a part that has been + sitting on a shelf for long years. + + This is how to reprogram the RTC chip. Assuming your ethernet address is + aa:bb:cc:dd:ee:ff + + <verb> + fill -w -v 0xaa 0xbfbe04e8 + fill -w -v 0xbb 0xbfbe04ec + fill -w -v 0xcc 0xbfbe04f0 + fill -w -v 0xdd 0xbfbe04f4 + fill -w -v 0xee 0xbfbe04f8 + fill -w -v 0xff 0xbfbe04fc + </verb> + + With this command you can verify the content of the chip's NVRAM: + + <verb> + dump -w -x 0xbfbe04e8 + </verb> + + Note this will print each byte of the MAC address repeated four times; this + is normal an due to the way the chip is used in the Indy. + + The MAC address is also the system's serial number, so software licenses + under IRIX might be bound to it. Also the ethernet standards specify + certain meanings for certain values of the 48-bit address. Therefore you + should reprogramm the old ethernet address. You may find the MAC address + on the sticker on the machine. Below a bar code this sticker only contains + a 12 digit hexadecimal number; it's typically located on the backside + between the parallel port and and SCSI connectors on the left side and the + power supply on the right side. In case this sticker has been lost, you + probably also have the number somewhere in the bootmessages of Linux + archived by syslogd or maybe a bootpd or dhcpd config file. + + If you need to reprogram the ethernet address you will almost certainly + have lost all other NVRAM settings, use the PROM shell's setenv -p command + for that. + + <sect2>Where can I get the little endian firmware for my RM200 C?<p> + + SNI's system can be operated in both big and little endian modes. At this + time, Linux/MIPS only supports the little endian firmware. This is somewhat + unlucky since SNI hasn't shipped that firmware for quite some time, since + they dropped Windows NT. + + When running in big endian mode, the firmware looks similar to an SGI Indy + which is already supported, therefore fixing the SNI support will be + relatively easy. Interested hackers should contact <htmlurl + url="mailto:ralf@gnu.org" name="Ralf Bächle (ralf@gnu.org)">. + + <sect2>ld dies with signal 6<p> + <verb> + collect2: ld terminated with signal 6 [Aborted] + </verb> + This is a known bug in older binutils versions. You will have to upgrade to + at least binutils 2.8.1 plus very current patches. + + <sect2>Missing ELF support in some PROM versions<p> + + Old IP22 PROM versions don't know about the ELF binary format which the Linux + kernel normally uses, so Linux cannot boot directly. This results in error + messages similar to this one: + <verb> + >> boot -f linux root=/dev/sda1 + + Cannot load scsi(0)disk(1)rdisk(0)partition(8)/linux. + Illegal f_magic number 0x7f45, expected MIPSELMAGIC or MIPSEBMAGIC. + Unable to load linux: ``linux'' is not a valid file to boot. + >> + </verb> + + The preferable solution for this is of course a PROM upgrade but that isn't + available for all systems.<p> + + For systems which still have the sash of IRIX 5 installed it is alternativly + possible use Sash to boot the kernel. Sash knows how to load ELF binaries + and doesn't care if it's an IRIX or Linux kernel. Simply type ``Sash'' to + the PROM monitor. You'll get another shell prompt, this time from Sash. + Now launch Linux as usual.<p> Sash can read EFS or XFS filesystems or read + the kernel from BOOTP / TFTP.<p> + + Using the elf2ecoff tool that is shipping with the kernel source you can + convert an ELF binary into ECOFF. Or when building a kernel just run the + ``make vmlinux.ecoff'' which will produce an ECOFF kernel. + + <sect2>My machine doesn't download the kernel when I try to netboot<p> + + This problem affects the ARC firmware on SNI RM200 and SGI IP22.<p> + + The boot client is replying to the BOOTP packets (may be verified using a + packet sniffer like tcpdump or ethereal), but doesn't download the kernel + from your BOOTP server. This happens if your boot server is running a kernel + of the 2.3 series or higher. The problem may be circumvented by doing a + "echo 1 > /proc/sys/net/ipv4/ip_no_pmtu_disc" as root on the boot server. + + <sect2>The kernel download from the TFTP server stops and times out<p> + + This may happen if the TFTP server is using a local port number of 32768 or + higher which usually happens if the TFTP server is running Linux 2.3 or + higher. This problem may be circumvented by doing a "echo 2048 32767 > + /proc/sys/net/ipv4/ip_local_port_range" on the server. + + <sect2>Bug in DHCP version 2<p> + + When using DHCP version 2 you might see the following problem: Your machines + receives it's BOOTP reply 3 times but refuses to start TFTP. You can fix + this by doing a "unsetenv netaddr" in the PROM command monitor before you + boot your system. DHCP version 3 fixes that problem. + + <sect2>When booting I get: Warning: unable to open an initial console.<p> + + This problem has two possible solutions. First make sure you actually have + a driver for the console of your system configured. If this is the case and + the problem persists you probably got victim of a widespread bug in Linux + distributions and root filesystems out there. The console of a Linux + systems should be a character device of major id 5, minor 1 with permissions + of 622 and owned by user and group root. If that's not the case, cd to the + root of the filesystem and execute the following commands as root: + <verb> + rm -f dev/console + mknod --mode=622 dev/console + </verb> + You can also do this on a NFS root filesystem, even on the NFS server + itself. However note that the major and minor ids are changed by NFS, + therefore you must do this from a Linux system even if it's only a NFS + client or the major / minor ID might be wrong when your Linux client boots + from it. + + <sect2>Is IRIX required for installation on SGI systems?<p> + + Various descriptions of the installation procedure use IRIX in order to + partition disks. This was required at the time of their writing as there + were no native partiting tools available. Now disks can be partitioned + using the IRIX disklabel mode which can be selected in the expert menu of + newer fdisk versions or GNU Parted. The volume header can be manipulated + using dvhtool. Note dvhtool usage is different from IRIX.<p> + + IRIX as secondary operating systems can still be handy as it may reduce the + need to fiddle with ramdisks or nfs-root during installation. Just one word + of warning though: Be careful to not point IRIX fx(8) to disks that don't + don't contain an IRIX disklabel if you want to retain the content - IRIX may + <em>damage</em> the content of that disk without asking! + + <sect2>Can IRIX and Linux be installed on the same system<p> + + Yes. Just make sure you read the warning about IRIX's fx(8) in above + paragraph. + + <sect2>Insmod complains about the _gp_disp symbol being undefined<p> + + _gp_disp is a magic symbol used with PIC code on MIPS. Be happy, this error + message saved you from crashing your system. You should use the same + compiler options to compile a kernel module as the kernel makefiles do. In + particular the options <em>-mno-pic -mno-abicalls -G 0</em> are important. + + <sect2>Serial console on SGI machines<p> + + Make sure that the kernel you're using includes the appropriate driver for a + serial interface and serial console. Set the <em>console</em> ARC + environment variable to either the value <em>d1</em>, or <em>d2</em> for + Indy and Challenge S depending on which serial interface you're going + to use as the console.<p> + + If you have the problem that all kernel messages appear on the serial + console on boot-up, but everything is missing from the point when init + starts, then you probably have the wrong setup for your /dev/console. You + can find more information about this in the Linux kernel source + documentation which is in /usr/src/linux/Documentation/serial-console.txt if + you have the kernel source installed. + + <sect2>Strange amounts of available memory on SGI<p> + + On bootup, the kernel on the Indy will report available memory with a + message like: + <verb> + Memory: 27976k/163372k available (1220k kernel code, 2324k data) + </verb> + The large difference between the first pair of numbers is caused by a 128MB + area in the Indy's memory address space which mirrors up to the first 128MB + of memory. The difference between the two numbers will always be about + 128MB and does not indicate a problem of any kind. Kernels since 2.3.23 + don't count this 128MB gap any more. + + <sect2>Indy PROM related problems<p> + + Several people have reported these problems with their machines after + upgrading them typically from surplus parts. There are several PROM + versions for the Indy available. Machines with old PROM versions which have + been upgraded to newer CPU variants, like a R4600SC or R5000SC module, can + crash during the self test with an error message like: + <verb> + Exception: <vector=Normal> + Status register: 0x30004803<CU1,CU0,IM7,IM4,IPL=???,MODE=KERNEL,EXL,IE> + Cause register: 0x4000<CE=0,IP7,EXC=INT> + Exception PC: 0xbfc0b598 + Interrupt exception + CPU Parity Error Interrupt + Local I/O interrupt register 1: 0x80 <VR/GIO2> + CPU parity error register: 0x80b<B0,B1,B3,SYSAD_PAR> + CPU parity error: address: 0x1fc0b598 + NESTED EXCEPTION #1 at EPC: 9fc3df00; first exception at PC: bfc0b598 + </verb> + In that case, you'll have to upgrade your machine's PROM to a newer version, + or go back to an older CPU version (usually R4000SC or R4400SC modules + should work). Just to be clear, this is a problem which is unrelated to + Linux, it is only mentioned here because several Linux users have asked + about it.<p> + + <sect2>Why is so much memory reserved on my Indy?<p> + On bootup, the `Memory: ...' message on an Indy says that there is + 128MB of RAM reserved. That is ok. Just like the PC architecture has + a gap in its memory address space between 640KB and 1024KB, the Indy + has a 128MB-sized area in its memory map where the first 128MB of + its memory is mirrored. Linux knows about it and just ignores + that memory, and thus this message.<p> + + <sect1>Milo<p> + + Milo is the boot loader used to boot the little endian MIPS systems with ARC + firmware, currently the Jazz family and the SNI RM 200. While Milo uses + the same name and has a similar purpose to the Alpha version of Milo, these + two Milos have nothing else in common. They were developed by different + people, don't share any code, and work on different hardware platforms. The + fact that both have the same name is just a kind of historic ``accident''.<p> + + The need for Milo has been eliminated for all ARC platforms except the RM200C + due to it's unusual firmware behavior. On all other platforms an ECOFF or + often on more modern firmware also an ELF kernel can be started directly + without the need for Milo or an equivalent. On the RM200C Milo 0.27.1 is + still required to boot the kernel.<p> + + <sect2>Building Milo<p> + + The building procedure of Milo is described, in detail, in the README files + in the Milo package. Since Milo has some dependencies to kernel header + files which have changed over time, Milo often cannot be built easily. + However, the Milo distribution includes binaries for both Milo and Pandora. + Building Milo is not trivial; unless you want to modify Milo yourself the + urgent recommendation is to use the binaries shipping in the Milo + tarball.<p> + + <sect2>Pandora<p> + + Pandora is a simple debugger which was primarily developed in order to + analyze undocumented systems. Pandora includes a disassembler, memory dump + functions, and more. If you only want to use Linux, then there is no need + to install Pandora, despite its small size. + + <sect1>Loadable Modules<p> + + Using modules on Linux/MIPS is quite easy. It should work as expected for + people who have used the feature on other Linux systems. If you want to run + a module-based system, then you should have at least kernel version 980919, + and modutils newer than version 2.1.121 installed. Older versions won't + work. + + <sect1>How do I set up a cross-compiler?<p> + <sect2>Available binaries<p> + + The easiest way to setup a cross-compiler is to just download the binaries + from <url url="ftp://ftp.linux-mips.org/pub/linux/mips/crossdev/">. + Serious, over the 8 years of Linux/MIPS history this has been shown to be + biggest problem many users have been facing with Linux/MIPS. + For Linux/i386 hosts and big endian targets, these are the packages: + <verb> + binutils-mips-linux-2.13.2.1-1.i386.rpm + egcs-c++-mips-linux-1.1.2-4.i386.rpm + egcs-g77-mips-linux-1.1.2-4.i386.rpm + egcs-libstdc++-mips-linux-2.9.0-4.i386.rpm + egcs-mips-linux-1.1.2-4.i386.rpm + egcs-objc-mips-linux-1.1.2-4.i386.rpm + </verb> + + And this is the list of packages for little endian targets: + <verb> + binutils-mipsel-linux-2.13.2.1-1.i386.rpm + egcs-c++-mipsel-linux-1.1.2-4.i386.rpm + egcs-g77-mipsel-linux-1.1.2-4.i386.rpm + egcs-libstdc++-mipsel-linux-2.9.0-4.i386.rpm + egcs-mipsel-linux-1.1.2-4.i386.rpm + egcs-objc-mipsel-linux-1.1.2-4.i386.rpm + </verb> + + For 64-bit MIPS kernels, there are only two packages available right now: + <verb> + egcs-mips64-linux-1.1.2-4.i386.rpm + </verb> + and for little endian 64-bit systems: + <verb> + egcs-mips64el-linux-1.1.2-4.i386.rpm + </verb> + + It's not necessary that you install all of these packages as most people can + just omit the C++, Objective C and Fortran 77 compilers. The + Intel binaries have been linked against GNU libc 2.2, so you may have to + install that as well when upgrading. + + <sect2>Recommended compiler versions<p> + <sect3>Binutils<p> + The recommended version is binutils 2.13.2.1. + + <sect3>gcc<p> + For Linux 2.4 kernels before 2003-05-16 the minimum gcc version required is + egcs 1.1.2; later 2.4, 2.5 and 2.6 require gcc 2.95.3 or newer. Using a + too old compiler may result in compiler core dumps or silently misscompiled + kernels. The better code generation of later tools has little impact on + performance of the generated kernel however more recent tools tend to be + dramatically slower at generating code, so some people like the maintainer + of the MIPS port tend to continue using old compilers in spite of their age. + + For compilation of userspace applications and libraries you probably want a + much newer compiler; generally 2.95.3 is considered very stable and at the + same time reasonably fast. Due to the evolution of the C++ language and + ABI C++ users probably may have special constraints in selection of their + compiler version; a very recent compiler such as gcc 3.2 is probably a good + choice. + + Note there is no need to use the same compilers for kernel and userspace + libraries and applications. You only want to use the same compiler version + for all C++ code. + + <sect3>glibc<p> + This document still documents how to build glibc 2.0.6 however this version + is no longer recommended for new projects. Users who are looking into + glibc 2.0.6 due to binary size considerations may want to ucLibc instead. + Installing glibc into a crosscompiler environment is not necessary if you + only want to build compilers. + + <sect3>uClibc<p> + uClibc is a very small libc replacement available at + <url url="http://www.uclibc.org">. The MIPS bits can be found at + <url url="ftp://ftp.realitydiluted.com/linux/MIPS/toolchains">. + + <sect2>Building your own cross-compiler<p> + + First of all, go and download the following source packages: + <itemize> + <item>binutils-2.13.2.1.tar.gz + <item>egcs-1.1.2.tar.gz + <item>glibc-2.0.6.tar.gz + <item>glibc-crypt-2.0.6.tar.gz + <item>glibc-localedata-2.0.6.tar.gz + <item>glibc-linuxthreads-2.0.6.tar.gz + </itemize> + You can obtain these files from your favorite GNU archive or <htmlurl + url="ftp://ftp.linux-mips.org" name="ftp.linux-mips.org">. Furthermore, + you'll need patches. The unbundled patch files aren't always up-to-date and + additional, not MIPS-specific, patches may be required for building. Note + that the unbundled patch files also use a different revision numbering and + it is therefore recommended that you obtain the source and patches from the + RPM packages distributed on <htmlurl url="ftp://ftp.linux-mips.org" + name="ftp.linux-mips.org">. + + Those are the currently recommended versions. Older versions may or may not + be working. If you're trying to use older versions, please don't send bug + reports because we don't care. When installing, please install things in + the order of binutils, egcs, then glibc. Unless you have older versions + already installed, changing the order <sl>will</sl> fail. + + <sect2>Disk space requirements<p> + + For the installation, you'll have to choose a directory where the files will + be installed. I'll refer to that directory below with <prefix>. To avoid + a particular problem, it's best to use the same value for <prefix> as + your native gcc. For example, if your gcc is installed in /usr/bin/gcc, + then choose /usr for <prefix>. You must use the same <prefix> value + for all the packages that you're going to install.<p> During compilation, + you'll need about 31MB disk space for binutils. For installation, you'll + need 7MB disk space on <prefix>'s partition. Building egcs requires + 71MB, and installation 14MB. GNU libc requires 149MB disk space during + compilation, and 33MB for installation. Note, these numbers are just a + guideline and may differ significantly for different processor and operating + system architectures or compiler options. + + <sect2>Byte order<p> + + One of the special features of the MIPS architecture is that all processors + except the R8000 can be configured to run either in big or in little endian + mode. Byte order means the way the processor stores multibyte numbers in + memory. Big endian machines store the byte with the highest value digits at + the lowest address while little endian machines store it at the highest + address. Think of it as writing multi-digit numbers from left to right or + vice versa.<p> In order to setup your cross-compiler correctly, you have to + know the byte order of the cross-compiler target. If you don't already + know, check the section <ref id="hardware-platforms" name="Hardware + Platforms"> for your machine's byte order. + + <sect2>Configuration names<p> + + Many of the packages based on autoconf support many different architectures + and operating systems. In order to differentiate between these many + configurations, names are constructed with <cpu>-<company>-<os>, or + even <cpu>-<company>-<kernel>-<os>. Expressed this way, the + configuration names of Linux/MIPS are: mips-unknown-linux-gnu for big endian + targets, or mipsel-unknown-linux-gnu for little endian targets. These names + are a bit long and are allowed to be abbreviated to mips-linux or + mipsel-linux. You <sl>must</sl> use the same configuration name for all + packages that comprise your cross-compilation environment. Also, while + other names, like mips-sni-linux or mipsel-sni-linux, are legal + configuration names, use mips-linux or mipsel-linux instead. These are the + configuration names known to other packages, like the Linux kernel sources, + and they would otherwise have to be changed for cross-compilation.<p> + + I'll refer to the target configuration name below with <target>. + + <sect2>Installation of GNU Binutils.<p> + + This is the first and simplest part (at least as long as you're trying to + install on any halfway-sane UNIX flavour). Just cd into a directory with + enough free space and do the following: + <verb> + gzip -cd binutils-<version>.tar.gz | tar xf - + cd binutils-<version> + patch -p1 < ../binutils-<version>-mips.patch + ./configure --prefix=<prefix> --target=<target> + make CFLAGS=-O2 + make install + </verb> + + This usually works correctly. However, certain machines using GCC 2.7.x as + compiler are known to dump core. This is a known bug in GCC and can be + fixed by upgrading the host compiler to GCC 2.13.2.1 or better. + + <sect2>Assert.h<p> + + Some people have an old assert.h header file installed, probably leftover + from an old cross-compiler installation. This file may cause autoconf + scripts to fail silently. Assert.h was never necessary and was only + installed because of a bug in older GCC versions. Check to see if the file + <prefix>/<target>/include/assert.h exists in your installation. If + so, just delete the it - it should never have been installed for any version + of the cross-compiler and will cause trouble. + + <sect2>Installing the kernel sources<p> + + Installing the kernel sources is simple. Just place them into some + directory of your choice and configure them. Configuring them is necessary + so that files which are generated by the procedure will be installed. Make + sure you enable CONFIG_CROSSCOMPILE near the end of the configuration + process. The only problem you may run into is that you may need to install + some required GNU programs like bash or have to override the + manufacturer-provided versions of programs by placing the GNU versions + earlier in the PATH variable. Now, go to the directory + <prefix>/<target>/include and create two symbolic links named asm and + linux pointing to include/asm rsp. include/linux within your just installed + and configured kernel sources. These are necessary such that the necessary + header files will be found during the next step. + + <sect2>First installation of egcs<p> + + Now the pain begins. There is a so-called bootstrap problem. In our case, + this means that the installation process of egcs needs an already installed + glibc, but we cannot compile glibc because we don't have a working + cross-compiler yet. Luckily, you'll only have to go through this once when + you install a cross-compiler for the first time. Later, when you already + have glibc installed, things will be much smoother. So now do: + <verb> + gzip -cd egcs-1.1.2.tar.gz | tar xf - + cd egcs-<version> + patch -p1 < ../egcs-1.1.2-mips.patch + ./configure --prefix=<prefix> --with-newlib --target=<target> + make SUBDIRS="libiberty texinfo gcc" ALL_TARGET_MODULES= \ + CONFIGURE_TARGET_MODULES= INSTALL_TARGET_MODULES= LANGUAGES="c" + </verb> + + Note that we deliberately don't build gcov, protoize, unprotoize, and the + libraries. Gcov doesn't make sense in a cross-compiler environment, and + protoize and unprotoize might even overwrite your native programs - this is + a bug in the gcc makefiles. Finally, we cannot build the libraries because + we don't have glibc installed yet. If everything went successfully, install + with: + <verb> + make SUBDIRS="libiberty texinfo gcc" INSTALL_TARGET_MODULES= \ + LANGUAGES="c" install + </verb> + + If you only want the cross-compiler for building the kernel, you're done. + Cross-compiling libc is only required to be able to compile user + applications. + + <sect2>Test what you've done so far<p> + + Just to make sure that what you've done so far is actually working, you may + now try to compile the kernel. Cd to the MIPS kernel's sources and type + ``make clean; make dep; make''. If everything went ok do ``make clean'' + once more to clean the sources. + + <sect2>Installing GNU libc<p> + + <sl>Note: Building glibc 2.0.6 using a compiler newer than egcs 1.0.3a is + not recommended due to binary compatibility problems which may hit certain + software. It's recommended that you either use egcs 1.0.3a or use the files + from a published binary package. Crosscompiling GNU libc is always only the + second best solution as certain parts of it will not be compiled when + crosscompiling. A proper solution will be documented here as soon as it is + available and believed to be stable.</sl> With this warning given, here's + the recipe: + <verb> + gzip -cd glibc-2.0.6.tar.gz | tar xf - + cd glibc-2.0.6 + gzip -cd glibc-crypt-2.0.6.tar.gz | tar xf - + gzip -cd glibc-localedata-2.0.6.tar.gz | tar xf - + gzip -cd glibc-linuxthreads-2.0.6.tar.gz | tar xf - + patch -p1 < ../glibc-2.0.6-mips.patch + mkdir build + cd build + CC=<target>-gcc BUILD_CC=gcc AR=<target>-ar RANLIB=<target>-ranlib \ + ../configure --prefix=/usr --host=<target> \ + --enable-add-ons=crypt,linuxthreads,localedata --enable-profile + make + </verb> + You now have a compiled GNU libc which still needs to be installed. Do + <sl>not</sl> just type make install. That would overwrite your host + system's files with Linux/MIPS-specific files with disastrous effects. + Instead, install GNU libc into some other arbitrary directory <somedir> + from which we'll move the parts we need for cross-compilation into the + actual target directory: + <verb> + make install_root=<somedir> install + </verb> + Now cd into <somedir> and finally install GNU libc manually: + <verb> + cd usr/include + find . -print | cpio -pumd <prefix>/<target>/include + cd ../../lib + find . -print | cpio -pumd <prefix>/<target>/lib + cd ../usr/lib + find . -print | cpio -pumd <prefix>/<target>/lib + </verb> + GNU libc also contains extensive online documentation. Your system might + already have a version of this documentation installed, so if you don't + want to install the info pages, which will save you a less than a + megabyte, or already have them installed, skip the next step: + <verb> + cd ../info + gzip -9 *.info* + find . -name \*.info\* -print | cpio -pumd <prefix>/info + </verb> + If you're not bootstrapping, your installation is now finished. + + <sect2>Building egcs again<p> + + The first attempt of building egcs was stopped by lack of a GNU libc. Since + we now have libc installed we can rebuild egcs but this time as complete as + a cross-compiler installation can be: + <verb> + gzip -cd egcs-<version>.tar.gz | tar xf - + cd egcs-<version> + patch -p1 < ../egcs-1.1.2-mips.patch + ./configure --prefix=<prefix> --target=<target> + make LANGUAGES="c c++ objective-c f77" + </verb> + As you can see, the procedure is the same as the first time, with the + exception that we dropped the --with-newlib option. This option was + necessary to avoid the libgcc build breaking due to the lack of libc. Now + install with: + <verb> + make LANGUAGES="c c++ objective-c f77" install + </verb> + You're almost finished. If you think you don't need the Objective C or + F77 compilers, you can omit them from above commands. Each will save you + about 3MB. Do not build gcov, protoize, or unprotoize. + + <sect2>Should I build the C++, Objective C or F77 compilers?<p> + + The answer to this question largely depends on your use of your + cross-compiler environment. If you only intend to rebuild the Linux kernel, + then you have no need for the full blown setup and can safely omit the + Objective C and F77 compilers. You must, however, build the C++ + compiler, because building the libraries included with the egcs distribution + requires C++. + + <sect2>Known problem when cross-compiling<p> + <sect3>IRIX crashes<p> + + Origin 200 running IRIX 6.5.1 may crash when running ``make depend'' + on the Linux kernel sources. IRIX 6.5 on Indy and IRIX 6.5.4 on + Origin 200 are known to work. + + <sect3>Resource limits on System V based hosts<p> + + Typical System V-based Unices, like IRIX or Solaris, have limits for + the maximum number of arguments to be passed to a child process which may + be exceeded when cross-compiling some software like the Linux kernel or GNU + libc. For IRIX systems, the maximum length of the argument list defaults + to 20KB, while Linux defaults to at least 128KB. This size can be modified + by the command ``systune ncargs 131072'' as root. + + <sect2>GDB<p> + + Building GDB as cross-debugger is only of interest to kernel developers. For + them, GDB may be a life saver. Such a remote debugging setup always consists + of two parts: the remote debugger GDB running on one machine, and the target + machine running the Linux/MIPS kernel being debugged. The machines are + typically interconnected with a serial line. The target machine's kernel + needs to be equipped with a ``debugging stub'' which communicates with the + GDB host machine using the remote serial protocol.<p> + + Depending on the target's architecture, you may have to implement the + debugging stub yourself. In general, you'll only have to write very simple + routines for the serial line. The task is further simplified by the fact + that most machines are using similar serial hardware, typically based on the + 8250, 16450 or derivatives.<p> + + <!-- Write something about building GDB --> + + <sect1>Compiling the kernel<p> + <sect2>Choosing a processor type<p> + <sect3>R2000, R3000 family<p> + + For these processors just select the R3000 option. A kernel built for this + option will not run on any other processors than R2000 and R3000 family + members.<p> + + <sect3>R4000, R5000 family<p> + + With the exception of the Nevada family these processors are all fully + compatible with rescpect to the kernel. Choose the option which matches + your processor best for optimal performance.<p> + + <sect3>R6000<p> + + Linux currently doesn't support the R6000 so this paragraph is entirely + theoretical. The R6000 has it's own, rather unique if not odd cache and + MMU architecture; it also requires alot of workarounds as it's a quite + broken piece of silicon. Therefore a R6000 kernel will not work on any + other processor nor will a kernel for another processor work on the + R6000.<p> + + <sect3>Nevada<p> + + The Nevada nickname stands for the QED 5230, 5231, R5260, R5261, R5270 etc. + family of CPUs. It enables the use of additional instructions which are + not supported on other processors therefore you only should choose this + opition if you indeed have one of these processors. If you're not sure + configure for R4x00 or R5000 (see above) which will result in a kernel + which will run on Navada family processors too but not use certain + optimizations specific to these processors.<p> + + <sect3>SB1<p> + + Choose this option only for the Sibyte SB1 processor. A kernel built for + this processor will not work on any other processor type nor vice versa. + + <sect3>R10000<p> + + Choose this option if you want to run Linux on a R10000, R12000 or R14000 + system. A kernel built with this option will not work on R4000 or R5000 + family processors. + + <sect3>MIPS32<p> + + Choose this option if you want to run Linux on a member of the MIPS32 + family.<p> + + <sect2>Compatible options<p> + + The kernel configuration process doesn't make a too strong attempt at making + wrong configuration impossible. So for example an SGI Indy may never have a + framebuffer, yet it's possible to enable it which later on will result in a + compile error. This situation will improve in the future when CML2 will be + the standard kernel configuration language; for 2.2 and 2.4 you still will + have to care of your steps yourself. + + <sect2>Crosscompilation<p> + The kernel has been carefully developped to ensure crosscompilation on a + non-MIPS system is possible. Once you've managed to get around the cliff of + setting up a crosscompiler crosscompiling is easy. To do so you have two + options. First you can pass CROSS_COMPILE=<target>- (note the trailing + dash) as an additional argument to your make invocations where you choose + one of mips-linux, mipsel-linux, mips64-linux or mips64el-linux depending if + your target is big or little endian, 32-bit or 64-bit.<p> + An alternate and probably easier way is setting the CONFIG_CROSSCOMPILE + configuration option. The kernel will then automatically choose the right + value for CROSS_COMPILE which will keep make command lines a bit simpler. + + <sect2>32-bit vs. 64-bit<p> + + By default the Linux/MIPS kernel source tree is configured to build a 32-bit + target. If you want to build a 64-bit 2.4.x kernel you'll have pass the + additional ARCH=mips64 argument to all you make invocations. In 2.6.x + this has become a normal config option. + +<sect>Documentation<p> + <label id=documentation> + <sect1>Getting this information as a single document<p> + + You can download this document in various formats: + <itemize> + <item>The HTML version + <url url="http://howto.linux-mips.org/mips-howto.html"> + <item>The text version + <url url="http://howto.linux-mips.org/mips-howto.txt"> + <item>The Postscript version + <url url="http://howto.linux-mips.org/mips-howto.ps"> + <item>The Linux-Doc SGML version. + <url url="http://howto.linux-mips.org/mips-howto.sgml"> + </itemize> + + This FAQ is also available as SGML source code via anonymous CVS from + ftp.linux-mips.org. The archive also has a Makefile which will translate it + into various formats. An ASCII version is regularly being posted via + <em>comp.os.linux.answers</em> and the other Linux HOWTO channels. + + Updates for this document should be sent as unified diffs against the + SGML version to <htmlurl url="mailto:ralf@gnu.org" + name="Ralf Bächle (ralf@gnu.org)">. Please don't updates in any + other form as that will make maintenance significantly more difficult. + + <sect1>See MIPS Run<p> + Author Dominic Sweetman, Publisher Morgan Kaufmann, ISBN 1-55860-410-3. + + This is intended as a pretty comprehensive guide to programming MIPS, + wherever it's different from programming any other 32-bit CPU. It's the + first time anyone has tried to write a readable, and comprehensive, + explanation and account of the wide range of MIPS CPUs available. It should + be very helpful for anyone programming MIPS who isn't insulated by someone + else's operating system. Also, the author is a free-unix enthusiast who + subscribes to the Linux/MIPS mailing list! + + John Hennessey, father of the MIPS architecture, was kind enough to write + in the foreword: ``... this book is the best combination of completeness + and readability of any book on the MIPS architecture ...''; + + It includes some context about RISC CPUs, a description of the + architecture and instruction set, including the "co-processor 0" + instructions used for CPU control; sections on caches, exceptions, memory + management, and floating point. There's a detailed assembly language + guide, some stuff about porting, and some fairly heavy-duty software + examples. + + Available from: + + <itemize> + <item><htmlurl + url="http://www.mkp.com/books_catalog/catalog.asp?ISBN=1-55860-410-3" + name="Morgan Kaufmann"> (US) + <item><htmlurl + url="http://www.amazon.com/exec/obidos/ASIN/1558604103/algorithmicsltd" + name="Amazon USA"> + <item><htmlurl + url="http://www.amazon.co.uk/exec/obidos/ASIN/1558604103/algorithmicsltd" + name="Amazon UK"> + </itemize> + + and from good bookshops anywhere. It's 512 pages and costs around + $50 in the US, £34 in the UK. + + I'd be inclined to list two other books too, both from Morgan Kaufmann and + available from www.mkp.com or any good bookshop: + + <sect1>The MIPS Programmer's Handbook<p> + Authors Farquhar and Bunce, Publisher Morgan Kaufmann, + ISBN 1-55860-297-6. + + A readable introduction to the practice of programming MIPS at the low + level, by the author of PMON. Strengths: lots of examples; weakness: + leaves out some big pieces of the architecture (such as memory management, + floating point and advanced caches) because they didn't feature in the LSI + ``embedded'' products this book was meant to partner. + + <sect1>Computer Architecture - A Quantitative Approach<p> + Authors Hennessy & Patterson, Publisher Morgan Kaufmann, + ISBN 1-55860-329-8. + + The bible of modern computer architecture and a must-read if you want + to understand what makes programs run slow or fast. Is it about MIPS? + Well, it's mostly about something very <em>like</em> MIPS... Its sole + defect is its size and weight - but unlike most big books it's worth + every page. + + <sect1>MIPS ABI documentation<p> + + The documentation to be found at <url + url="ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/"> defines many of the + MIPS specific technical standards like calling conventions, ELF properties, + and much more that is being used by Linux/MIPS, including the N32 standard. + + <sect1>The mips.com site<p> + + Under <url url="http://www.mips.com/publications"> there are various PDF + documents and data sheets about individual processors and cores. + + <sect1>The NEC site<p> + + NEC Electronics (<url url="http://www.necel.com"> includes complete manuals + about their VR41xx processors. + + <sect1>techpubs.sgi.com<p> + + While being very SGI centric <url url="http://techpubs.sgi.com"> has a number + of ABI related documents online that also apply to Linux/MIPS. + +<sect>Legal Notices + + <sect1>Copyright<p> + + Except where otherwise specified, the information in this documentation or + website is copyright (c) 1998,1999,2000,2001,2002 Ralf Bächle.<p> + + Permission is granted to copy, distribute and/or modify this document under + the terms of the GNU Free Documentation License, Version 1.1 or any later + version published by the Free Software Foundation; with the Invariant + Sections being Copyright, with no Front-Cover Texts and with no Back-Cover + Texts.<p> + + A copy of the GNU Free Documentation License is available on the World Wide + Web at <url url="http://www.gnu.org/copyleft/fdl.html"> You can also obtain + it by writing to the + <verb> + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307 + USA + </verb> + <sect1>Software Use<p> + + Any software contained in or linked to by this documentation (the "Software") + is copyrighted work. To use the Software you must comply with the terms of + the Software's license agreement. SOFTWARE IS WARRANTED, IF AT ALL, IN + ACCORDANCE WITH THE TERMS OF THE LICENSE AGREEMENT. EXCEPT AS SET FORTH IN + THE LICENSE AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND + WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT + THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. <sect1>Links to + websites <p> + + This documentation may contain links to websites which are not under our + control. We are not responsible for the content of those sites. The links are + available only as a convenience, and the inclusion of any link to such sites + does not imply endorsement of those sites. + + <sect1>Trademarks <p> + + Linux is a Registered Trademark of Linus Torvalds. <p> + MIPS is a Registered Trademark of MIPS Technologies, Inc. + + <sect1>Disclaimer<p> + + Note that, as provided in the License, the software on this website is + distributed on an "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND + CONDITIONS DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES + AND CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A + PARTICULAR PURPOSE, AND NON-INFRINGEMENT. <sect1>Limitation of liability<p> + + THE AUTHORS OF THIS WEB SITE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED AS + A RESULT OF USING, MODIFYING, CONTRIBUTING, COPYING, DISTRIBUTING, OR + DOWNLOADING THE MATERIALS ON THIS WEBSITE. IN NO EVENT SHALL WE BE LIABLE FOR + ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGE + (INCLUDING LOSS OF BUSINESS, REVENUE, PROFITS, USE, DATA OR OTHER ECONOMIC + ADVANTAGE) HOWEVER IT ARISES, WHETHER FOR BREACH OR IN TORT, EVEN IF WE HAVE + BEEN PREVIOUSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + YOU HAVE SOLE RESPONSIBILITY FOR ADEQUATE PROTECTION AND BACKUP OF DATA + AND/OR EQUIPMENT USED IN CONNECTION WITH THE WEBSITE AND WILL NOT MAKE A + CLAIM AGAINST THIS WEB SITE OR ITS AUTHORS FOR LOST DATA, RE-RUN TIME, + INACCURATE OUTPUT, WORK DELAYS OR LOST PROFITS RESULTING FROM THE USE OF THE + MATERIALS. YOU AGREE TO HOLD US HARMLESS FROM, AND YOU COVENANT NOT TO SUE US + FOR, ANY CLAIMS BASED ON USING THE WEBSITE. + +</article> diff --git a/LDP/retired/MMBase.sgml b/LDP/retired/MMBase.sgml new file mode 100644 index 00000000..cb01dea2 --- /dev/null +++ b/LDP/retired/MMBase.sgml @@ -0,0 +1,262 @@ +<!doctype linuxdoc system> + +<article> +<title>MMBase Mini-HOWTO: Installation on Debian Woody + +<author>Casper Joost Eyckelhof <tt/<joost@dnd.utwente.nl>/ <newline>University of Twente +<date>v0.2, 28 May 2002 + +<abstract> +This document briefly describes how to set up MMBase on a Debian Gnu/Linux (Woody) system +while using as much default packages as possible. +</abstract> + +<toc> + +<sect>Introduction<p> + +<sect1>Homepage<p> + +If you got this document from a Linux HOWTO mirror site or a CD-ROM, +you might want to check back to the <url name="MMBase Mini-HOWTO home +page" url="http://www.dnd.utwente.nl/~joost/mmbase-mini/MMBase-Mini-HOWTO.html"> to see if there's a +newer version around.<p> + +This document only covers a very small portion of MMBase installation, for +the official documentation visit <url name="MMBase home page" +url="http://www.mmbase.org">.<p> + +<sect1>Disclaimer<p> +No liability for the contents of this documents can be accepted. +Use the concepts, examples and other content at your own risk.<p> + +All copyrights are held by their respective owners, unless specifically noted otherwise. +Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark.<p> + +Finally, this is my first HOWTO, my first experience with linuxdoc and I am no expert on +MMBase either. I am just trying to share my solutions to some problems I encountered while installing +MMBase on a Debian system.<p> + +<sect1>History<p> + +0.2 Updated for MMbase 1.5; lost support for apache frontend<p> + +0.1 Initial version - Installing MMBase 1.4 on Woody<p> + +<sect1>Copyright<p> + +Copyright (c) 2001-2002 Casper Joost Eyckelhof, All rights reserved. This is free +documentware; you can redistribute it and/or modify it under the terms of +version 2 or later of the <url name="GNU General Public License" +url="http://www.gnu.org/copyleft/gpl.html">.<p> + +<sect1>Acknowledgements<p> +I would like to thank a number of people for helping me during my quest for a clean installation. +Although I do not know their names, their nicknames on irc are: <em>keesj, jdg, flax, scb2</em>. +I hope they forgive me for not trying to find out their real names.<p> +I would also like to thank my employer, the <em>University of Twente</em> for allowing me to write this +document during working hours. + +<sect>What is MMBase?<p> +On their website, the authors say the following about it:<p> +<itemize> +<item>MMBase is an opensource publishing system. MMBase can be used to create big websites that can be maintained easily. +<item>MMBase separates content from layout, in this way information can be reused easily. +<item>MMBase is very unique in the way it maintains its information. MMBase creates an object cloud that is a digital representation of the 'real' world objects that are of interest for you.<p> +</itemize><p> + +In this document I will describe how to get MMBase running on a Debian Woody System, using +as many standard packages as possible. Though it is very easy to run MMBase using their +automatic installation tools, you will end up with their version of a webserver, servlet engine +and database.<p> +After a few days of playing with my own install, I think I can help others by describing +which choices I made to get things running. I do not claim this is the only way, or the best way! +But it worked for me :)<p> + +The version of MMBase used is 1.5. Ofcourse everything might be different with another version.<p> + +MMbase can run together with various webservers, databases, servlet engines and JRE's. +The programs/packages/versions I chose are:<p> +<itemize> +<item>MySQL-Server (3.23.49-8) +<item>Tomcat4 (4.0.3-3) +<item>j2sdk1.3 (1.3.1-1) (Java) +<item>imagemagick (4:5.4.4.5-1) +</itemize><p> + +Attention: The version numbers are those that were available in +the Woody distribution at the time of writing. Except for Java, which +came from a different location. See <ref id="java" name="Non standard package(s)">. +<p> + +Some other options for databases and webservers are described in the +installation notes for MMBase 1.5 +<p> + +<sect>Prerequisites<p> + +You will need a working Debian Woody installation, including apt, and make sure +the following packages are installed and working correctly. + +<sect1>Standard packages<p> +<itemize> +<item>tomcat4 +<item>mysql-server +<item>imagemagick +</itemize><p> + +If these packages are not installed, you can do so by typing +<tscreen><verb> + apt-get install packagename +</verb></tscreen> +where packagename is one of the above.<p> + +Note: naturally you will need al dependencies too, but apt will take care of that +automatically. + +<sect1>Non standard package(s)<label id="java"><p> +While writing this document, Woody only contains java 1.1, but for MMBase +version 1.2 or higher is needed. I installed the packages from Blackdown. +A list of Blackdown mirrors is at <url name="http://www.blackdown.org/java-linux/mirrors.html" + url="http://www.blackdown.org/java-linux/mirrors.html">.<p> + +I added the following to my /etc/apt/sources.list , but the path might be different for different mirrors: +<tscreen><verb> + deb ftp://ftp.nluug.nl/pub/os/Linux/java/jdk/debian woody non-free +</verb></tscreen><p> + +After that you can just type +<tscreen><verb> + apt-get install j2sdk1.3 +</verb></tscreen><p> + +Note: Although it must be possible to have more JRE's installed next to eachother, I wouldn't recommend +it if it's not absolutely neccesary. + +<sect>Getting MMBase and setting up some things<p> +<sect1>Getting MMBase<p> +Now that you have all supporting packages up and running (you <em>did</em> +follow the instructions in the previous section, didn't you?) get yourself a copy of MMBase. +As said before, this document describes the works for MMbase version 1.4.<p> + +Download MMBase from <url name="http://www.mmbase.org/releases/mmbase-1.5.zip" +url="http://www.mmbase.org/releases/mmbase-1.5.zip"> with a browser, or even easier: +<tscreen><verb> + wget http://www.mmbase.org/releases/mmbase-1.5.zip +</verb></tscreen><p> + +From version 1.5 MMBase can be used as an webapp within Tomcat. So I +recommend unpacking the distribution in a temporary directory and copying +the mmbase-webapp/ tree to /var/lib/tomcat4/webapps/. +If MMBase is your only (or main) application on Tomcat, you can also install +it as ROOT, by copying everything from mmbase-webapp/ to /var/lib/tomcat4/webapps/ROOT/. + +In this document I will assume that MMBase is unpacked in +/var/lib/tomcat4/webapps/mmbase-webapp/<p> + + +<sect1>Getting mm.mysql<p> + +You will also need mysql.jar (JDBC driver for MySQL) which can be downloaded from +<url name="http://mmmysql.sourceforge.net/" url="http://mmmysql.sourceforge.net/">. <newline> +Make sure you get the binary jar, which means you may have to unjar the +complete distribution first and locate the file mm.mysql-2.0.14-bin.jar +(2.0.14 was the latest release when writing this HOWTO) +Put the file in /var/lib/tomcat4/webapps/mmbase-webapp/WEB-INF/lib/.<p> + + +<sect1>Creating a database for MMBase<p> +MMbase needs a database and a user that has full rights on that database. +The user seems to needs rights via localhost and the real hostname. +This was not entirely clear to me.<p> + +Issue the following commands on the MySQL prompt. I chose a database called MMBase, a user named mmbaseuser and +the password secret.<p> +<tscreen><verb> +CREATE DATABASE MMBase +USE MMBase +GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON MMBase.* TO mmbaseuser@'%' IDENTIFIED BY 'secret'; +GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON MMBase.* TO mmbaseuser@localhost IDENTIFIED BY 'secret' +GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON MMBase.* TO mmbaseuser@realhostname IDENTIFIED BY 'secret' +flush privileges; +</verb></tscreen><p> + +<sect1>Tomcat security manager<p> +The Tomcat java security manager somehow interferes with MMBase. I haven't +found out what settings are needed to run MMBase with the security manager +active. Please let me know. For now I disabled the security manager, which +you should never not do. (Big Disclaimer!) + +In /etc/default/tomcat4 change the security line to:<newline> +TOMCAT4_SECURITY="no" + +<sect1>Copying xml-apis<p> +For some odd reason, Tomcat wants to find the file WEB-INF/lib/xml-apis.jar also in +/usr/share/tomcat/common/lib/xml-apis.jar, so you have to copy it.<p> + +<sect>Configuration files<p> +There are various configuration files that need some adjustment or have to be created. + +<sect1>apache<p> +In my setup, I created a virtual host to handle all MMBase request, but using a few <em>Alias</em> directors +it cannot be too hard to include MMBase somewhere in your normal web tree.<p> + +That was for my last setup (HOWTO version 0.1 covering MMBase 1.4). + +Using the newest version of Tomcat and Apache, I have troubles getting the +two working together. As soon as I find out how to use libapache-mod-webapp +or libapache-mod-jk with tomcat4, I will update this HOWTO.<p> + +One posible solution is compiling mod-webapp yourself, because the version +that comes with Debian seems to be non-standard. This is beyond the scope and intention of this +HOWTO.<p> + +This also means that by default MMBase will run on port 8180 (directly from +the stand-alone Tomcat server. You can change this port in +/etc/tomcat4/server.xml + +<sect1>MMBase<p> +Although many things have to be configured on MMBase itself, I have added a few subjects to this mini-HOWTO.<p> +The database access should be set in WEB-INF/config/modules/jdbc.xml :<p> + +<tscreen><verb> + <property name="url">jdbc:mysql://$HOST:$PORT/$DBM?user=mmbaseuser&password=secret&etago;/property> + <property name="user">url&etago;/property> + <property name="password">url&etago;/property> + <property name="database">MMBase&etago;/property> + <property name="driver">org.gjt.mm.mysql.Driver&etago;/property> +</verb></tscreen><p> + +And one more line to change to get the mysql connection working. In WEB-INF/config/modules/mmbaseroot.xml +make sure you have this setting: + +<tscreen><verb> + <property name="database">mysql&etago;/property> +</verb></tscreen><p> + + +The builder for images contains a path to convert that is not Debian-compliant. Change +WEB-INF/config/builders/images.xml + +<tscreen><verb> + <properties> + <property name="ImageConvert.ConverterCommand">bin/convert&etago;property> + <property name="ImageConvert.ConverterRoot">/usr/&etago;property> + <property name="ImageConvertClass">org.mmbase.module.builders.ConvertImageMagick&etago;property> + &etago;properties> +</verb></tscreen><p> + + +<sect>Getting more help<p> +There are various sources for more help on most of the subject covered in this mini-HOWTO. All packages have +their own documentation. Some links that really helped me are:<p> +<itemize> +<item>Apache: <url name="http://httpd.apache.org/docs/" url="http://httpd.apache.org/docs/"> +<item>Tomcat: <url name="http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html" url="http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html"> +<item>MMBase: Click on Documentation on <url name="http://www.mmbase.org/" url="http://www.mmbase.org/"> +<item>Java: <url name="http://java.sun.com/" url="http://java.sun.com/"> +</itemize><p> + +Another great source for help is channel #mmbase on ircnet, usually there are some developers there. + +</article> diff --git a/LDP/retired/Oracle-8-HOWTO.sgml b/LDP/retired/Oracle-8-HOWTO.sgml new file mode 100644 index 00000000..def3d681 --- /dev/null +++ b/LDP/retired/Oracle-8-HOWTO.sgml @@ -0,0 +1,1151 @@ +<!doctype linuxdoc system> + +<article> + +<title>Oracle 8i for Linux Installation HOWTO +<author>Stephen Darlington, <tt><stephen at zx81 dot org dot uk></tt> +<date>v1.18, 19 July 2003 + +<abstract> +With this HOWTO, and a little luck, you will be able to get "Oracle 8i +Enterprise Edition for Linux" installed, create a database and connect +to it from a remote machine. The main focus of this guide is RedHat +Linux 6.0 and Oracle 8.1.5, although it should work well for other +recent distributions and more stable versions of Oracle. +</abstract> + +<toc> + +<sect>Introduction + +<sect1>What's in here? +<p> +Linux is well known for being difficult and, generally, user +hostile. Being a bit of a Unix fan I'm not sure whether I agree with +that or not. + +Oracle is similar I guess. Initially it's difficult to get to grips +with, but it's difficult to work with any other RDBMS when you're used +to it. + +Combine the two, remember that 8i is only the second production +release, and you realise that this isn't going to be straight-forward, +even if you're familiar with both. + +I am, but I had problems. Many problems were my own stupidity or +hubris, but I document them for completeness. + +<sect1>Who is this HOWTO for? +<p> +Fundamentally this document is about installing Oracle 8i Version +8.1.5.0.0 on RedHat Linux 6.0, and any deviation from this +configuration may reduce your chances of success. (I originally tried +to write this guide for all types of Linux and all recent version of +Oracle, but the structure was unclear and it was less useful for just +about everyone.) + +For later versions of Oracle, including 9i, you have two options. I +have some errata on <url +url="http://www.zx81.org.uk/computing/oracle/oracle-howto/" name="my +website">. You'll find that the process is very similar to that found +in this document although there are some 'gotchas' for each +version. Generally speaking, newer version of Oracle are much easier +to install than 8.1.5 and are recommended over it by just about +everyone, including Oracle themselves. + +Or if you prefer there are also a number of other, more specific +guides at the Linux Documentation Project (in fact there seems to be a +new one there every time I check back!). If you're installing 8i on +RedHat 7.x, <url +url="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Oracle8-on-RH7X-HOWTO.html" +name="Krastio Atanassov and Luca Roversi's"> HOWTO might be useful. For +installing Oracle 9i on RedHat 8 or above, <url +url="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Oracle-9i-RH8-and-RH9-HOWTO.html" +name="Evgueni Tzvetanov's"> guide could well do the trick. + +For different distributions of Linux chances of success are also good, +especially if they are RedHat-like, Mandrake for example. Again, my +web site may contain advice for certain troublesome distributions. + +If you want to install 8.0, I recommend you try <url name="Linux +Journals guide" +url="http://www2.linuxjournal.com/lj-issues/issue67/3572.html">, and +if you want to install any of the previous versions you're going to +have to use the SCO version and follow Paul Haigh's <url name="Oracle +Database HOWTO" +url="http://www.tldp.org/HOWTO/Oracle-7-HOWTO.html">. + +If you're trying to install the 'right' version, what level of +background knowledge will you need? + +Perhaps the easiest way is if I explain a little of my background, +clearly if yours is similar we're going to be on the same +wave-length. I've used a lot of Unix and Oracle over the last few +years. At home I've been running Linux since 1994 and I've been using +Solaris and HP-UX on-and-off since 1992. I first came across Oracle in +1996 and have worked with versions 7, 8 and 8i. I'm mainly a +developer, but I have done DBA and sysadmin-type work. + +In summary, I can find my way around a Unix box and I know much of the +Oracle terminology. You'll need both to brave the rest of this +document. But don't worry if you have a different background, follow +this guide closely and keep asking questions. The Linux community are +a helpful bunch, just don't expect an answer if you haven't at least +made an effort to solve the problem yourself. + +<sect1>New versions of this document +<p> +Since RedHat Linux 6.x is no longer being supported and given that +there will be no new releases of Oracle 8i, you can probably assume +that this is the most up-to-date version of this document. + +As discussed in the previous section, there are documents in <url +url="http://www.tldp.org" name="the LDP"> and extra sections on <url +url="http://www.zx81.org.uk/" name="my website"> that might help you +get more contemporary versions of Oracle installed on newer versions +on Linux. + +<sect1>Disclaimer +<p> +You get what you pay for. I offer no warranty of any kind, implied or +otherwise. I'll help you where I can but legally you're on your own. + +<sect1>Credits and Thanks +<p> +This HOWTO has been written by Stephen Darlington. It couldn't have +been created without the constant stream of questions and answers on +the Oracle Technology Network website and the Usenet news-groups. So +thanks to the people that keep posting and sorry that I can't credit +you all individually! + +Many people have emailed me directly with hints, updates and +corrections; this document would not be as useful as it is without +their contribution. So thanks go to the following people: Ton Haver, +Guy Cole, Iain Frerichs, Albert Braun, Steve Morando, Krill Kokoshka, +Brain Slesinsky, Galen G Burk, Bill Gathen and Veres Lajos. + +I welcome any constructive feedback on this HOWTO and any general +Linux or Oracle issues. However, if you have questions it's probably +better that you ask on a newsgroup or the discussion forums on my +website where others can benefit from the solutions. Email me at <url +url="mailto:stephen at zx81 dot org dot uk" name="stephen at zx81 dot +org dot uk">. + +<sect1>Licence +<p> +This document is copyright 1999-2003 Stephen Darlington. You may use, +disseminate and reproduce it freely, provided you: + +<itemize> +<item>Do not omit or alter this copyright notice. +<item>Do not omit or alter the version number and date. +<item>Do not omit or alter the document's pointer to the current WWW +version. +<item>Clearly mark any condensed, altered or versions as such. +</itemize> + +These restrictions are intended to protect potential readers from +stale or mangled versions. If you think you have a good case for an +exception, ask me. + +(This copyright notice has been lifted from Eric Raymond's Distribution +HOWTO.) + +You do not need to ask me if you'd like to provide a translation, +although notification would be appreciated. + +<sect>Starting off + +<sect1>Overview +<p> +In this section, we'll set up Linux so that you're in a position to +get Oracle 8i from the CD that they sent you into your hard-disk. (If +they didn't send you a disc and you're working from a tar-ball that +you downloaded from the Internet, don't worry. The installation +process is identical.) + +The Oracle installation process begins when you've built your PC, +installed Linux, configured it and connected it to your network. + +<sect1>Prerequisites +<sect2>Your brain +<p> +This may sound like a very silly prerequisite, but I do mean it +although not necessarily in the same way you might be thinking just +now. There are two main problems. + +Firstly, both Oracle and Linux change very frequently. This is a good +thing in that bugs and security holes gets fixed quickly and there are +always new and exciting enhancements to play with and, with luck, +solve the problems we're actually paid to solve. The bad news is that +no matter how much effort I put into this document it'll never be +completely up to date. + +The onus is, therefore, on you to engage brain. Sometime Oracle change +small things. The dialog used to say "OK" but now says "Okay", or the +screens are in a slightly different order, or... well, it could be any +number of things. There's no way I can keep up on all the changes like +that, just like there's no way that I can provided detailed guides for +every version of Oracle running on every possible Linux distribution. + +Or it could be the big, complex things, like when RedHat Linux 7 first +came out with new C libraries and a slightly non-standard C +compiler. You could apply the first point here, applying your brain, +reading the release notes, the RedHat website and Oracle Technet but +you'd be spending more time than you need to be. The reason is problem +number two: the culture clash. + +In the case of Linux, newer is better. People frequently upgrade their +OS to the latest and greatest and it's certainly not unusual to add or +upgrade individual packages to something more familiar or more +powerful. This is not how things are done in the world of +Oracle. Companies are still running Oracle 6, software that has been +available for more than ten years. (Oracle have not supported this for +quite some time, so this isn't terribly smart.) People here value +stability and change, so loved by many Linux die-hards, is the +complete antithesis of it. + +The trick to applying this to installing Oracle 8i on your Linux box +is to read the release notes. If they recommend RedHat Linux 6, as +they did for Oracle 8i 8.1.5, this is the distribution that you should +use unless there's a <it/very/ good reason to do otherwise. The same +for any other requirements they state: their hardware and software +requirements have, to date, been pretty accurate. + +<sect2>Hardware +<p> +I think that the most important part of the prerequisites is not to +underestimate them. Oracle is a very big and complex application and +you won't get the best out of it if you skimp too much on the +hardware. + +My biggest mistake was to assume that Oracle were joking when they +said that you need 128Mb of RAM. I've installed Oracle a couple of +times on Sun servers with that much, why would I need more on a CISC +machine? + +Believe Oracle not my gut. My machine with 32Mb of Ram ground on for +less than half an hour before I realised that it was hopeless. + +I was trying to use the bare minimum of hardware, and that's generally +a bad idea. If you can't afford the hardware you certainly won't be +able to afford the licences! + +Things to look for on a production server are many disks, possibly +RAIDed, and fast CPU's. Database access is relatively easy to break +down into smaller parallel phases so having a number of processors +really does help. + +On the other hand, any machine that can run Linux and that has enough +memory should be in with a chance. My other machine, the one I used +for the rest of this document, is fine as a development machine. It is +a Celeron 466Mhz with 128Mb of memory, an 8Gb hard disk, an Intel +graphics card and a DM9102 network card. + +<sect1>Linux setup + +<sect2>Choice of distribution +<p> +Oracle seem to have done most of their development on RedHat Linux +6.0. For a fuss-free installation, using RedHat is an excellent +idea. Using version 6.2 with all the patches will be the easiest. For +RedHat Linux 7 and later refer to my website. Depending on how you've +installed your operating system there may be extra steps required. + +I've heard horror stories about trying to get it installed on other +distributions. However, as a general rule, anything <it/like/ RedHat +should also do the trick. A recent version of Mandrake should be fine +and SuSE, in fact, are fairly active in supporting Oracle and have a +<url url="http://www.suse.com/us/solutions/partners/oracle/" name="web +page"> dedicated to the task. + +The further you get from RedHat the more problems you can expect. + +<sect2>Distribution Setup +<p> +Now that you've decided on which RedHat-like distribution you're going +to use, you'll need to work out which options to set and which of the +vast number of packages need to be installed to make Oracle work. + +Firstly you need two to three times the amount of memory you have for +your swap space. (You'll need around 200Mb of memory, real or virtual, +just to run the installer!) Note that contrary to popular opinion, +Linux swap partitions can be larger than 128Mb. + +The arrangements of your other partitions can also be important. Make +sure that the Oracle software is on a different partition to your +operating system, and make sure that the Oracle data-files are on yet +another partition. The idea here is to make sure that your data-files +do not get fragmented. (In a live environment, you're likely to have a +number of disk with Oracle spread across them. There are a number of +good books that you consult for more information on this.) Also, make +sure you have <it/at least/ 400Mb free in <tt>/tmp</tt> and that it's +not on the root filesystem. + +As for the software, I took the easy option and installed just about +everything. You certainly need all the 'base' packages, X Windows (the +installation routine is a Java GUI) and the development tools +regardless of whether you intend doing any coding or not. Compared to +the size of Oracle and your databases a Linux distribution is tiny, +probably less than a gigabyte. It's worth installing it all for an +easy life! + +<sect2>Kernel parameters +<p> +The documentation suggests that you make changes to the Linux kernel +so you can get more shared memory. Since I was only planning on +running a very small database, I assumed everything would be okay and +decided to go ahead with the installation anyway. The default RedHat +Linux settings worked, although you may have to change them for a +larger development or production system. + +Note that some people have had to recompile the kernel to get Oracle +to work at all. I guess it must depend on the other software that +you're running on the same machine. + +Follow the instructions in the Oracle documentation (on the +installation CD in HTML format) and the <url name="Linux Kernel HOWTO" +url="http://www.tldp.org/HOWTO/Kernel-HOWTO.html"> to build your +new kernel. + +<sect2>Users and groups +<p> +Using LinuxConf (or whatever other method you feel comfortable with), +you need to add a new group called "dba" and a new user called +"oracle", which should belong to your newly created "dba" group. + +You can make any other user a DBA by putting them in the DBA group. If +you have several DBA's this is probably a good idea for auditing +purposes. + +<sect2>Installing the right Java Virtual Machine +<p> +Oracle were obviously stung by Java on their first release. All full +release of 8i since 8.1.6 have included their own virtual machine so +you don't need to get your own. In fact, make sure that you remove any +reference to Java you currently have (you don't need to delete it, +just remove it from your PATH and make sure that no other variable, +such as JAVA_HOME or CLASSPATH, are set). The installer is +temperamental enough without adding more variables. + +If you're installing 8.1.5, read on: + +If you check the official documentation, you'll find that Oracle +recommend the Blackdown Java Runtime Environment version 1.1.6v5. +That's what they mean. Don't think 'newer versions will be less buggy' +as the installer probably won't work. And don't think, 'I'll be +developing software so I'll just get the JDK,' as that won't work +either. + +There is one caveat to using this version of the JRE: the Oracle +installer seems to be hard-coded to expect the JRE executable to be at +<tt>/usr/local/jre/bin/jre</tt>. While this is inconvenient, it does +not mean that you have to install it there. + +I performed the following steps to get a working copy of the JRE: + +<enum> +<item>Download the Java Runtime Environment from the <url +name="Blackdown website" url="http://www.blackdown.org"> + +<item>Move to where you want to install the JRE: + +<verb>cd /usr/local</verb> + +<item>Uncompress the archive: + +<verb>bzip2 -d -c jre-1.1.6-v5-glibc-x86.tar.bz2 | tar xvf -</verb> + +<item>Create a symbolic link between where Oracle thinks it is and +where it actually is: <verb>ln -s jre116_v5 jre</verb> + +</enum> + +<sect1>Starting off questions and answers + +<sect2>Do I really need 128Mb RAM? +<p> +I would recommend that you do use 128Mb of RAM or more. I think it +would be difficult to get any serious work done with less. + +However, if you disable the Java option and set all the shared memory +settings to be relatively small, there's no reason why it shouldn't +work. I've heard success stories with 64Mb. You're probably not going +to get away with 32Mb, though. + +There is a caveat. You may only need half of what Oracle recommends to +run the thing, but to install it their number starts to make +sense. I've heard reports of the installer using 150Mb of memory and +I've seen it well over 120Mb myself. If you have 64Mb or less of +memory, make sure you have lots of swap space and patience. + +An alternative if you absolutely can't add more memory: install Oracle +on another, bigger machine and copy across the <tt/$ORACLE_HOME/ +directory. You'll need to make sure that you have all the same users +and groups (preferably with the same numeric codes) and take special +care with SUID executables like <tt>$ORACLE_HOME/bin/oracle</tt>. + +<sect2>Does it work with Debian/SuSE/Mandrake/some other distribution? +<p> +Oracle specify the Linux kernel version 2.2 or above and GLIBC version +2.1 with any window manager. In theory, any distribution that meets +these requirements should work. + +In practice, unless Oracle have certified you distribution they may +not support it and you may have more problems trying to complete the +installation. Unless you have a very good reason to do otherwise I +suggest you stick to RedHat Linux 6.x with all the patches you can get +hold of. + +For the record, I've heard success stories will all those +distributions. Some, however, consistently cause problems, Slackware +being the main culprit. + +<sect2>Does it work with GLIBC 2.2 distributions? +<p> +At the moment, RedHat Linux 7.x and other distributions based on GLIBC +2.2 are known to be fairly problematic. It is possible to make it +work, however. To avoid "clutter" in this document I've included the +details <url +url="http://www.zx81.org.uk/computing/oracle/oracle-howto/redhat7.html" +name="on my website">. + +<sect2>Does it work with development kernels? +<p> +There's no obvious reason why it shouldn't work -- I used 2.3.19 for a +while because it supported my network card and the stable kernel at +the time didn't -- but unless there's a pressing need it's certainly +safest to stay well clear. I switched back to the stable series as +soon as the driver was included. + +<sect2>Does it work with Linux 2.4? +<p> +The current stable kernel has a number of features and performance +improvements over the 2.2.x line that Oracle could benefit from. Can +you use it without risking disaster? The answer is definitely "yes." + +Generally the kernel is upwardly compatible with 2.2.x and I've not +heard of any significant problems with any of the more recent 2.4 +releases (although some of the early ones are almost certainly worth +avoiding). + +<sect2>Does it work with Linux 2.5.x and 2.6? +<p> +At the time of writing, the 2.6 kernel is just enter its beta testing +phase, so the same advice as for previous development kernels applies +here too. Summary: no technical reason why you can't use them, but not +recommended especially in a live environment. + +<sect2>Where do I get Oracle from? +<p> +Firstly, if you're brave, have a very fast Internet connection or +inexhaustible patience (and unmetered access) you can download it from +<url name="Oracle Technology Network" +url="http://otn.oracle.com/">. Beware: 8.1.5 is nearly 200Mb, and +8.1.7 is nearer 500Mb. + +A better option is to get the CD. Oracle sometimes offer to send you a +free development CD when you join Technet. It's certainly worth +spending some time looking round their web site for +that. Alternatively, you can buy them from the Oracle Store for around +$40. It includes lots of other software too and comes on 15 discs. + +<sect2>What if I just want to connect to an Oracle database? +<p> +If you have an Oracle database on another machine and just want to +connect to it from another Linux machine, the process is very similar +to that described here but with less of the complex stuff. + +Oracle tend not to distribute an Oracle Client CD for anything other +than Windows. Instead you just use the same Oracle Enterprise CD and +select the "Oracle Client" or "Oracle Developer" (not to be confused +with the Oracle Developer product) when it asks what kind of +installation you want. + +All the other advice, about using the correct version of Linux, the +Java distribution, etc, are all just as pertinent for the client +install as for the server, since the same installer is used. + +<sect>The installer +<sect1>How? +<p> +Generally, following the documentation is a good idea. It's not that +bad and you'll get much better support from Oracle if you have. (I +ended up breaking things -- and knowing it would -- by following the +documentation for Oracle Applications. It was the only way to get +decent support.) + +This document is going to give an overview, but you should still have +their documentation available. + +<sect1>What do I tell the installation program? +<p> +As part of the installation Oracle will ask a number of +questions. Generally they're not too difficult but let's see what I +entered and why. + +<enum> +<item>Many people make the mistake of following Oracle's documentation +and, therefore, fail at the first hurdle. Don't execute +<tt/runInstaller/ as it almost always fails. Instead move to +<tt>install/linux</tt> on the CD and run <tt/runIns.sh/ while logged +in as 'oracle'. + +<item>It should show a title screen. Click 'Next.' + +<item>It should ask you to enter the source directory of the +installation files ('jar' file) and your Oracle installation +directory. You should be able to leave the former alone. The Oracle +home directory is where you want to install the software. According to +the installation documentation is should be somewhere on +<tt>/u01</tt>, but I ignored that and put it in +<tt>/home/oracle</tt>. Oracles advice, in this respect, is usually +worth following. Click 'Next' when you've entered the details. + +<item>Now it should ask you for the DBA group. This is the Unix group +you created in the last section and is probably 'dba'. Enter the +details and click 'Next.' + +<item>This time it wants you to log in as 'root' and run +<tt>/tmp/OraInstall/orainstRoot.sh</tt>. Do as it says. (You may have +to run <tt/pdksh/ or <tt/bash/ in the 'Bourne compatibility mode' to +get it to complete successfully.) When you're done click 'Retry.' + +<item>You're now given the option of what to install. Your best bet +here is 'Oracle Enterprise Edition,' as this includes just about +everything (table 3.1 in the Oracle documentation tells you exactly +what it installs). Make sure the right radio button is selected and +click 'Next.' + +<item>It should now allow you to choose what you install with much +finer granularity. Unless you're particularly constrained by disk +space or know exactly what you need, I'd recommend leaving it exactly +as it is and clicking 'Next.' The Universal Installer won't let you +make any silly choices so don't worry too much if you unselect +something. You can always add it back in later. + +<item>For any products that you've asked it to install, the installer +will allow you to change where it puts them. Again, only if you have a +good reason to should you change it. Click 'Next' when you're done. + +<item>It now goes away and installs all the pieces of software you +asked it to. This will probably take quite a while and will use far +more memory than is reasonable. + +<item>It should ask you if you want to create a database. Select +'no'. There are two reasons for this: it often doesn't work and, even +when it does, it's very slow (it seems to fire up another JVM, leaving +X, the Oracle back-end and <it/two/ virtual machines in memory; not +good with 128Mb of memory). + +<item>The installer should now ask you about the network protocols +that you want Oracle to support. The boxes all came up blank for me. I +don't know what's supposed to be in there, but I clicked 'Next' and +found that everything worked. + +<item>All the hard stuff is complete now. All the products you want +should be installed and are ready to go. Congratulations. +</enum> + +<sect1>Installing the patch +<p> +Unfortunately, the CD that Oracle sent you was probably version +8.1.5.0.0. As with almost all first releases there are problems with +that version (problems include empty files, so they're quite serious) +and a patch, to version 8.1.5.0.2 is essential. You'll certainly need +it to progress to the "Configuration" section of this HOWTO. The patch +described here is a cumulative patch, i.e., it includes all the files +required to move from version 8.1.5.0.0 to 8.1.5.0.2. + +The file you need is on <url name="the Oracle web site" +url="http://technet.oracle.com/software/products/oracle8i/software_index.htm"> +and is relatively easy to install. + +<enum> +<item>This is probably the first of many patches, so create a +directory called "patches" somewhere convenient (mine is in +<tt/$ORACLE_HOME/). + +<item>Download the file into it. + +<item>Create somewhere to put the files: +<verb>mkdir /tmp/orapatch +cd /tmp/orapatch</verb> + +<item>Uncompress the file: +<verb>tar zvxf $ORACLE_HOME/patches/linux815patches.tgz</verb> + +<item>Run the shell script that's now in the current directory: +<verb>./linux_815patches.sh</verb> + +</enum> + +Note that it's important not to uncompress the file in the current +directory. The patch installer checks that the correct number of files +are present and fails if there are not the right number. Of course, if +it finds the patch archive it finds too many files! + +<sect1>Setting up your environment +<p> +Add the following lines to your ".profile" (or whatever the equivalent +is for your shell): + +<verb> +. oraenv +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib +</verb> + +Quite why the Oracle installer doesn't do this I have no idea. + +If you see "<tt/[: integer expression expected before -lt/" the next +time you log in, it's because 'oraenv' is expecting your ULIMIT to be +an integer rather than the default 'unlimited.' I've seen no ill +effects by ignoring the error, but you can fix it by setting the +ULIMIT to something finite. + +<sect1>Installations questions and answers + +<sect2>The installation program exits with 'CreateOUIProcess()' +<p> +Firstly, make sure that you're running the right version of the JVM. I +don't know what Oracle do with their software, but it's very dependent +on the version you use. + +Secondly, it might help if, instead of running <tt/runInstaller/ from +the root of the CD, you move into <tt>install/linux</tt> and run the +<tt/runInst.sh/ shell script instead. + +This problem seems more common on RedHat Linux 6.1 than 6.0 and could +be something to do with a newer C library. + +I've also heard reports that if you have the wrong version of Gnome's +usual window manager, Enlightenment, you might get this +problem. Upgrade or switch to another environment such as KDE or +Fvwm2. + +<sect2>The installer just flashes on the screen and then vanishes +<p> +This is not an uncommon occurrence. Usually it means that you're +running an old version of Enlightenment. Upgrading or switching to +another environment should fix the problem. + +A similar problem is the installation program vanishing at some later +point in the process, often around 80% of the way through. The +consensus seems to be that Oracle ran out of memory. You should +increase the amount of swap space your machine has, anything over +200Mb should be sufficient. + +<sect2>Strange Java errors when I start the installation program? +<p> +Which version of the Java Virtual Machine are you using? People have +claimed success with other versions, but most of the problems that I +had disappeared when I downgraded to JRE 1.1.6v5, the one that Oracle +recommends in their documentation. + +Two other things that are worth mentioning: make sure you use the JRE +and not the JDK and, secondly, you should be using "green" +threads. Unless you've set THREADS_FLAG to 'native' you almost +certainly have the correct setting. + +<sect2>The installation program 'Segmentation Fault's +<p> +You do have GLIBC 2.1 don't you? + +<sect2>Problems loading shared libraries +<p> +The error message that I'm talking about looks a bit like this: + +<verb/error in loading shared libraries: libclntsh.so.8.0: cannot open +shared object file: No such file or directory/ + +This is the same as NT complaining that it can't find a DLL. It's very +easy to fix. Simply add the following line to the end of your +".profile" if you're using a Bourne-like shell (ask a local guru if +you don't know): + +<verb>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib</verb> + +Or use the following line if you're using a CSH-like shell: + +<verb>setenv LD_LIBRARY_PATH "$LD_LIBRARY_PATH +$ORACLE_HOME/lib"</verb> + +I don't use the C-Shell, so independent verification of this command +would be appreciated. + +<sect2>Pro*C doesn't work +<p> +The answer to this took quite a bit of tracking down, although the +answer <it/is/ on the Oracle web site if you look hard enough. + +The default configuration of Pro*C doesn't know where to find all its +libraries, so you need to tell it. After installation +<tt>$ORACLE_HOME/precomp/admin/pcscfg.cfg</tt> is empty, but it needs +to contain the following: + +<verb>sys_include=(/home/oracle/precomp/public, /usr/include, +/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/, +/usr/include, /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include, +/usr/include) +include=(/home/oracle/precomp/public) +include=(/home/oracle/rdbms/demo) +include=(/home/oracle/network/public) +include=(/home/oracle/plsql/public) +ltype=short</verb> + +(The first four lines above, from <tt/sys_include/ to <tt/include)/ +should all be on the same line in the file.) + +The Oracle documentation doesn't mention this, but you also need to +edit <tt>$ORACLE_HOME/precomp/lib/env_precomp.mk</tt>. On the line +that defines <tt/CCPSYSINCLUDE/, put the following: + +<verb>CCPSYSINCLUDE=sys_include='($(ORACLE_HOME)/precomp/public, +/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include, +/usr/include/g++-2, /usr/include)'</verb> + +This works for RedHat Linux 6.0, but may need tweaking for other +distributions or later versions of RH. + +<sect2>I installed the patch but it made things worse! +<p> +This is tricky, barely documented by Oracle and common across all +their products and installation programs. It's about time they did +something about it! + +Often what happens is as follows: you install Oracle Enterprise +Edition and, as Oracle tells you, you dash off and install all the +available patches. Then you decide you need the pre-compilers and +install Oracle Programmer from the same CD. + +Before you installed Pro*C your database worked, and now it doesn't. + +The problem is that the versions of the pre-compilers that you +installed were not patched and some of the Oracle server code relies +on the fixes; Oracle's installer is so stupid that it will overwrite +newer version of the same code. + +The solution is not pretty. Since you can't extract an individual file +from the CD you need to install the whole thing again, this time +adding Oracle Programmer before the patch. + +<sect2>Oracle thinks I don't have enough disk space +<p> +There's something wrong with the installation program. Assuming you +<it/do/ have enough space it will install okay. + +<sect>Creating a database +<sect1>Overview +<p> +Hopefully you followed the advice from the previous section and didn't +create a database. + +For most people, I can probably outline the process in a couple of +words: "Run 'dbassist'." Unless this is the first time you've ever run +Oracle, none of the questions should really phase you. + +For completeness, I'll document what I did but I'd best say what I was +aiming for first. Bottom line: this is neither a production system nor +a 'serious' (i.e., several people, full time) development box. I +installed 8i to play around and see what was new or different from 8 +and older versions. + +This means that when 'dbassist' offered an easy option I took it. And +when it suggested using a different disk, or at least a different +partition, I declined. My <tt/$ORACLE_HOME/ is +<tt>/home/oracle</tt>. All the data files and software are in there, +all on one partition. + +<sect1>Step-by-step guide +<p> +<enum> +<item>Bring up a command prompt and type: <verb>dbassist</verb> + +<item>My machine tells me that "JNLS Exception: +oracle.ntpg.jnls.JNLSException. Unable to find any National Character +Sets." According to Oracles 8i Patch FAQ, this is a known problem +(884001) and can safely be ignored. + +<item>Select the "Create a database" radio button and press "Next" + +<item>There are two options: Typical and Custom. If you knew exactly +what you were doing you probably wouldn't be reading this and could +comfortably select Custom. I'm not going to cover that. Instead I'll +assume you select "Typical" and press "Next" + +<item>Next it asks whether you want to copy the database from your CD +or to create the data files. Whenever I tried the first option, Oracle +couldn't find my CD player (you just installed from it!). So I +recommend choosing the second option. It's not difficult, it probably +just takes longer + +<item>It's probably safe to select 'Hybrid' when it asks you what +environment the database will operate in + +<item>Now it asks you how many users will be using your database at +any given time. I put five. + +<item>Next it asks you what products you want to install in your new +database. Again, you know what you want better than me! + +<item>Oracle needs a "Global Database Name" and a "SID" now. The +database name is like a fully qualified domain name (but +different). If you're the Oracle guru you'll know what to put, if not +your organisation might have some conventions. I called mine 'dev1' +(both the SID and database name). + +<item>Now, do you want to create the database 'now' or should you let +it save the information to a shell script? With 128Mb of RAM I found +the former option painful. + +I created the shell script, quit out of X and anything else using a +lot of memory and then ran the script. Much more snappy. + +<item>I didn't notice this in any of the documentation, but your +database won't work properly without it! The database that 'dbassist' +creates is fine, but by default the user rollback segments are left +off-line. (Read: non-system users can't perform any operation that +requires transactions.) + +Type: <verb>cd $ORACLE_HOME/dbs</verb> + +You now need to edit a file called "init<SID>.ora" +("initdev1.ora" in my case). + +About half-way down the file is a commented out line looking something +like this: + +<verb># rollback_segments = (r01, r02, r03, r04)</verb> + +Uncomment this line (remove the hash), save the file and you're done. + +<item>This is a kind of meta-step. You have a database and you should +be able to start it up, but you probably don't know what any of the +system passwords are! + +There are two that you need to know. The first is the SYSTEM +password. This defaults to '<tt/MANAGER/'. (It seems to be +conventional to put Oracle passwords in uppercase. In fact passwords +are not case sensitive.) I recommend you change it straight away by +typing <tt/password/ at the SQL*Plus prompt. (For people expecting an +<tt/ALTER USER/ command, this is new to the version of SQL*Plus +supplied with 8i.) + +The other password that you need to know is the one for SYS. It +defaults to '<tt/CHANGE_ON_INSTALL/' and you should do exactly what it +says! + +<item>Final step. This one gets rid of the annoying 'no profile' +warnings you get when you log into SQL*Plus. + +Log into SQL*Plus as user 'system' (<tt>sqlplus +system/<password></tt>). Then type: + +<verb>@?/sqlplus/admin/pupbld.sql</verb> + +The question-mark is an alias for the <tt/$ORACLE_HOME/ directory. + +<item>This is an optional step used to define the default editor for +SQL*Plus (it defaults to <tt/ed/ so you do!). Open +<tt>$ORACLE_HOME/sqlplus/admin/glogin.sql</tt> in your favourite +editor and add <tt>define_editor=<editor name></tt> to the end. + +</enum> + +And that's it. You should now have an operational database that you +can log into using SQL*Plus. + +<sect1>Questions and answers +<sect2>Is it really that easy? +<p> +Yes and no. If you're just playing around, building a database for +yourself to learn the new features of 8i, then 'yes.' The database the +above instructions will build is complete and will work fine. + +However, if you know anything about Oracle, you will quickly realise +that the default configuration is appallingly bad. If you're making a +serious, production system I recommend you use the "Custom" option. + +Even for my toy system I did some tweaking. I increased the sizes of +most of the table-spaces and changed them so that they didn't grow +automatically (I hate software when it tries to be too clever). + +<sect2>Is it really necessary to put all the files on different disks? +<p> +No and it will work fine if you don't, but I don't recommend putting +all your files on the same disk nevertheless. + +Spreading the files over a number of disks, even it's just the data +files on one and the rollback segments on another, will have a +significant performance advantage. Read an Oracle DBA book if you need +further information. + +<sect2>I can't start dbassist +<p> +Caused by several zero-length files in the initial +installation. Following the patch procedure will fix this problem. + +<sect2>I get "ORA-01034: ORACLE not available" +<p> +To cut a long story short, your <tt/$ORACLE_SID/ is probably set +incorrectly or not at all. Make sure it's set to the same value you +gave 'dbassist' and that it's value is exported (i.e., <tt/export +ORACLE_SID/ in any Bourne compatible shell). + +<sect2>I get "ORA-01012: Not logged in" +<p> +This is a very common error, and there are a number of different +things that cause it. + +Firstly you'll want to make sure that you're not creating a Shared +Server configuration (sometimes known as MTS). Create a database using +Dedicated Server and convert it later. + +If that's not it, check your <tt/NLS_LANG/ environment variable. The +easiest option is to unset it. If you really want to use it, make sure +that you have it exactly right. Make sure you don't transpose any '1's +(one's) for 'l's (the twelfth letter of the alphabet)! + +<sect2>Can data-files only be 1Gb in size? +<p> +'dbassist' won't let you create a datafile bigger than 1Gb. I believe +this to be a bug as Linux has no problem with files up to 2Gb. + +Note that does not limit the size of your database to 1Gb or less. A +database is made up of many table-spaces which can be made up of many +data-files. Talk to your friendly DBA for more information. + +<sect2>Can I use raw files? +<p> +Recent versions of the Linux kernel allow applications to directly +access the disks. Oracle is able to use this facility and can +(sometimes) increase its performance. + +Technically the answer is 'yes,' you can use raw files. But +realistically the answer is 'no.' The performance improvement you'll +get probably isn't worth the administrative overhead. + +<sect>Configuration +<sect1>Overview +<p> +Congratulations, you have Oracle running on your Linux box. You have +created a database and can connect to it using SQL*Plus. + +Of course, this is not the end of it. Ideally, you'd be able to +connect to it as another Unix user or from a completely different +machine. That is what this section is for. + +<sect1>Connecting as another user +<p> +Some of the details in this section are a little sketchy as this is +not a configuration that I personally use. However, performing one of +the following steps should work: + +<itemize> +<item><verb>. oraenv</verb> if you run a Bourne-like shell (like Bash +or pdksh) +<item><verb>source coraenv</verb> if you prefer the C-Shell +</itemize> + +When running "oraenv" I get an error if I use 'bash', the default +Linux shell. It seems not to cause any problems so don't worry. You +can always use 'pdksh' if it <it/does/ worry you. + +<sect1>Connecting from another machine +<p> +I remember this being very complex with earlier versions of Oracle, +but just seemed to work here. I'm sure that must mean that I did +something wrong, forgot something I did or that there's a massive +security hole. + +This is what I remember doing: + +<enum> +<item>Logging into Linux as user 'oracle' +<item>Make sure that "oraenv" has been executed (i.e., your +<tt/$ORACLE_HOME/ is set correctly) +<item>Type: <verb>lsnrctl start</verb> + +</enum> + +On your client machine all you need to do now is point it at the right +machine and database instance. + +If you want more control over the process, the "Net8 Configuration +Assistant" ('netec') should be able to help. + +<sect1>Connecting to another machine +<p> +This used to be very difficult in many earlier version of Oracle, +involving editing many text files, most of which had an fantastically +complex syntax. + +But in 8i, if you've got your JVM working, then all you need is the +"Net8 Easy Config" program. Follow these steps to allow your machine +to connect to a database on another machine: + +<enum> +<item>Start "Net8 Easy Config" by typing <tt/netec/ at the command +prompt while logged in as 'oracle.' + +<item>After a short delay while Java gets its act together, the +welcome screen appears. It should be asking what you want to do. Leave +the radio buttons on the left alone (the default is 'create') and +enter the name of the database in the text box. Click 'Next' when +you're done. + +<item>Select one of the protocols it offers. Unless you know +differently, this should probably be 'TCP/IP' which is the +default. Press 'Next.' + +<item>Enter the hostname (or IP address) of the remote machine. The +port number probably doesn't need changing. Press 'Next.' + +<item>Select the type of database (8i or other) using the radio +buttons and enter the name in the appropriate text box. Press 'Next.' + +<item>You can now test that the information you've enter makes sense +to Oracle. I found that 'netec' has a tendency to crash if some of the +details are wrong. Press 'Next' when you're sure that it all +works. You can keep pressing the 'Back' button to go back and correct +any information. + +<item>If you're happy with all the information you've entered, you can +press the 'Finish' button and that's it! + +</enum> + +If you want more control over the process, you may need to use the +"Net8 Assistant" -- a big window with many confusing options -- which +can be started with the <tt/netasst/ command. + +<sect1>Questions and answers +<sect2>I can't start 'netasst' +<p> +The problem is with a couple of zero-length files. Installing the +patch should fix this problem. + +<sect>Final Words +<sect1>Useful Software +<p> +Now that you've managed to get Oracle installed, you'll want to try +and use it. Although it's possible to do everything from your server +PC, it's generally best to user the client-server facilities and use +another machine to access your database. + +Naturally Oracle have a large collection of, largely, pretty good +client software, however there's not much for Linux at this time. The +main useful piece of software, Oracle Enterprise Manager, usually +comes with Oracle. + +But most of the best software comes from other places... + +<itemize> +<item>Tool for Oracle Application Development (T.O.A.D.). This used to +be free but is now owned by <url url="http://www.quest.com" +name="Quest Software">. You can download a free version (if you're +prepared to do it every couple of months) or you can pay for it. When +I'm using Oracle on a daily basis, this is the program I choose if I +have to use a Windows desktop. It's not as polished as some, but it +does just about everything you need. + +<item><url url="http://www.globecom.se/tora/" name="TOra">. This is +the closest you'll find to a TOAD for Linux. In fact, in some ways +it's better than TOAD! The Linux version is free, but you can also buy +a Windows version. + +<item>SQLNavigator. Also by <url url="http://www.quest.com" +name="Quest Software">. I've not really used it but it's been highly +recommended by all who have. + +<item><url url="http://www.orasoft.com" name="OraSoft">. These guys +produce applications for Oracle that actually run on Linux. I've not +used them in anger, but they look good. + +<item><url url="http://www.tux.org/orac-dba/" name="Orac">. Another +that I've not used much, but has been described as a nice, +configurable DBA-tool by a number of people. + +</itemize> + +<sect1>Useful Books +<p> +I seem to get most of my Oracle information from colleagues and +books. I'm not able to give away my colleagues, but the books I +recommend are as follows: + +<itemize> + +<item><#if output=html><url +url="http://www.amazon.com/exec/obidos/ASIN/1565927087/zx81orguk00" +name="Oracle Essentials,"></#if> <#unless output=html>"Oracle +Essentials,"</#unless> Rick Greenwald, R. Stackowiak, Jonathan Stern, +O'Reilly and Associates, ISBN 1-56592-708-7. + +<item><#if output=html><url +url="http://www.amazon.com/exec/obidos/ASIN/0072123648/zx81orguk00" +name="Oracle 8i: The Complete Reference,"></#if> <#unless +output=html>"Oracle 8i: The Complete Reference,"</#unless> Kevin Loney +and George Koch, Oracle Press, ISBN 0-07212-364-8. + +<item><#if output=html><url +url="http://www.amazon.com/exec/obidos/ASIN/1565922379/zx81orguk00" +name="Oracle Performance Tuning,"></#if> <#unless output=html>"Oracle +Performance Tuning,"</#unless> Mark Gurry and Peter Corrigan, O'Reilly +and Associates, ISBN 1-56592-237-9. + +<item><#if output=html><url +url="http://www.amazon.com/exec/obidos/ASIN/1565922689/zx81orguk00" +name="Oracle Design,"></#if> <#unless output=html>"Oracle +Design,"</#unless> Dave Ensor and Ian Stevenson, O'Reilly and +Associates, ISBN 1-56592-268-9. + +<item><#if output=html><url +url="http://www.amazon.com/exec/obidos/ASIN/1565923359/zx81orguk00" +name="PL/SQL Programming,"></#if> <#unless output=html>"PL/SQL +Programming,"</#unless> Steven Feuerstein, O'Reilly and Associates, +ISBN 1-56592-335-9. + +<item><#if output=html><url +url="http://www.amazon.com/exec/obidos/ASIN/1565923758/zx81orguk00" +name="PL/SQL Built-in Packages,"></#if> <#unless output=html>"PL/SQL +Built-in Packages,"</#unless> Steven Feuerstein, O'Reilly and +Associates, ISBN 1-56592-375-8. + +</itemize> + +You'll find some more book recommendations and reviews on my <url +url="http://www.zx81.org.uk/computing/opinion/" name="web site">. + +<sect1>Useful Internet resources +<p> +There's a lot of useful stuff on the web. + +<itemize> + +<item><url name="Oracle Technet" url="http://otn.oracle.com">. This is +Oracle's public and free support website. Lot's of very useful +information there. + +<item><url name="Oracle Metalink" +url="http://support.oracle.com">. Oracle's private (you need a support +contract) support website. Only slightly more useful than Technet! + +<item>If this HOWTO hasn't worked for you, there are a couple of +other's that you might like to try: <url name="Jesus M. Salvo, Jr.'s" +url="http://homepages.tig.com.au/~jmsalvo/linux/oracle8i.html"> and +<url name="Tom Bissett's" url="http://jordan.fortwayne.com/oracle/"> +slightly dated guide. Or there's a <url name="bulletin board" +url="http://cgi.zx81.org.uk/phpBB2/"> on my website if you still need +to ask questions. + +<item><url name="OraFaq" url="http://www.orafaq.org">. A site full of +questions and answers regarding Oracle on all platforms. + +<item>Oracle Linux mailing list (Send a mail to <url +url="mailto:ListGuru@fatcity.com" name="ListGuru@fatcity.com"> with +the words 'SUBSCRIBE ORACLE-LINUX-L' in the body. + +</itemize> + +</article> diff --git a/LDP/faq/linuxdoc/PPP-FAQ.sgml b/LDP/retired/PPP-FAQ.sgml similarity index 100% rename from LDP/faq/linuxdoc/PPP-FAQ.sgml rename to LDP/retired/PPP-FAQ.sgml diff --git a/LDP/retired/SCSI-Programming-HOWTO.sgml b/LDP/retired/SCSI-Programming-HOWTO.sgml new file mode 100644 index 00000000..727bd1cb --- /dev/null +++ b/LDP/retired/SCSI-Programming-HOWTO.sgml @@ -0,0 +1,2430 @@ +<!doctype linuxdoc system> + +<article> + +<title>The Linux SCSI programming HOWTO +<author>Heiko Eißfeldt <tt/heiko@colossus.escape.de/ +<date>v1.5, 7 May 1996 +<abstract> +This document deals with programming the Linux generic SCSI interface. +<p> +<bf>Archived Document Notice:</bf> This document has been archived by the LDP +because it does not apply to modern Linux systems. It is no longer +being actively maintained. +</p> +</abstract> + +<!-- \catcode`\_=12 --> + +<toc> + +<sect>What's New? + +<p> +Newer kernels have changed the interface a bit. This affects +a section formerly entitled 'rescanning the devices'. Now it is +possible to add/remove SCSI devices on the fly. + +Since kernel 1.3.98 some important header files have been +moved/split (sg.h and scsi.h). + +Some stupid bugs have been replaced by newer ones. + +<sect>Introduction + +<p> +This document is a guide to the installation and programming of the +Linux generic SCSI interface. + +It covers kernel prerequisites, device mappings, and basic interaction +with devices. Some simple C programming examples are included. +General knowledge of the SCSI command set is required; for more +information on the SCSI standard and related information, see the +appendix to this document. + +Note the plain text version of this document lacks cross references +(they show up as ``''). + +<sect>What Is The Generic SCSI Interface? + +<p> +The generic SCSI interface has been implemented to provide general +SCSI access to (possibly exotic) pieces of SCSI hardware. It was +developed by Lawrence Foard (<tt> entropy@world.std.com</tt>) and +sponsored by Killy Corporation (see the comments in <tt> +scsi/sg.h</tt>). + +The interface makes special device handling possible from user level +applications (i.e. outside the kernel). Thus, kernel driver +development, which is more risky and difficult to debug, is not +necessary. + +However, if you don't program the driver properly it is possible to +hang the SCSI bus, the driver, or the kernel. Therefore, it is +important to properly program the generic driver and to first back up +all files to avoid losing data. Another useful thing to do before +running your programs is to issue a <tt>sync</tt> command to ensure that +any buffers are flushed to disk, minimizing data loss if the system +hangs. + +Another advantage of the generic driver is that as long as the +interface itself does not change, all applications are independent of +new kernel development. In comparison, other low-level kernel drivers +have to be synchronized with other internal kernel changes. + +Typically, the generic driver is used to communicate with new SCSI +hardware devices that require special user applications to be written +to take advantage of their features (e.g. scanners, printers, CD-ROM +jukeboxes). The generic interface allows these to be written quickly. + +<sect>What Are The Requirements To Use It? + +<p> +<sect1>Kernel Configuration + +<p> +You must have a supported SCSI controller, obviously. Furthermore, +your kernel must have controller support as well as generic support +compiled in. Configuring the Linux kernel (via <tt/make config/ under +/usr/src/linux) typically looks like the following: + +<tscreen><verb> + ... +* +* SCSI support +* +SCSI support? (CONFIG_SCSI) [n] y +* +* SCSI support type (disk, tape, CDrom) +* + ... +Scsi generic support (CONFIG_CHR_DEV_SG) [n] y +* +* SCSI low-level drivers +* + ... +</verb></tscreen> + +If available, modules can of course be build instead. + +<sect1>Device Files + +<p> +The generic SCSI driver uses its own device files, separate from those +used by the other SCSI device drivers. They can be generated using +the <tt/MAKEDEV/ script, typically found in the <tt>/dev</tt> +directory. Running <tt/MAKEDEV sg/ produces these files: + +<tscreen><verb> +crw------- 1 root system 21, 0 Aug 20 20:09 /dev/sga +crw------- 1 root system 21, 1 Aug 20 20:09 /dev/sgb +crw------- 1 root system 21, 2 Aug 20 20:09 /dev/sgc +crw------- 1 root system 21, 3 Aug 20 20:09 /dev/sgd +crw------- 1 root system 21, 4 Aug 20 20:09 /dev/sge +crw------- 1 root system 21, 5 Aug 20 20:09 /dev/sgf +crw------- 1 root system 21, 6 Aug 20 20:09 /dev/sgg +crw------- 1 root system 21, 7 Aug 20 20:09 /dev/sgh + | | + major, minor device numbers +</verb></tscreen> + +Note that these are character devices for raw access. On some systems +these devices may be called <tt>/dev/{sg0,sg1,...}</tt>, depending on your +installation, so adjust the following examples accordingly. + +<sect1>Device Mapping + +<p> +These device files are dynamically mapped to SCSI id/LUNs on your SCSI +bus (LUN = logical unit). The mapping allocates devices consecutively +for each LUN of each device on each SCSI bus found at time of the SCSI +scan, beginning at the lower LUNs/ids/buses. It starts with the first SCSI +controller and continues without interruption with all following +controllers. This is currently done in the initialisation of the SCSI +driver. + +For example, assuming you had three SCSI devices hooked up with ids 1, +3, and 5 on the first SCSI bus (each having one LUN), then the +following mapping would be in effect: + +<tscreen><verb> +/dev/sga -> SCSI id 1 +/dev/sgb -> SCSI id 3 +/dev/sgc -> SCSI id 5 +</verb></tscreen> + +If you now add a new device with id 4, then the mapping (after the +next rescan) will be: + +<tscreen><verb> +/dev/sga -> SCSI id 1 +/dev/sgb -> SCSI id 3 +/dev/sgc -> SCSI id 4 +/dev/sgd -> SCSI id 5 +</verb></tscreen> + +Notice the change for id 5 -- the corresponding device is no longer +mapped to <tt>/dev/sgc</tt> but is now under <tt>/dev/sgd</tt>. + +Luckily newer kernels allow for changing this order. + +<sect2> Dynamically insert and remove SCSI devices + +<p> +If a newer kernel and the <tt>/proc</tt> file system is running, +a non-busy device can be removed and installed 'on the fly'. + +To remove a SCSI device: +<tscreen><verb> +echo "scsi remove-single-device a b c d" > /proc/scsi/scsi +</verb></tscreen> + +and similar, to add a SCSI device, do +<tscreen><verb> +echo "scsi add-single-device a b c d" > /proc/scsi/scsi +</verb></tscreen> + +where +<tscreen><verb> + a == hostadapter id (first one being 0) + b == SCSI channel on hostadapter (first one being 0) + c == ID + d == LUN (first one being 0) +</verb></tscreen> + +So in order to swap the <tt>/dev/sgc</tt> and <tt>/dev/sgd</tt> mappings from +the previous example, we could do + +<tscreen><verb> +echo "scsi remove-single-device 0 0 4 0" > /proc/scsi/scsi +echo "scsi remove-single-device 0 0 5 0" > /proc/scsi/scsi +echo "scsi add-single-device 0 0 5 0" > /proc/scsi/scsi +echo "scsi add-single-device 0 0 4 0" > /proc/scsi/scsi +</verb></tscreen> + +since generic devices are mapped in the order of their insertion. + +When adding more devices to the scsi bus keep in mind there are +limited spare entries for new devices. The memory has been allocated +at boot time and has room for 2 more devices. + +<sect>Programmers Guide <!-- FIXME: I don't want a section number here --> + +<p> +The following sections are for programmers who want to use the generic +SCSI interface in their own applications. An example will be given +showing how to access a SCSI device with the INQUIRY and the +TESTUNITREADY commands. + + +When using these code examples, note the following: +<itemize> +<item>the location of the header files <tt>sg.h</tt> and <tt>scsi.h</tt> has +changed in kernel version 1.3.98. Now these files are located at +<tt>/usr/src/linux/include/scsi</tt>, which is hopefully linked to +<tt>/usr/include/scsi</tt>. Previously they were in +<tt>/usr/src/linux/drivers/scsi</tt>. We assume a newer kernel in the following text. +<item>the generic SCSI interface was extended in kernel version 1.1.68; the +examples require at least this version. But please avoid kernel version +1.1.77 up to 1.1.89 and 1.3.52 upto 1.3.56 since they had a broken generic +scsi interface. +<item>the constant DEVICE in the header section describing the accessed +device should be set according to your available devices (see +section <ref id="sec-header">. +</itemize> + +<sect>Overview Of Device Programming + +<p> +The header file <tt>include/scsi/sg.h</tt> +contains a description of the interface (this is based on kernel +version 1.3.98): + +<tscreen><verb> +struct sg_header + { + int pack_len; + /* length of incoming packet (including header) */ + int reply_len; /* maximum length of expected reply */ + int pack_id; /* id number of packet */ + int result; /* 0==ok, otherwise refer to errno codes */ + unsigned int twelve_byte:1; + /* Force 12 byte command length for group 6 &ero 7 commands */ + unsigned int other_flags:31; /* for future use */ + unsigned char sense_buffer[16]; /* used only by reads */ + /* command follows then data for command */ + }; +</verb></tscreen> + + +This structure describes how a SCSI command is to be processed and has +room to hold the results of the execution of the command. The +individual structure components will be discussed later in +section <ref id="sec-header">. + +The general way of exchanging data with the generic driver is as +follows: to send a command to an opened generic device, <tt/write()/ a +block containing these three parts to it: + + + +<tscreen><verb> +struct sg_header +SCSI command +data to be sent with the command +</verb></tscreen> + + +To obtain the result of a command, <tt/read()/ a block with this +(similar) block structure: + +<tscreen><verb> +struct sg_header +data coming from the device +</verb></tscreen> + + +This is a general overview of the process. The following sections +describe each of the steps in more detail. + +NOTE: Up to recent kernel versions, it is necessary to block the +SIGINT signal between the <tt/write()/ and the corresponding +<tt/read()/ call (i.e. via <tt/sigprocmask()/). A return after the +<tt/write()/ part without any <tt/read()/ to fetch the results +will block on subsequent accesses. This signal blocking has not +yet been included in the example code. So better do not issue +SIGINT (a la ^C) when running these examples. + +<sect>Opening The Device + +<p> +A generic device has to be opened for read and write access: + +<tscreen><verb> + int fd = open (device_name, O_RDWR); +</verb></tscreen> + +(This is the case even for a read-only hardware device such as a cdrom +drive). + +We have to perform a <tt/write/ to send the command and a <tt/read/ +to get back any results. In the case of an error the return code is +negative (see section <ref id="sec-errorhandling"> for a complete list). + +<sect>The Header Structure + +<p> + +<label id="sec-header"> +The header structure <tt/struct sg_header/ serves as a controlling +layer between the application and the kernel driver. +We now discuss its components in detail. + + +<descrip> +<tag/int pack_len/ defines the size of the block written to the driver. +This is defined within the kernel for internal use. +<tag/int reply_len/ defines the size of the block to be accepted at reply. +This is defined from the application side. + +<tag/int pack_id/ This field helps to assign replies to requests. The application +can supply a unique id for each request. Suppose you have written several +commands (say 4) to one device. They may work in +parallel, one being the fastest. When getting replies via 4 reads, the replies +do not have to have the order of the requests. To identify the correct reply +for a given request one can use the <tt/pack_id/ field. Typically its value +is incremented after each request (and wraps eventually). The maximum +amount of outstanding requests is limited by the kernel to SG_MAX_QUEUE (eg 4). + +<tag/int result/ the result code of a <tt/read/ or <tt/write/ call. +This is (sometimes) defined from the generic driver (kernel) side. +It is safe to set it to null before the <tt>write</tt> call. +These codes are defined in <tt/errno.h/ (0 meaning no error). + +<tag/unsigned int twelve_byte:1/ This field is necessary only when +using non-standard vendor specific commands (in the range 0xc0 - 0xff). +When these commands have a command length of 12 bytes instead of 10, +this field has to be set to one before the write call. Other command +lengths are not supported. This is defined from the application side. + +<tag/unsigned char sense_buffer[16]/ This buffer is set after a +command is completed (after a <tt/read()/ call) and contains the +SCSI sense code. Some command results have to be read from here (e.g. for +<tt/TESTUNITREADY/). Usually it contains just zero bytes. +The value in this field is set by the generic driver (kernel) side. +</descrip> + + + +The following example function interfaces directly with the generic +kernel driver. It defines the header structure, sends the command via +<tt/write/, gets the result via <tt/read/ and does some (limited) +error checking. The sense buffer data is available in the output +buffer (unless a NULL pointer has been given, in which case it's in +the input buffer). We will use it in the examples which follow. + +Note: Set the value of <tt/DEVICE/ to your device descriptor. + + +<tscreen><verb> +#define DEVICE "/dev/sgc" + +/* Example program to demonstrate the generic SCSI interface */ +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <fcntl.h> +#include <errno.h> +#include <scsi/sg.h> + + +#define SCSI_OFF sizeof(struct sg_header) +static unsigned char cmd[SCSI_OFF + 18]; /* SCSI command buffer */ +int fd; /* SCSI device/file descriptor */ + +/* process a complete SCSI cmd. Use the generic SCSI interface. */ +static int handle_SCSI_cmd(unsigned cmd_len, /* command length */ + unsigned in_size, /* input data size */ + unsigned char *i_buff, /* input buffer */ + unsigned out_size, /* output data size */ + unsigned char *o_buff /* output buffer */ + ) +{ + int status = 0; + struct sg_header *sg_hd; + + /* safety checks */ + if (!cmd_len) return -1; /* need a cmd_len != 0 */ + if (!i_buff) return -1; /* need an input buffer != NULL */ +#ifdef SG_BIG_BUFF + if (SCSI_OFF + cmd_len + in_size > SG_BIG_BUFF) return -1; + if (SCSI_OFF + out_size > SG_BIG_BUFF) return -1; +#else + if (SCSI_OFF + cmd_len + in_size > 4096) return -1; + if (SCSI_OFF + out_size > 4096) return -1; +#endif + + if (!o_buff) out_size = 0; /* no output buffer, no output size */ + + /* generic SCSI device header construction */ + sg_hd = (struct sg_header *) i_buff; + sg_hd->reply_len = SCSI_OFF + out_size; + sg_hd->twelve_byte = cmd_len == 12; + sg_hd->result = 0; +#if 0 + sg_hd->pack_len = SCSI_OFF + cmd_len + in_size; /* not necessary */ + sg_hd->pack_id; /* not used */ + sg_hd->other_flags; /* not used */ +#endif + + /* send command */ + status = write( fd, i_buff, SCSI_OFF + cmd_len + in_size ); + if ( status < 0 || status != SCSI_OFF + cmd_len + in_size || + sg_hd->result ) { + /* some error happened */ + fprintf( stderr, "write(generic) result = 0x%x cmd = 0x%x\n", + sg_hd->result, i_buff[SCSI_OFF] ); + perror(""); + return status; + } + + if (!o_buff) o_buff = i_buff; /* buffer pointer check */ + + /* retrieve result */ + status = read( fd, o_buff, SCSI_OFF + out_size); + if ( status < 0 || status != SCSI_OFF + out_size || sg_hd->result ) { + /* some error happened */ + fprintf( stderr, "read(generic) status = 0x%x, result = 0x%x, " + "cmd = 0x%x\n", + status, sg_hd->result, o_buff[SCSI_OFF] ); + fprintf( stderr, "read(generic) sense " + "%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\n", + sg_hd->sense_buffer[0], sg_hd->sense_buffer[1], + sg_hd->sense_buffer[2], sg_hd->sense_buffer[3], + sg_hd->sense_buffer[4], sg_hd->sense_buffer[5], + sg_hd->sense_buffer[6], sg_hd->sense_buffer[7], + sg_hd->sense_buffer[8], sg_hd->sense_buffer[9], + sg_hd->sense_buffer[10], sg_hd->sense_buffer[11], + sg_hd->sense_buffer[12], sg_hd->sense_buffer[13], + sg_hd->sense_buffer[14], sg_hd->sense_buffer[15]); + if (status < 0) + perror(""); + } + /* Look if we got what we expected to get */ + if (status == SCSI_OFF + out_size) status = 0; /* got them all */ + + return status; /* 0 means no error */ +} +</verb></tscreen> + +While this may look somewhat complex at first appearance, most of the +code is for error checking and reporting (which is useful even after +the code is working). + +<tt/Handle_SCSI_cmd/ has a generalized form for all SCSI commands +types, falling into each of these categories: + + +<tscreen><verb> + Data Mode | Example Command +=============================================== +neither input nor output data | test unit ready + no input data, output data | inquiry, read + input data, no output data | mode select, write + input data, output data | mode sense +</verb></tscreen> + + +<sect>Inquiry Command Example + +<p> +One of the most basic SCSI commands is the <tt/INQUIRY/ command, used +to identify the type and make of the device. Here is the definition +from the SCSI-2 specification (for details refer to the SCSI-2 +standard). + +<tscreen><verb> + Table 44: INQUIRY Command ++=====-========-========-========-========-========-========-========-========+ +| Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +|Byte | | | | | | | | | +|=====+=======================================================================| +| 0 | Operation Code (12h) | +|-----+-----------------------------------------------------------------------| +| 1 | Logical Unit Number | Reserved | EVPD | +|-----+-----------------------------------------------------------------------| +| 2 | Page Code | +|-----+-----------------------------------------------------------------------| +| 3 | Reserved | +|-----+-----------------------------------------------------------------------| +| 4 | Allocation Length | +|-----+-----------------------------------------------------------------------| +| 5 | Control | ++=============================================================================+ +</verb></tscreen> + +The output data are as follows: +<tscreen><verb> + Table 45: Standard INQUIRY Data Format ++=====-========-========-========-========-========-========-========-========+ +| Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +|Byte | | | | | | | | | +|=====+==========================+============================================| +| 0 | Peripheral Qualifier | Peripheral Device Type | +|-----+-----------------------------------------------------------------------| +| 1 | RMB | Device-Type Modifier | +|-----+-----------------------------------------------------------------------| +| 2 | ISO Version | ECMA Version | ANSI-Approved Version | +|-----+-----------------+-----------------------------------------------------| +| 3 | AENC | TrmIOP | Reserved | Response Data Format | +|-----+-----------------------------------------------------------------------| +| 4 | Additional Length (n-4) | +|-----+-----------------------------------------------------------------------| +| 5 | Reserved | +|-----+-----------------------------------------------------------------------| +| 6 | Reserved | +|-----+-----------------------------------------------------------------------| +| 7 | RelAdr | WBus32 | WBus16 | Sync | Linked |Reserved| CmdQue | SftRe | +|-----+-----------------------------------------------------------------------| +| 8 | (MSB) | +|- - -+--- Vendor Identification ---| +| 15 | (LSB) | +|-----+-----------------------------------------------------------------------| +| 16 | (MSB) | +|- - -+--- Product Identification ---| +| 31 | (LSB) | +|-----+-----------------------------------------------------------------------| +| 32 | (MSB) | +|- - -+--- Product Revision Level ---| +| 35 | (LSB) | +|-----+-----------------------------------------------------------------------| +| 36 | | +|- - -+--- Vendor Specific ---| +| 55 | | +|-----+-----------------------------------------------------------------------| +| 56 | | +|- - -+--- Reserved ---| +| 95 | | +|=====+=======================================================================| +| | Vendor-Specific Parameters | +|=====+=======================================================================| +| 96 | | +|- - -+--- Vendor Specific ---| +| n | | ++=============================================================================+ +</verb></tscreen> + + +The next example uses the low-level function <tt/handle_SCSI_cmd/ to +perform the Inquiry SCSI command. + +We first append the command block to the generic header, then call +<tt/handle_SCSI_cmd/. Note that the output buffer size argument for +the <tt/handle_SCSI_cmd/ call excludes the generic header size. +After command completion the output buffer contains the requested +data, unless an error occurred. + +<tscreen><verb> +#define INQUIRY_CMD 0x12 +#define INQUIRY_CMDLEN 6 +#define INQUIRY_REPLY_LEN 96 +#define INQUIRY_VENDOR 8 /* Offset in reply data to vendor name */ + +/* request vendor brand and model */ +static unsigned char *Inquiry ( void ) +{ + unsigned char Inqbuffer[ SCSI_OFF + INQUIRY_REPLY_LEN ]; + unsigned char cmdblk [ INQUIRY_CMDLEN ] = + { INQUIRY_CMD, /* command */ + 0, /* lun/reserved */ + 0, /* page code */ + 0, /* reserved */ + INQUIRY_REPLY_LEN, /* allocation length */ + 0 };/* reserved/flag/link */ + + memcpy( cmd + SCSI_OFF, cmdblk, sizeof(cmdblk) ); + + /* + * +------------------+ + * | struct sg_header | <- cmd + * +------------------+ + * | copy of cmdblk | <- cmd + SCSI_OFF + * +------------------+ + */ + + if (handle_SCSI_cmd(sizeof(cmdblk), 0, cmd, + sizeof(Inqbuffer) - SCSI_OFF, Inqbuffer )) { + fprintf( stderr, "Inquiry failed\n" ); + exit(2); + } + return (Inqbuffer + SCSI_OFF); +} +</verb></tscreen> + +The example above follows this structure. The Inquiry function copies +its command block behind the generic header (given by +<tt/SCSI_OFF/). Input data is not present for this command. +<tt/Handle_SCSI_cmd/ will define the header structure. We can now +implement the function <tt/main/ to complete this working example +program. + +<tscreen><verb> +void main( void ) +{ + fd = open(DEVICE, O_RDWR); + if (fd < 0) { + fprintf( stderr, "Need read/write permissions for "DEVICE".\n" ); + exit(1); + } + + /* print some fields of the Inquiry result */ + printf( "%s\n", Inquiry() + INQUIRY_VENDOR ); +} +</verb></tscreen> + +We first open the device, check for errors, and then call the higher +level subroutine. Then we print the results in human readable format +including the vendor, product, and revision. + +Note: There is more information in the Inquiry result than this little +program gives. You may want to extend the program to give device type, +ANSI version etc. The device type is of special importance, since it +determines the mandatory and optional command sets for this device. +If you don't want to program it yourself, you may want to use the +scsiinfo program from Eric Youngdale, which requests nearly all +information about an SCSI device. Look at tsx-11.mit.edu in +pub/Linux/ALPHA/scsi. + +<sect>The Sense Buffer + +<p> +<label id="sec-sensebuff"> +Commands with no output data can give status information via the sense +buffer (which is part of the header structure). Sense data is +available when the previous command has terminated with a CHECK +CONDITION status. In this case the kernel automatically retrieves the +sense data via a REQUEST SENSE command. Its structure is: + + +<tscreen><verb> ++=====-========-========-========-========-========-========-========-========+ +| Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +|Byte | | | | | | | | | +|=====+========+==============================================================| +| 0 | Valid | Error Code (70h or 71h) | +|-----+-----------------------------------------------------------------------| +| 1 | Segment Number | +|-----+-----------------------------------------------------------------------| +| 2 |Filemark| EOM | ILI |Reserved| Sense Key | +|-----+-----------------------------------------------------------------------| +| 3 | (MSB) | +|- - -+--- Information ---| +| 6 | (LSB) | +|-----+-----------------------------------------------------------------------| +| 7 | Additional Sense Length (n-7) | +|-----+-----------------------------------------------------------------------| +| 8 | (MSB) | +|- - -+--- Command-Specific Information ---| +| 11 | (LSB) | +|-----+-----------------------------------------------------------------------| +| 12 | Additional Sense Code | +|-----+-----------------------------------------------------------------------| +| 13 | Additional Sense Code Qualifier | +|-----+-----------------------------------------------------------------------| +| 14 | Field Replaceable Unit Code | +|-----+-----------------------------------------------------------------------| +| 15 | SKSV | | +|- - -+------------ Sense-Key Specific ---| +| 17 | | +|-----+-----------------------------------------------------------------------| +| 18 | | +|- - -+--- Additional Sense Bytes ---| +| n | | ++=============================================================================+ +</verb></tscreen> + + +Note: The most useful fields are Sense Key (see section <ref id="sec-sensekeys">), +Additional Sense Code and Additional Sense Code Qualifier (see +section <ref id="sec-sensecodes">). The latter two are used combined as a pair. + + + +<sect>Example Using Sense Buffer + +<p> +Here we will use the TEST UNIT READY command to check whether media is +loaded into our device. The header declarations and function +<tt/handle_SCSI_cmd/ from the inquiry example will be needed as well. + + +<tscreen><verb> + Table 73: TEST UNIT READY Command ++=====-========-========-========-========-========-========-========-========+ +| Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +|Byte | | | | | | | | | +|=====+=======================================================================| +| 0 | Operation Code (00h) | +|-----+-----------------------------------------------------------------------| +| 1 | Logical Unit Number | Reserved | +|-----+-----------------------------------------------------------------------| +| 2 | Reserved | +|-----+-----------------------------------------------------------------------| +| 3 | Reserved | +|-----+-----------------------------------------------------------------------| +| 4 | Reserved | +|-----+-----------------------------------------------------------------------| +| 5 | Control | ++=============================================================================+ +</verb></tscreen> + + + +Here is the function which implements it: + +<tscreen><verb> +#define TESTUNITREADY_CMD 0 +#define TESTUNITREADY_CMDLEN 6 + +#define ADD_SENSECODE 12 +#define ADD_SC_QUALIFIER 13 +#define NO_MEDIA_SC 0x3a +#define NO_MEDIA_SCQ 0x00 + +int TestForMedium ( void ) +{ + /* request READY status */ + static unsigned char cmdblk [TESTUNITREADY_CMDLEN] = { + TESTUNITREADY_CMD, /* command */ + 0, /* lun/reserved */ + 0, /* reserved */ + 0, /* reserved */ + 0, /* reserved */ + 0};/* control */ + + memcpy( cmd + SCSI_OFF, cmdblk, sizeof(cmdblk) ); + + /* + * +------------------+ + * | struct sg_header | <- cmd + * +------------------+ + * | copy of cmdblk | <- cmd + SCSI_OFF + * +------------------+ + */ + + if (handle_SCSI_cmd(sizeof(cmdblk), 0, cmd, + 0, NULL)) { + fprintf (stderr, "Test unit ready failed\n"); + exit(2); + } + + return + *(((struct sg_header*)cmd)->sense_buffer +ADD_SENSECODE) != + NO_MEDIA_SC || + *(((struct sg_header*)cmd)->sense_buffer +ADD_SC_QUALIFIER) != + NO_MEDIA_SCQ; +} +</verb></tscreen> + +Combined with this <tt/main/ function we can do the check. + +<tscreen><verb> +void main( void ) +{ + fd = open(DEVICE, O_RDWR); + if (fd < 0) { + fprintf( stderr, "Need read/write permissions for "DEVICE".\n" ); + exit(1); + } + + /* look if medium is loaded */ + + if (!TestForMedium()) { + printf("device is unloaded\n"); + } else { + printf("device is loaded\n"); + } +} +</verb></tscreen> + + +The file <tt/generic_demo.c/ from the appendix contains both examples. + +<sect>Ioctl Functions + +<p> +<label id="sec-ioctl"> +There are two ioctl functions available: +<itemize> +<item> <tt/ioctl(fd, SG_SET_TIMEOUT, &Timeout);/ sets the timeout value to +<tt/Timeout/ * 10 milliseconds. <tt/Timeout/ has to be declared as int. +<item> <tt/ioctl(fd, SG_GET_TIMEOUT, &Timeout);/ gets the current timeout value. +<tt/Timeout/ has to be declared as int. +</itemize> + +<sect>Driver Defaults + +<p> +<label id="sec-Defaults"> +<sect1>Transfer Lengths + +<p> +<label id="sec-length"> +Currently (at least up to kernel version 1.1.68) input and output +sizes have to be less than or equal than 4096 bytes unless the kernel +has been compiled with <tt/SG_BIG_BUFF/ defined, if which case it is +limited to <tt/SG_BIG_BUFF/ (e.g. 32768) bytes. These sizes include +the generic header as well as the command block on input. +<tt/SG_BIG_BUFF/ can be safely increased upto (131072 - 512). To take +advantage of this, a new kernel has to be compiled and booted, of course. + +<sect1>Timeout And Retry Values + +<p> +The default timeout value is set to one minute (<tt/Timeout/ = 6000). +It can be changed through an ioctl call (see section <ref id="sec-ioctl">). +The default number of retries is one. + +<sect>Obtaining The Scsi Specifications + +<p> +There are standards entitled SCSI-1 and SCSI-2 (and possibly soon +SCSI-3). The standards are mostly upward compatible. + +The SCSI-1 standard is (in the author's opinion) mostly obsolete, and +SCSI-2 is the most widely used. SCSI-3 is very new and very +expensive. These standardized command sets specify mandatory and +optional commands for SCSI manufacturers and should be preferred over +the vendor specific command extensions which are not standardized and +for which programming information is seldom available. Of course +sometimes there is no alternative to these extensions. + + +Electronic copies of the latest drafts are available via anonymous ftp from: +<itemize> +<item>ftp.cs.tulane.edu:pub/scsi +<item>ftp.symbios.com:/pub/standards +<item>ftp.cs.uni-sb.de:/pub/misc/doc/scsi +</itemize> + +(I got my SCSI specification from the Yggdrasil Linux CD-ROM in the +directory /usr/doc/scsi-2 and /usr/doc/scsi-1). + +The SCSI FAQ also lists the following sources of printed +information: + + The SCSI specification: Available from: + +<tscreen><verb> + Global Engineering Documents + 15 Inverness Way East + Englewood Co 80112-5704 + (800) 854-7179 + SCSI-1: X3.131-1986 + SCSI-2: X3.131-199x + SCSI-3 X3T9.2/91-010R4 Working Draft + +(Global Engineering Documentation in Irvine, CA (714)261-1455??) + +SCSI-1: Doc \# X3.131-1986 from ANSI, 1430 Broadway, NY, NY 10018 + +IN-DEPTH EXPLORATION OF SCSI can be obtained from +Solution Technology, Attn: SCSI Publications, POB 104, Boulder Creek, +CA 95006, (408)338-4285, FAX (408)338-4374 + +THE SCSI ENCYLOPEDIA and the SCSI BENCH REFERENCE can be obtained from +ENDL Publishing, 14426 Black Walnut Ct., Saratoga, CA 95090, +(408)867-6642, FAX (408)867-2115 + +SCSI: UNDERSTANDING THE SMALL COMPUTER SYSTEM INTERFACE was published +by Prentice-Hall, ISBN 0-13-796855-8 +</verb></tscreen> + +<sect>Related Information Sources + +<p> +<sect1>HOWTOs and FAQs + +<p> +The Linux <bf/SCSI-HOWTO/ by Drew Eckhardt covers all supported SCSI +controllers as well as device specific questions. A lot of +troubleshooting hints are given. It is available from sunsite.unc.edu +in /pub/Linux/docs/LDP and its mirror sites. + +General questions about SCSI are answered in the <bf/SCSI-FAQ/ from the +newsgroup Comp.Periphs.Scsi (available on tsx-11 in +pub/linux/ALPHA/scsi and mirror sites). + +<sect1>Mailing list + +<p> +There is a <bf/mailing list/ for bug reports and questions regarding SCSI +development under Linux. To join, send email to +<tt/majordomo@vger.rutgers.edu/ with the line +<tt/subscribe linux-scsi/ +in the body of the message. Messages should be posted to +<tt/linux-scsi@vger.rutgers.edu/. Help text can be requested by sending +the message line "help" to <tt/majordomo@vger.rutgers.edu/. + +<sect1>Example code + +<p> +<descrip> +<tag>sunsite.unc.edu: apps/graphics/hpscanpbm-0.3a.tar.gz</tag> +This package handles a HP scanjet scanner through the generic interface. +<tag>tsx-11.mit.edu: BETA/cdrom/private/mkisofs/cdwrite-1.3.tar.gz</tag> +The cdwrite package uses the generic interface to write a cd image +to a cd writer. +<tag>sunsite.unc.edu: apps/sound/cds/cdda2wav*.src.tar.gz</tag> +A shameless plug for my own application, which copies audio cd tracks +into wav files. +</descrip> + + +<sect>Other useful stuff + +<p> +Things that may come in handy. I don't have no idea if there are newer +or better versions around. Feedback is welcome. + +<sect1>Device driver writer helpers + +<p> +These documents can be found at the sunsite.unc.edu ftp server and +its mirrors. +<descrip> +<tag>/pub/Linux/docs/kernel/kernel-hackers-guide</tag> +The LDP kernel hackers guide. May be a bit outdated, but covers the +most fundamental things. +<tag>/pub/Linux/docs/kernel/drivers.doc.z</tag> +This document covers writing character drivers. +<tag>/pub/Linux/docs/kernel/tutorial.doc.z</tag> +Tutorial on writing a character device driver with code. +<tag>/pub/Linux/docs/kernel/scsi.paper.tar.gz</tag> +A Latex document describing howto write a SCSI driver. +<tag>/pub/Linux/docs/hardware/DEVICES</tag> +A list of device majors and minors used by Linux. +</descrip> + +<sect1>Utilities + +<p> +<descrip> +<tag>tsx-11.mit.edu: ALPHA/scsi/scsiinfo*.tar.gz</tag> +Program to query a scsi device for operating parameters, +defect lists, etc. An X-based interface is available which requires +you have Tk/Tcl/wish installed. With the X-based interface you +can easily alter the settings on the drive. +<tag>tsx-11.mit.edu: ALPHA/kdebug</tag> +A gdb extension for kernel debugging. +</descrip> + + + +<sect>Other SCSI Access Interfaces + +<p> +In Linux there is also another SCSI access method via +SCSI_IOCTL_SEND_COMMAND ioctl calls, which is deprecated. +Special tools like 'scsiinfo' utilize it. + + +There are some other similar interfaces in use in the un*x world, but +not available for Linux: +<enum> +<item>CAM (Common Access Method) developed by Future Domain and other +SCSI vendors. Linux has little support for a SCSI CAM system yet +(mainly for booting from hard disk). +CAM even supports target mode, so one could disguise ones computer +as a peripheral hardware device (e.g. for a small SCSI net). +<item>ASPI (Advanced SCSI Programming Interface) developed by Adaptec. +This is the de facto standard for MS-DOS machines. +<!-- FIXME find out more about the following interfaces +<item> ??? is available under NeXTStep. +<item> DSLIB is available under Silicon Graphics. +<item> SCSI... is available under SUN machines. +<item> SCO Unix has something too. +<item> HPUX uses ioctls +--> +</enum> + +There are other application interfaces from SCO(TM), NeXT(TM), Silicon +Graphics(TM) and SUN(TM) as well. + +<sect>Final Comments + +<p> +The generic SCSI interface bridges the gap between user applications +and specific devices. But rather than bloating a lot of programs with +similar sets of low-level functions, it would be more desirable to +have a shared library with a generalized set of low-level functions +for a particular purpose. The main goal should be to have independent +layers of interfaces. A good design would separate an application +into low-level and hardware independent routines. The low-level +routines could be put into a shared library and made available for all +applications. Here, standardized interfaces should be followed as much +as possible before making new ones. + +By now you should know more than I do about the Linux generic SCSI +interface. So you can start developing powerful applications +for the benefit of the global Linux community now... + +<sect>Acknowledgments + +<p> +Special thanks go to Jeff Tranter for proofreading and enhancing the +text considerably as well as to Carlos Puchol for useful comments. +Drew Eckhardt's and Eric Youngdale's help on my first (dumb) questions +about the use of this interface has been appreciated. + +<appendix> +<sect>Appendix + +<p> +<sect>Error handling + +<p> +<label id="sec-errorhandling"> +The functions <tt/open/, <tt/ioctl/, <tt/write/ and <tt/read/ +can report errors. In this case their return value is -1 and the +global variable errno is set to the error number. +The errno values are defined in <tt>/usr/include/errno.h</tt>. +Possible values are: + +<tscreen><verb> +Function | Error | Description +=========|==============|============================================= +open | ENXIO | not a valid device + | EACCES | access mode is not read/write (O_RDWR) + | EBUSY | device was requested for nonblocking access, + | | but is busy now. + | ERESTARTSYS | this indicates an internal error. Try to + | | make it reproducible and inform the SCSI + | | channel (for details on bug reporting + | | see Drew Eckhardts SCSI-HOWTO). +ioctl | ENXIO | not a valid device +read | EAGAIN | the device would block. Try again later. + | ERESTARTSYS | this indicates an internal error. Try to + | | make it reproducible and inform the SCSI + | | channel (for details on bug reporting + | | see Drew Eckhardts SCSI-HOWTO). +write | EIO | the length is too small (smaller than the + | | generic header struct). Caution: Currently + | | there is no overlength checking. + | EAGAIN | the device would block. Try again later. + | ENOMEM | memory required for this request could not be + | | allocated. Try later again unless you + | | exceeded the maximum transfer size (see above) +select | | none +close | | none +</verb></tscreen> + + +For read/write positive return values indicate as usual the amount of +bytes that have been successfully transferred. This should equal the +amount you requested. + +<sect1>Error status decoding + +<p> +<label id="sec-stat-decoding"> +Furthermore a detailed reporting is done via the kernels <tt/hd_status/ +and the devices <tt/sense_buffer/ (see section <ref id="sec-sensebuff">) +both from the generic header structure. + +The meaning of <tt/hd_status/ can be found in <tt>drivers/scsi/scsi.h</tt>: +This <tt/unsigned int/ is composed out of different parts: + + +<tscreen><verb> + lsb | ... | ... | msb +=======|===========|===========|============ +status | sense key | host code | driver byte +</verb></tscreen> + + +These macros from <tt>drivers/scsi/scsi.h</tt> are available, but +unfortunately cannot be easily used due to weird header file +interdependencies. This has to be cleaned. + +<tscreen><verb> + Macro | Description +=======================|================================================= +status_byte(hd_status) | The SCSI device status. See section Status codes +msg_byte(hd_status) | From the device. See section SCSI sense keys +host_byte(hd_status) | From the kernel. See section Hostcodes +driver_byte(hd_status) | From the kernel. See section midlevel codes +</verb></tscreen> + + + +<sect1>Status codes + +<p> +<label id="sec-statuscodes"> + +The following status codes from the SCSI device +(defined in <tt>scsi/scsi.h</tt>) +are available. + +<tscreen><verb> +Value | Symbol +======|===================== +0x00 | GOOD +0x01 | CHECK_CONDITION +0x02 | CONDITION_GOOD +0x04 | BUSY +0x08 | INTERMEDIATE_GOOD +0x0a | INTERMEDIATE_C_GOOD +0x0c | RESERVATION_CONFLICT +</verb></tscreen> + + +Note that these symbol values have been <bf/shifted right once/. +When the status is CHECK_CONDITION, the sense data in the sense +buffer is valid (check especially the additional sense code +and additional sense code qualifier). + +These values carry the meaning from the SCSI-2 specification: +<tscreen><verb> + + Table 27: Status Byte Code ++=================================-==============================+ +| Bits of Status Byte | Status | +| 7 6 5 4 3 2 1 0 | | +|---------------------------------+------------------------------| +| R R 0 0 0 0 0 R | GOOD | +| R R 0 0 0 0 1 R | CHECK CONDITION | +| R R 0 0 0 1 0 R | CONDITION MET | +| R R 0 0 1 0 0 R | BUSY | +| R R 0 1 0 0 0 R | INTERMEDIATE | +| R R 0 1 0 1 0 R | INTERMEDIATE-CONDITION MET | +| R R 0 1 1 0 0 R | RESERVATION CONFLICT | +| R R 1 0 0 0 1 R | COMMAND TERMINATED | +| R R 1 0 1 0 0 R | QUEUE FULL | +| | | +| All Other Codes | Reserved | +|----------------------------------------------------------------| +| Key: R = Reserved bit | ++================================================================+ + +A definition of the status byte codes is given below. + +GOOD. This status indicates that the target has successfully completed the +command. + +CHECK CONDITION. This status indicates that a contingent allegiance condition +has occurred (see 6.6). + +CONDITION MET. This status or INTERMEDIATE-CONDITION MET is returned whenever +the requested operation is satisfied (see the SEARCH DATA and PRE-FETCH +commands). + +BUSY. This status indicates that the target is busy. This status shall be +returned whenever a target is unable to accept a command from an otherwise +acceptable initiator (i.e., no reservation conflicts). The recommended +initiator recovery action is to issue the command again at a later time. + +INTERMEDIATE. This status or INTERMEDIATE-CONDITION MET shall be returned for +every successfully completed command in a series of linked commands (except +the last command), unless the command is terminated with CHECK CONDITION, +RESERVATION CONFLICT, or COMMAND TERMINATED status. If INTERMEDIATE or +INTERMEDIATE-CONDITION MET status is not returned, the series of linked +commands is terminated and the I/O process is ended. + +INTERMEDIATE-CONDITION MET. This status is the combination of the CONDITION +MET and INTERMEDIATE statuses. + +RESERVATION CONFLICT. This status shall be returned whenever an initiator +attempts to access a logical unit or an extent within a logical unit that is +reserved with a conflicting reservation type for another SCSI device (see the +RESERVE and RESERVE UNIT commands). The recommended initiator recovery action +is to issue the command again at a later time. + +COMMAND TERMINATED. This status shall be returned whenever the target +terminates the current I/O process after receiving a TERMINATE I/O PROCESS +message (see 5.6.22). This status also indicates that a contingent allegiance +condition has occurred (see 6.6). + +QUEUE FULL. This status shall be implemented if tagged queuing is +implemented. This status is returned when a SIMPLE QUEUE TAG, ORDERED QUEUE +TAG, or HEAD OF QUEUE TAG message is received and the command queue is full. +The I/O process is not placed in the command queue. +</verb></tscreen> + + +<sect1>SCSI Sense Keys + +<p> +<label id="sec-sensekeys"> +<!-- The sense key from the result should be retrieved with the +macro <tt/msg_byte/ (see section <ref id="sec-stat-decoding">). --> +These kernel symbols (from <tt>scsi/scsi.h</tt>) are predefined: + +<tscreen><verb> +Value | Symbol +======|================ +0x00 | NO_SENSE +0x01 | RECOVERED_ERROR +0x02 | NOT_READY +0x03 | MEDIUM_ERROR +0x04 | HARDWARE_ERROR +0x05 | ILLEGAL_REQUEST +0x06 | UNIT_ATTENTION +0x07 | DATA_PROTECT +0x08 | BLANK_CHECK +0x0a | COPY_ABORTED +0x0b | ABORTED_COMMAND +0x0d | VOLUME_OVERFLOW +0x0e | MISCOMPARE +</verb></tscreen> + + +A verbatim list from the SCSI-2 doc follows (from section 7.2.14.3): + +<tscreen><verb> + Table 69: Sense Key (0h-7h) Descriptions ++========-====================================================================+ +| Sense | Description | +| Key | | +|--------+--------------------------------------------------------------------| +| 0h | NO SENSE. Indicates that there is no specific sense key | +| | information to be reported for the designated logical unit. This | +| | would be the case for a successful command or a command that | +| | received CHECK CONDITION or COMMAND TERMINATED status because one | +| | of the filemark, EOM, or ILI bits is set to one. | +|--------+--------------------------------------------------------------------| +| 1h | RECOVERED ERROR. Indicates that the last command completed | +| | successfully with some recovery action performed by the target. | +| | Details may be determinable by examining the additional sense | +| | bytes and the information field. When multiple recovered errors | +| | occur during one command, the choice of which error to report | +| | (first, last, most severe, etc.) is device specific. | +|--------+--------------------------------------------------------------------| +| 2h | NOT READY. Indicates that the logical unit addressed cannot be | +| | accessed. Operator intervention may be required to correct this | +| | condition. | +|--------+--------------------------------------------------------------------| +| 3h | MEDIUM ERROR. Indicates that the command terminated with a non- | +| | recovered error condition that was probably caused by a flaw in | +| | the medium or an error in the recorded data. This sense key may | +| | also be returned if the target is unable to distinguish between a | +| | flaw in the medium and a specific hardware failure (sense key 4h).| +|--------+--------------------------------------------------------------------| +| 4h | HARDWARE ERROR. Indicates that the target detected a non- | +| | recoverable hardware failure (for example, controller failure, | +| | device failure, parity error, etc.) while performing the command | +| | or during a self test. | +|--------+--------------------------------------------------------------------| +| 5h | ILLEGAL REQUEST. Indicates that there was an illegal parameter in| +| | the command descriptor block or in the additional parameters | +| | supplied as data for some commands (FORMAT UNIT, SEARCH DATA, | +| | etc.). If the target detects an invalid parameter in the command | +| | descriptor block, then it shall terminate the command without | +| | altering the medium. If the target detects an invalid parameter | +| | in the additional parameters supplied as data, then the target may| +| | have already altered the medium. This sense key may also indicate| +| | that an invalid IDENTIFY message was received (5.6.7). | +|--------+--------------------------------------------------------------------| +| 6h | UNIT ATTENTION. Indicates that the removable medium may have been| +| | changed or the target has been reset. See 6.9 for more detailed | +| | information about the unit attention condition. | +|--------+--------------------------------------------------------------------| +| 7h | DATA PROTECT. Indicates that a command that reads or writes the | +| | medium was attempted on a block that is protected from this | +| | operation. The read or write operation is not performed. | ++=============================================================================+ + + Table 70: Sense Key (8h-Fh) Descriptions ++========-====================================================================+ +| Sense | Description | +| Key | | +|--------+--------------------------------------------------------------------| +| 8h | BLANK CHECK. Indicates that a write-once device or a sequential- | +| | access device encountered blank medium or format-defined end-of- | +| | data indication while reading or a write-once device encountered a| +| | non-blank medium while writing. | +|--------+--------------------------------------------------------------------| +| 9h | Vendor Specific. This sense key is available for reporting vendor| +| | specific conditions. | +|--------+--------------------------------------------------------------------| +| Ah | COPY ABORTED. Indicates a COPY, COMPARE, or COPY AND VERIFY | +| | command was aborted due to an error condition on the source | +| | device, the destination device, or both. (See 7.2.3.2 for | +| | additional information about this sense key.) | +|--------+--------------------------------------------------------------------| +| Bh | ABORTED COMMAND. Indicates that the target aborted the command. | +| | The initiator may be able to recover by trying the command again. | +|--------+--------------------------------------------------------------------| +| Ch | EQUAL. Indicates a SEARCH DATA command has satisfied an equal | +| | comparison. | +|--------+--------------------------------------------------------------------| +| Dh | VOLUME OVERFLOW. Indicates that a buffered peripheral device has | +| | reached the end-of-partition and data may remain in the buffer | +| | that has not been written to the medium. A RECOVER BUFFERED DATA | +| | command(s) may be issued to read the unwritten data from the | +| | buffer. | +|--------+--------------------------------------------------------------------| +| Eh | MISCOMPARE. Indicates that the source data did not match the data| +| | read from the medium. | +|--------+--------------------------------------------------------------------| +| Fh | RESERVED. | ++=============================================================================+ +</verb></tscreen> + + +<sect1>Host codes + +<p> +<label id="sec-hostcodes"> +The following host codes are defined in <tt>drivers/scsi/scsi.h</tt>. They +are set by the kernel driver. +<!-- and should be used with the macro +<tt/host_byte/ (see section <ref id="sec-stat-decoding">): --> + +<tscreen><verb> +Value | Symbol | Description +======|================|======================================== +0x00 | DID_OK | No error +0x01 | DID_NO_CONNECT | Couldn't connect before timeout period +0x02 | DID_BUS_BUSY | BUS stayed busy through time out period +0x03 | DID_TIME_OUT | TIMED OUT for other reason +0x04 | DID_BAD_TARGET | BAD target +0x05 | DID_ABORT | Told to abort for some other reason +0x06 | DID_PARITY | Parity error +0x07 | DID_ERROR | internal error +0x08 | DID_RESET | Reset by somebody +0x09 | DID_BAD_INTR | Got an interrupt we weren't expecting +</verb></tscreen> + +<sect1>Driver codes + +<p> +<label id="sec-drivercodes"> +The midlevel driver categorizes the returned status from the lowlevel +driver based on the sense key from the device. It suggests some actions +to be taken such as retry, abort or remap. The routine scsi_done from +scsi.c does a very differentiated handling based on host_byte(), +status_byte(), msg_byte() and the suggestion. It then sets the driver +byte to show what it has done. The driver byte is composed out of two +nibbles: the driver status and the suggestion. Each half is composed +from the below values being 'or'ed together (found in scsi.h). + +<tscreen><verb> +Value | Symbol | Description of Driver status +======|================|======================================== +0x00 | DRIVER_OK | No error +0x01 | DRIVER_BUSY | not used +0x02 | DRIVER_SOFT | not used +0x03 | DRIVER_MEDIA | not used +0x04 | DRIVER_ERROR | internal driver error +0x05 | DRIVER_INVALID | finished (DID_BAD_TARGET or DID_ABORT) +0x06 | DRIVER_TIMEOUT | finished with timeout +0x07 | DRIVER_HARD | finished with fatal error +0x08 | DRIVER_SENSE | had sense information available +</verb></tscreen> + +<tscreen><verb> +Value | Symbol | Description of suggestion +======|================|======================================== +0x10 | SUGGEST_RETRY | retry the SCSI request +0x20 | SUGGEST_ABORT | abort the request +0x30 | SUGGEST_REMAP | remap the block (not yet implemented) +0x40 | SUGGEST_DIE | let the kernel panic +0x80 | SUGGEST_SENSE | get sense information from the device +0xff | SUGGEST_IS_OK | nothing to be done +</verb></tscreen> + +<sect>Additional sense codes and additional sense code qualifiers + +<p> +<label id="sec-sensecodes"> +When the status of the executed SCSI command is CHECK_CONDITION, +sense data is available in the sense buffer. The additional sense +code and additional sense code qualifier are contained in that +buffer. + +From the SCSI-2 specification I include two tables. The first is in +lexical, the second in numerical order. + +<sect1>ASC and ASCQ in lexical order + +<p> +The following table list gives a list of descriptions and device types +they apply to. + +<tscreen><verb> ++=============================================================================+ +| D - DIRECT ACCESS DEVICE | +| .T - SEQUENTIAL ACCESS DEVICE | +| . L - PRINTER DEVICE | +| . P - PROCESSOR DEVICE | +| . .W - WRITE ONCE READ MULTIPLE DEVICE | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 13h 00h D W O ADDRESS MARK NOT FOUND FOR DATA FIELD | +| 12h 00h D W O ADDRESS MARK NOT FOUND FOR ID FIELD | +| 00h 11h R AUDIO PLAY OPERATION IN PROGRESS | +| 00h 12h R AUDIO PLAY OPERATION PAUSED | +| 00h 14h R AUDIO PLAY OPERATION STOPPED DUE TO ERROR | +| 00h 13h R AUDIO PLAY OPERATION SUCCESSFULLY COMPLETED | +| 00h 04h T S BEGINNING-OF-PARTITION/MEDIUM DETECTED | +| 14h 04h T BLOCK SEQUENCE ERROR | +| 30h 02h DT WR O CANNOT READ MEDIUM - INCOMPATIBLE FORMAT | +| 30h 01h DT WR O CANNOT READ MEDIUM - UNKNOWN FORMAT | +| 52h 00h T CARTRIDGE FAULT | +| 3Fh 02h DTLPWRSOMC CHANGED OPERATING DEFINITION | +| 11h 06h WR O CIRC UNRECOVERED ERROR | +| 30h 03h DT CLEANING CARTRIDGE INSTALLED | +| 4Ah 00h DTLPWRSOMC COMMAND PHASE ERROR | +| 2Ch 00h DTLPWRSOMC COMMAND SEQUENCE ERROR | +| 2Fh 00h DTLPWRSOMC COMMANDS CLEARED BY ANOTHER INITIATOR | +| 2Bh 00h DTLPWRSO C COPY CANNOT EXECUTE SINCE HOST CANNOT DISCONNECT | +| 41h 00h D DATA PATH FAILURE (SHOULD USE 40 NN) | +| 4Bh 00h DTLPWRSOMC DATA PHASE ERROR | +| 11h 07h W O DATA RESYCHRONIZATION ERROR | +| 16h 00h D W O DATA SYNCHRONIZATION MARK ERROR | +| 19h 00h D O DEFECT LIST ERROR | +| 19h 03h D O DEFECT LIST ERROR IN GROWN LIST | +| 19h 02h D O DEFECT LIST ERROR IN PRIMARY LIST | +| 19h 01h D O DEFECT LIST NOT AVAILABLE | +| 1Ch 00h D O DEFECT LIST NOT FOUND | +| 32h 01h D W O DEFECT LIST UPDATE FAILURE | +| 40h NNh DTLPWRSOMC DIAGNOSTIC FAILURE ON COMPONENT NN (80H-FFH) | +| 63h 00h R END OF USER AREA ENCOUNTERED ON THIS TRACK | +| 00h 05h T S END-OF-DATA DETECTED | +| 14h 03h T END-OF-DATA NOT FOUND | +| 00h 02h T S END-OF-PARTITION/MEDIUM DETECTED | +| 51h 00h T O ERASE FAILURE | +| 0Ah 00h DTLPWRSOMC ERROR LOG OVERFLOW | +| 11h 02h DT W SO ERROR TOO LONG TO CORRECT | +| 03h 02h T EXCESSIVE WRITE ERRORS | +| 3Bh 07h L FAILED TO SENSE BOTTOM-OF-FORM | +| 3Bh 06h L FAILED TO SENSE TOP-OF-FORM | +| 00h 01h T FILEMARK DETECTED | +| 14h 02h T FILEMARK OR SETMARK NOT FOUND | +| 09h 02h WR O FOCUS SERVO FAILURE | +| 31h 01h D L O FORMAT COMMAND FAILED | +| 58h 00h O GENERATION DOES NOT EXIST | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 71: (continued) ++=============================================================================+ +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 1Ch 02h D O GROWN DEFECT LIST NOT FOUND | +| 00h 06h DTLPWRSOMC I/O PROCESS TERMINATED | +| 10h 00h D W O ID CRC OR ECC ERROR | +| 22h 00h D ILLEGAL FUNCTION (SHOULD USE 20 00, 24 00, OR 26 00) | +| 64h 00h R ILLEGAL MODE FOR THIS TRACK | +| 28h 01h M IMPORT OR EXPORT ELEMENT ACCESSED | +| 30h 00h DT WR OM INCOMPATIBLE MEDIUM INSTALLED | +| 11h 08h T INCOMPLETE BLOCK READ | +| 48h 00h DTLPWRSOMC INITIATOR DETECTED ERROR MESSAGE RECEIVED | +| 3Fh 03h DTLPWRSOMC INQUIRY DATA HAS CHANGED | +| 44h 00h DTLPWRSOMC INTERNAL TARGET FAILURE | +| 3Dh 00h DTLPWRSOMC INVALID BITS IN IDENTIFY MESSAGE | +| 2Ch 02h S INVALID COMBINATION OF WINDOWS SPECIFIED | +| 20h 00h DTLPWRSOMC INVALID COMMAND OPERATION CODE | +| 21h 01h M INVALID ELEMENT ADDRESS | +| 24h 00h DTLPWRSOMC INVALID FIELD IN CDB | +| 26h 00h DTLPWRSOMC INVALID FIELD IN PARAMETER LIST | +| 49h 00h DTLPWRSOMC INVALID MESSAGE ERROR | +| 11h 05h WR O L-EC UNCORRECTABLE ERROR | +| 60h 00h S LAMP FAILURE | +| 5Bh 02h DTLPWRSOM LOG COUNTER AT MAXIMUM | +| 5Bh 00h DTLPWRSOM LOG EXCEPTION | +| 5Bh 03h DTLPWRSOM LOG LIST CODES EXHAUSTED | +| 2Ah 02h DTL WRSOMC LOG PARAMETERS CHANGED | +| 21h 00h DT WR OM LOGICAL BLOCK ADDRESS OUT OF RANGE | +| 08h 00h DTL WRSOMC LOGICAL UNIT COMMUNICATION FAILURE | +| 08h 02h DTL WRSOMC LOGICAL UNIT COMMUNICATION PARITY ERROR | +| 08h 01h DTL WRSOMC LOGICAL UNIT COMMUNICATION TIME-OUT | +| 4Ch 00h DTLPWRSOMC LOGICAL UNIT FAILED SELF-CONFIGURATION | +| 3Eh 00h DTLPWRSOMC LOGICAL UNIT HAS NOT SELF-CONFIGURED YET | +| 04h 01h DTLPWRSOMC LOGICAL UNIT IS IN PROCESS OF BECOMING READY | +| 04h 00h DTLPWRSOMC LOGICAL UNIT NOT READY, CAUSE NOT REPORTABLE | +| 04h 04h DTL O LOGICAL UNIT NOT READY, FORMAT IN PROGRESS | +| 04h 02h DTLPWRSOMC LOGICAL UNIT NOT READY, INITIALIZING COMMAND REQUIRED | +| 04h 03h DTLPWRSOMC LOGICAL UNIT NOT READY, MANUAL INTERVENTION REQUIRED | +| 25h 00h DTLPWRSOMC LOGICAL UNIT NOT SUPPORTED | +| 15h 01h DTL WRSOM MECHANICAL POSITIONING ERROR | +| 53h 00h DTL WRSOM MEDIA LOAD OR EJECT FAILED | +| 3Bh 0Dh M MEDIUM DESTINATION ELEMENT FULL | +| 31h 00h DT W O MEDIUM FORMAT CORRUPTED | +| 3Ah 00h DTL WRSOM MEDIUM NOT PRESENT | +| 53h 02h DT WR OM MEDIUM REMOVAL PREVENTED | +| 3Bh 0Eh M MEDIUM SOURCE ELEMENT EMPTY | +| 43h 00h DTLPWRSOMC MESSAGE ERROR | +| 3Fh 01h DTLPWRSOMC MICROCODE HAS BEEN CHANGED | +| 1Dh 00h D W O MISCOMPARE DURING VERIFY OPERATION | +| 11h 0Ah DT O MISCORRECTED ERROR | +| 2Ah 01h DTL WRSOMC MODE PARAMETERS CHANGED | +| 07h 00h DTL WRSOM MULTIPLE PERIPHERAL DEVICES SELECTED | +| 11h 03h DT W SO MULTIPLE READ ERRORS | +| 00h 00h DTLPWRSOMC NO ADDITIONAL SENSE INFORMATION | +| 00h 15h R NO CURRENT AUDIO STATUS TO RETURN | +| 32h 00h D W O NO DEFECT SPARE LOCATION AVAILABLE | +| 11h 09h T NO GAP FOUND | +| 01h 00h D W O NO INDEX/SECTOR SIGNAL | +| 06h 00h D WR OM NO REFERENCE POSITION FOUND | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 71: (continued) ++=============================================================================+ +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 02h 00h D WR OM NO SEEK COMPLETE | +| 03h 01h T NO WRITE CURRENT | +| 28h 00h DTLPWRSOMC NOT READY TO READY TRANSITION, MEDIUM MAY HAVE CHANGED| +| 5Ah 01h DT WR OM OPERATOR MEDIUM REMOVAL REQUEST | +| 5Ah 00h DTLPWRSOM OPERATOR REQUEST OR STATE CHANGE INPUT (UNSPECIFIED) | +| 5Ah 03h DT W O OPERATOR SELECTED WRITE PERMIT | +| 5Ah 02h DT W O OPERATOR SELECTED WRITE PROTECT | +| 61h 02h S OUT OF FOCUS | +| 4Eh 00h DTLPWRSOMC OVERLAPPED COMMANDS ATTEMPTED | +| 2Dh 00h T OVERWRITE ERROR ON UPDATE IN PLACE | +| 3Bh 05h L PAPER JAM | +| 1Ah 00h DTLPWRSOMC PARAMETER LIST LENGTH ERROR | +| 26h 01h DTLPWRSOMC PARAMETER NOT SUPPORTED | +| 26h 02h DTLPWRSOMC PARAMETER VALUE INVALID | +| 2Ah 00h DTL WRSOMC PARAMETERS CHANGED | +| 03h 00h DTL W SO PERIPHERAL DEVICE WRITE FAULT | +| 50h 02h T POSITION ERROR RELATED TO TIMING | +| 3Bh 0Ch S POSITION PAST BEGINNING OF MEDIUM | +| 3Bh 0Bh S POSITION PAST END OF MEDIUM | +| 15h 02h DT WR O POSITIONING ERROR DETECTED BY READ OF MEDIUM | +| 29h 00h DTLPWRSOMC POWER ON, RESET, OR BUS DEVICE RESET OCCURRED | +| 42h 00h D POWER-ON OR SELF-TEST FAILURE (SHOULD USE 40 NN) | +| 1Ch 01h D O PRIMARY DEFECT LIST NOT FOUND | +| 40h 00h D RAM FAILURE (SHOULD USE 40 NN) | +| 15h 00h DTL WRSOM RANDOM POSITIONING ERROR | +| 3Bh 0Ah S READ PAST BEGINNING OF MEDIUM | +| 3Bh 09h S READ PAST END OF MEDIUM | +| 11h 01h DT W SO READ RETRIES EXHAUSTED | +| 14h 01h DT WR O RECORD NOT FOUND | +| 14h 00h DTL WRSO RECORDED ENTITY NOT FOUND | +| 18h 02h D WR O RECOVERED DATA - DATA AUTO-REALLOCATED | +| 18h 05h D WR O RECOVERED DATA - RECOMMEND REASSIGNMENT | +| 18h 06h D WR O RECOVERED DATA - RECOMMEND REWRITE | +| 17h 05h D WR O RECOVERED DATA USING PREVIOUS SECTOR ID | +| 18h 03h R RECOVERED DATA WITH CIRC | +| 18h 01h D WR O RECOVERED DATA WITH ERROR CORRECTION &ero RETRIES APPLIED| +| 18h 00h DT WR O RECOVERED DATA WITH ERROR CORRECTION APPLIED | +| 18h 04h R RECOVERED DATA WITH L-EC | +| 17h 03h DT WR O RECOVERED DATA WITH NEGATIVE HEAD OFFSET | +| 17h 00h DT WRSO RECOVERED DATA WITH NO ERROR CORRECTION APPLIED | +| 17h 02h DT WR O RECOVERED DATA WITH POSITIVE HEAD OFFSET | +| 17h 01h DT WRSO RECOVERED DATA WITH RETRIES | +| 17h 04h WR O RECOVERED DATA WITH RETRIES AND/OR CIRC APPLIED | +| 17h 06h D W O RECOVERED DATA WITHOUT ECC - DATA AUTO-REALLOCATED | +| 17h 07h D W O RECOVERED DATA WITHOUT ECC - RECOMMEND REASSIGNMENT | +| 17h 08h D W O RECOVERED DATA WITHOUT ECC - RECOMMEND REWRITE | +| 1Eh 00h D W O RECOVERED ID WITH ECC CORRECTION | +| 3Bh 08h T REPOSITION ERROR | +| 36h 00h L RIBBON, INK, OR TONER FAILURE | +| 37h 00h DTL WRSOMC ROUNDED PARAMETER | +| 5Ch 00h D O RPL STATUS CHANGE | +| 39h 00h DTL WRSOMC SAVING PARAMETERS NOT SUPPORTED | +| 62h 00h S SCAN HEAD POSITIONING ERROR | +| 47h 00h DTLPWRSOMC SCSI PARITY ERROR | +| 54h 00h P SCSI TO HOST SYSTEM INTERFACE FAILURE | +| 45h 00h DTLPWRSOMC SELECT OR RESELECT FAILURE | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 71: (concluded) ++=============================================================================+ +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 3Bh 00h TL SEQUENTIAL POSITIONING ERROR | +| 00h 03h T SETMARK DETECTED | +| 3Bh 04h L SLEW FAILURE | +| 09h 03h WR O SPINDLE SERVO FAILURE | +| 5Ch 02h D O SPINDLES NOT SYNCHRONIZED | +| 5Ch 01h D O SPINDLES SYNCHRONIZED | +| 1Bh 00h DTLPWRSOMC SYNCHRONOUS DATA TRANSFER ERROR | +| 55h 00h P SYSTEM RESOURCE FAILURE | +| 33h 00h T TAPE LENGTH ERROR | +| 3Bh 03h L TAPE OR ELECTRONIC VERTICAL FORMS UNIT NOT READY | +| 3Bh 01h T TAPE POSITION ERROR AT BEGINNING-OF-MEDIUM | +| 3Bh 02h T TAPE POSITION ERROR AT END-OF-MEDIUM | +| 3Fh 00h DTLPWRSOMC TARGET OPERATING CONDITIONS HAVE CHANGED | +| 5Bh 01h DTLPWRSOM THRESHOLD CONDITION MET | +| 26h 03h DTLPWRSOMC THRESHOLD PARAMETERS NOT SUPPORTED | +| 2Ch 01h S TOO MANY WINDOWS SPECIFIED | +| 09h 00h DT WR O TRACK FOLLOWING ERROR | +| 09h 01h WR O TRACKING SERVO FAILURE | +| 61h 01h S UNABLE TO ACQUIRE VIDEO | +| 57h 00h R UNABLE TO RECOVER TABLE-OF-CONTENTS | +| 53h 01h T UNLOAD TAPE FAILURE | +| 11h 00h DT WRSO UNRECOVERED READ ERROR | +| 11h 04h D W O UNRECOVERED READ ERROR - AUTO REALLOCATE FAILED | +| 11h 0Bh D W O UNRECOVERED READ ERROR - RECOMMEND REASSIGNMENT | +| 11h 0Ch D W O UNRECOVERED READ ERROR - RECOMMEND REWRITE THE DATA | +| 46h 00h DTLPWRSOMC UNSUCCESSFUL SOFT RESET | +| 59h 00h O UPDATED BLOCK READ | +| 61h 00h S VIDEO ACQUISITION ERROR | +| 50h 00h T WRITE APPEND ERROR | +| 50h 01h T WRITE APPEND POSITION ERROR | +| 0Ch 00h T S WRITE ERROR | +| 0Ch 02h D W O WRITE ERROR - AUTO REALLOCATION FAILED | +| 0Ch 01h D W O WRITE ERROR RECOVERED WITH AUTO REALLOCATION | +| 27h 00h DT W O WRITE PROTECTED | +| | +| 80h XXh \ | +| THROUGH > VENDOR SPECIFIC. | +| FFh XX / | +| | +| XXh 80h \ | +| THROUGH > VENDOR SPECIFIC QUALIFICATION OF STANDARD ASC. | +| XXh FFh / | +| ALL CODES NOT SHOWN ARE RESERVED. | +|-----------------------------------------------------------------------------| +</verb></tscreen> + + +<sect1>ASC and ASCQ in numerical order + +<p> +<tscreen><verb> + Table 364: ASC and ASCQ Assignments + ++=============================================================================+ +| D - DIRECT ACCESS DEVICE | +| .T - SEQUENTIAL ACCESS DEVICE | +| . L - PRINTER DEVICE | +| . P - PROCESSOR DEVICE | +| . .W - WRITE ONCE READ MULTIPLE DEVICE | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 00 00 DTLPWRSOMC NO ADDITIONAL SENSE INFORMATION | +| 00 01 T FILEMARK DETECTED | +| 00 02 T S END-OF-PARTITION/MEDIUM DETECTED | +| 00 03 T SETMARK DETECTED | +| 00 04 T S BEGINNING-OF-PARTITION/MEDIUM DETECTED | +| 00 05 T S END-OF-DATA DETECTED | +| 00 06 DTLPWRSOMC I/O PROCESS TERMINATED | +| 00 11 R AUDIO PLAY OPERATION IN PROGRESS | +| 00 12 R AUDIO PLAY OPERATION PAUSED | +| 00 13 R AUDIO PLAY OPERATION SUCCESSFULLY COMPLETED | +| 00 14 R AUDIO PLAY OPERATION STOPPED DUE TO ERROR | +| 00 15 R NO CURRENT AUDIO STATUS TO RETURN | +| 01 00 DW O NO INDEX/SECTOR SIGNAL | +| 02 00 DWR OM NO SEEK COMPLETE | +| 03 00 DTL W SO PERIPHERAL DEVICE WRITE FAULT | +| 03 01 T NO WRITE CURRENT | +| 03 02 T EXCESSIVE WRITE ERRORS | +| 04 00 DTLPWRSOMC LOGICAL UNIT NOT READY, CAUSE NOT REPORTABLE | +| 04 01 DTLPWRSOMC LOGICAL UNIT IS IN PROCESS OF BECOMING READY | +| 04 02 DTLPWRSOMC LOGICAL UNIT NOT READY, INITIALIZING COMMAND REQUIRED | +| 04 03 DTLPWRSOMC LOGICAL UNIT NOT READY, MANUAL INTERVENTION REQUIRED | +| 04 04 DTL O LOGICAL UNIT NOT READY, FORMAT IN PROGRESS | +| 05 00 DTL WRSOMC LOGICAL UNIT DOES NOT RESPOND TO SELECTION | +| 06 00 DWR OM NO REFERENCE POSITION FOUND | +| 07 00 DTL WRSOM MULTIPLE PERIPHERAL DEVICES SELECTED | +| 08 00 DTL WRSOMC LOGICAL UNIT COMMUNICATION FAILURE | +| 08 01 DTL WRSOMC LOGICAL UNIT COMMUNICATION TIME-OUT | +| 08 02 DTL WRSOMC LOGICAL UNIT COMMUNICATION PARITY ERROR | +| 09 00 DT WR O TRACK FOLLOWING ERROR | +| 09 01 WR O TRA CKING SERVO FAILURE | +| 09 02 WR O FOC US SERVO FAILURE | +| 09 03 WR O SPI NDLE SERVO FAILURE | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 364: (continued) ++=============================================================================+ +| D - DIRECT ACCESS DEVICE | +| .T - SEQUENTIAL ACCESS DEVICE | +| . L - PRINTER DEVICE | +| . P - PROCESSOR DEVICE | +| . .W - WRITE ONCE READ MULTIPLE DEVICE | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 0A 00 DTLPWRSOMC ERROR LOG OVERFLOW | +| 0B 00 | +| 0C 00 T S WRITE ERROR | +| 0C 01 D W O WRITE ERROR RECOVERED WITH AUTO REALLOCATION | +| 0C 02 D W O WRITE ERROR - AUTO REALLOCATION FAILED | +| 0D 00 | +| 0E 00 | +| 0F 00 | +| 10 00 D W O ID CRC OR ECC ERROR | +| 11 00 DT WRSO UNRECOVERED READ ERROR | +| 11 01 DT W SO READ RETRIES EXHAUSTED | +| 11 02 DT W SO ERROR TOO LONG TO CORRECT | +| 11 03 DT W SO MULTIPLE READ ERRORS | +| 11 04 D W O UNRECOVERED READ ERROR - AUTO REALLOCATE FAILED | +| 11 05 WR O L-EC UNCORRECTABLE ERROR | +| 11 06 WR O CIRC UNRECOVERED ERROR | +| 11 07 W O DATA RESYCHRONIZATION ERROR | +| 11 08 T INCOMPLETE BLOCK READ | +| 11 09 T NO GAP FOUND | +| 11 0A DT O MISCORRECTED ERROR | +| 11 0B D W O UNRECOVERED READ ERROR - RECOMMEND REASSIGNMENT | +| 11 0C D W O UNRECOVERED READ ERROR - RECOMMEND REWRITE THE DATA | +| 12 00 D W O ADDRESS MARK NOT FOUND FOR ID FIELD | +| 13 00 D W O ADDRESS MARK NOT FOUND FOR DATA FIELD | +| 14 00 DTL WRSO RECORDED ENTITY NOT FOUND | +| 14 01 DT WR O RECORD NOT FOUND | +| 14 02 T FILEMARK OR SETMARK NOT FOUND | +| 14 03 T END-OF-DATA NOT FOUND | +| 14 04 T BLOCK SEQUENCE ERROR | +| 15 00 DTL WRSOM RANDOM POSITIONING ERROR | +| 15 01 DTL WRSOM MECHANICAL POSITIONING ERROR | +| 15 02 DT WR O POSITIONING ERROR DETECTED BY READ OF MEDIUM | +| 16 00 DW O DATA SYNCHRONIZATION MARK ERROR | +| 17 00 DT WRSO RECOVERED DATA WITH NO ERROR CORRECTION APPLIED | +| 17 01 DT WRSO RECOVERED DATA WITH RETRIES | +| 17 02 DT WR O RECOVERED DATA WITH POSITIVE HEAD OFFSET | +| 17 03 DT WR O RECOVERED DATA WITH NEGATIVE HEAD OFFSET | +| 17 04 WR O RECOVERED DATA WITH RETRIES AND/OR CIRC APPLIED | +| 17 05 D WR O RECOVERED DATA USING PREVIOUS SECTOR ID | +| 17 06 D W O RECOVERED DATA WITHOUT ECC - DATA AUTO-REALLOCATED | +| 17 07 D W O RECOVERED DATA WITHOUT ECC - RECOMMEND REASSIGNMENT | +| 17 08 D W O RECOVERED DATA WITHOUT ECC - RECOMMEND REWRITE | +| 18 00 DT WR O RECOVERED DATA WITH ERROR CORRECTION APPLIED | +| 18 01 D WR O RECOVERED DATA WITH ERROR CORRECTION &ero RETRIES APPLIED| +| 18 02 D WR O RECOVERED DATA - DATA AUTO-REALLOCATED | +| 18 03 R RECOVERED DATA WITH CIRC | +| 18 04 R RECOVERED DATA WITH LEC | +| 18 05 D WR O RECOVERED DATA - RECOMMEND REASSIGNMENT | +| 18 06 D WR O RECOVERED DATA - RECOMMEND REWRITE | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 364: (continued) ++=============================================================================+ +| D - DIRECT ACCESS DEVICE | +| .T - SEQUENTIAL ACCESS DEVICE | +| . L - PRINTER DEVICE | +| . P - PROCESSOR DEVICE | +| . .W - WRITE ONCE READ MULTIPLE DEVICE | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 19 00 D O DEFECT LIST ERROR | +| 19 01 D O DEFECT LIST NOT AVAILABLE | +| 19 02 D O DEFECT LIST ERROR IN PRIMARY LIST | +| 19 03 D O DEFECT LIST ERROR IN GROWN LIST | +| 1A 00 DTLPWRSOMC PARAMETER LIST LENGTH ERROR | +| 1B 00 DTLPWRSOMC SYNCHRONOUS DATA TRANSFER ERROR | +| 1C 00 D O DEFECT LIST NOT FOUND | +| 1C 01 D O PRIMARY DEFECT LIST NOT FOUND | +| 1C 02 D O GROWN DEFECT LIST NOT FOUND | +| 1D 00 D W O MISCOMPARE DURING VERIFY OPERATION | +| 1E 00 D W O RECOVERED ID WITH ECC | +| 1F 00 | +| 20 00 DTLPWRSOMC INVALID COMMAND OPERATION CODE | +| 21 00 DT WR OM LOGICAL BLOCK ADDRESS OUT OF RANGE | +| 21 01 M INVALID ELEMENT ADDRESS | +| 22 00 D ILLEGAL FUNCTION (SHOULD USE 20 00, 24 00, OR 26 00) | +| 23 00 | +| 24 00 DTLPWRSOMC INVALID FIELD IN CDB | +| 25 00 DTLPWRSOMC LOGICAL UNIT NOT SUPPORTED | +| 26 00 DTLPWRSOMC INVALID FIELD IN PARAMETER LIST | +| 26 01 DTLPWRSOMC PARAMETER NOT SUPPORTED | +| 26 02 DTLPWRSOMC PARAMETER VALUE INVALID | +| 26 03 DTLPWRSOMC THRESHOLD PARAMETERS NOT SUPPORTED | +| 27 00 DT W O WRITE PROTECTED | +| 28 00 DTLPWRSOMC NOT READY TO READY TRANSITION(MEDIUM MAY HAVE CHANGED)| +| 28 01 M IMPORT OR EXPORT ELEMENT ACCESSED | +| 29 00 DTLPWRSOMC POWER ON, RESET, OR BUS DEVICE RESET OCCURRED | +| 2A 00 DTL WRSOMC PARAMETERS CHANGED | +| 2A 01 DTL WRSOMC MODE PARAMETERS CHANGED | +| 2A 02 DTL WRSOMC LOG PARAMETERS CHANGED | +| 2B 00 DTLPWRSO C COPY CANNOT EXECUTE SINCE HOST CANNOT DISCONNECT | +| 2C 00 DTLPWRSOMC COMMAND SEQUENCE ERROR | +| 2C 01 S TOO MANY WINDOWS SPECIFIED | +| 2C 02 S INVALID COMBINATION OF WINDOWS SPECIFIED | +| 2D 00 T OVERWRITE ERROR ON UPDATE IN PLACE | +| 2E 00 | +| 2F 00 DTLPWRSOMC COMMANDS CLEARED BY ANOTHER INITIATOR | +| 30 00 DT WR OM INCOMPATIBLE MEDIUM INSTALLED | +| 30 01 DT WR O CANNOT READ MEDIUM - UNKNOWN FORMAT | +| 30 02 DT WR O CANNOT READ MEDIUM - INCOMPATIBLE FORMAT | +| 30 03 DT CLEANING CARTRIDGE INSTALLED | +| 31 00 DT W O MEDIUM FORMAT CORRUPTED | +| 31 01 D L O FORMAT COMMAND FAILED | +| 32 00 D W O NO DEFECT SPARE LOCATION AVAILABLE | +| 32 01 D W O DEFECT LIST UPDATE FAILURE | +| 33 00 T TAPE LENGTH ERROR | +| 34 00 | +| 35 00 | +| 36 00 L RIBBON, INK, OR TONER FAILURE | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 364: (continued) ++=============================================================================+ +| D - DIRECT ACCESS DEVICE | +| .T - SEQUENTIAL ACCESS DEVICE | +| . L - PRINTER DEVICE | +| . P - PROCESSOR DEVICE | +| . .W - WRITE ONCE READ MULTIPLE DEVICE | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 37 00 DTL WRSOMC ROUNDED PARAMETER | +| 38 00 | +| 39 00 DTL WRSOMC SAVING PARAMETERS NOT SUPPORTED | +| 3A 00 DTL WRSOM MEDIUM NOT PRESENT | +| 3B 00 TL SEQUENTIAL POSITIONING ERROR | +| 3B 01 T TAPE POSITION ERROR AT BEGINNING-OF-MEDIUM | +| 3B 02 T TAPE POSITION ERROR AT END-OF-MEDIUM | +| 3B 03 L TAPE OR ELECTRONIC VERTICAL FORMS UNIT NOT READY | +| 3B 04 L SLEW FAILURE | +| 3B 05 L PAPER JAM | +| 3B 06 L FAILED TO SENSE TOP-OF-FORM | +| 3B 07 L FAILED TO SENSE BOTTOM-OF-FORM | +| 3B 08 T REPOSITION ERROR | +| 3B 09 S READ PAST END OF MEDIUM | +| 3B 0A S READ PAST BEGINNING OF MEDIUM | +| 3B 0B S POSITION PAST END OF MEDIUM | +| 3B 0C S POSITION PAST BEGINNING OF MEDIUM | +| 3B 0D M MEDIUM DESTINATION ELEMENT FULL | +| 3B 0E M MEDIUM SOURCE ELEMENT EMPTY | +| 3C 00 | +| 3D 00 DTLPWRSOMC INVALID BITS IN IDENTIFY MESSAGE | +| 3E 00 DTLPWRSOMC LOGICAL UNIT HAS NOT SELF-CONFIGURED YET | +| 3F 00 DTLPWRSOMC TARGET OPERATING CONDITIONS HAVE CHANGED | +| 3F 01 DTLPWRSOMC MICROCODE HAS BEEN CHANGED | +| 3F 02 DTLPWRSOMC CHANGED OPERATING DEFINITION | +| 3F 03 DTLPWRSOMC INQUIRY DATA HAS CHANGED | +| 40 00 D RAM FAILURE (SHOULD USE 40 NN) | +| 40 NN DTLPWRSOMC DIAGNOSTIC FAILURE ON COMPONENT NN (80H-FFH) | +| 41 00 D DATA PATH FAILURE (SHOULD USE 40 NN) | +| 42 00 D POWER-ON OR SELF-TEST FAILURE (SHOULD USE 40 NN) | +| 43 00 DTLPWRSOMC MESSAGE ERROR | +| 44 00 DTLPWRSOMC INTERNAL TARGET FAILURE | +| 45 00 DTLPWRSOMC SELECT OR RESELECT FAILURE | +| 46 00 DTLPWRSOMC UNSUCCESSFUL SOFT RESET | +| 47 00 DTLPWRSOMC SCSI PARITY ERROR | +| 48 00 DTLPWRSOMC INITIATOR DETECTED ERROR MESSAGE RECEIVED | +| 49 00 DTLPWRSOMC INVALID MESSAGE ERROR | +| 4A 00 DTLPWRSOMC COMMAND PHASE ERROR | +| 4B 00 DTLPWRSOMC DATA PHASE ERROR | +| 4C 00 DTLPWRSOMC LOGICAL UNIT FAILED SELF-CONFIGURATION | +| 4D 00 | +| 4E 00 DTLPWRSOMC OVERLAPPED COMMANDS ATTEMPTED | +| 4F 00 | +| 50 00 T WRITE APPEND ERROR | +| 50 01 T WRITE APPEND POSITION ERROR | +| 50 02 T POSITION ERROR RELATED TO TIMING | +| 51 00 T O ERASE FAILURE | +| 52 00 T CARTRIDGE FAULT | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 364: (continued) ++=============================================================================+ +| D - DIRECT ACCESS DEVICE | +| .T - SEQUENTIAL ACCESS DEVICE | +| . L - PRINTER DEVICE | +| . P - PROCESSOR DEVICE | +| . .W - WRITE ONCE READ MULTIPLE DEVICE | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 53 00 DTL WRSOM MEDIA LOAD OR EJECT FAILED | +| 53 01 T UNLOAD TAPE FAILURE | +| 53 02 DT WR OM MEDIUM REMOVAL PREVENTED | +| 54 00 P SCSI TO HOST SYSTEM INTERFACE FAILURE | +| 55 00 P SYSTEM RESOURCE FAILURE | +| 56 00 | +| 57 00 R UNABLE TO RECOVER TABLE-OF-CONTENTS | +| 58 00 O GENERATION DOES NOT EXIST | +| 59 00 O UPDATED BLOCK READ | +| 5A 00 DTLPWRSOM OPERATOR REQUEST OR STATE CHANGE INPUT (UNSPECIFIED) | +| 5A 01 DT WR OM OPERATOR MEDIUM REMOVAL REQUEST | +| 5A 02 DT W O OPERATOR SELECTED WRITE PROTECT | +| 5A 03 DT W O OPERATOR SELECTED WRITE PERMIT | +| 5B 00 DTLPWRSOM LOG EXCEPTION | +| 5B 01 DTLPWRSOM THRESHOLD CONDITION MET | +| 5B 02 DTLPWRSOM LOG COUNTER AT MAXIMUM | +| 5B 03 DTLPWRSOM LOG LIST CODES EXHAUSTED | +| 5C 00 D O RPL STATUS CHANGE | +| 5C 01 D O SPINDLES SYNCHRONIZED | +| 5C 02 D O SPINDLES NOT SYNCHRONIZED | +| 5D 00 | +| 5E 00 | +| 5F 00 | +| 60 00 S LAMP FAILURE | +| 61 00 S VIDEO ACQUISITION ERROR | +| 61 01 S UNABLE TO ACQUIRE VIDEO | +| 61 02 S OUT OF FOCUS | +| 62 00 S SCAN HEAD POSITIONING ERROR | +| 63 00 R END OF USER AREA ENCOUNTERED ON THIS TRACK | +| 64 00 R ILLEGAL MODE FOR THIS TRACK | +| 65 00 | +| 66 00 | +| 67 00 | +| 68 00 | +| 69 00 | +| 6A 00 | +| 6B 00 | +| 6C 00 | +| 6D 00 | +| 6E 00 | +| 6F 00 | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 364: (concluded) ++=============================================================================+ +| D - DIRECT ACCESS DEVICE | +| .T - SEQUENTIAL ACCESS DEVICE | +| . L - PRINTER DEVICE | +| . P - PROCESSOR DEVICE | +| . .W - WRITE ONCE READ MULTIPLE DEVICE | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| ASC ASCQ DTLPWRSOMC DESCRIPTION | +| --- ---- ----------------------------------------------------- | +| 70 00 | +| 71 00 | +| 72 00 | +| 73 00 | +| 74 00 | +| 75 00 | +| 76 00 | +| 77 00 | +| 78 00 | +| 79 00 | +| 7A 00 | +| 7B 00 | +| 7C 00 | +| 7D 00 | +| 7E 00 | +| 7F 00 | +| | +| 80 xxh \ | +| THROUGH > VENDOR SPECIFIC. | +| FF xxh / | +| | +| xxh 80 \ | +| THROUGH > VENDOR SPECIFIC QUALIFICATION OF STANDARD ASC. | +| xxh FF / | +| ALL CODES NOT SHOWN OR BLANK ARE RESERVED. | ++=============================================================================+ +</verb></tscreen> + +<sect>A SCSI command code quick reference + +<p> +<tscreen><verb> +Table 365 is a numerical order listing of the command operation codes. + + Table 365: SCSI-2 Operation Codes + ++=============================================================================+ +| D - DIRECT ACCESS DEVICE Device Column Key | +| .T - SEQUENTIAL ACCESS DEVICE M = Mandatory | +| . L - PRINTER DEVICE O = Optional | +| . P - PROCESSOR DEVICE V = Vendor Specific| +| . .W - WRITE ONCE READ MULTIPLE DEVICE R = Reserved | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| OP DTLPWRSOMC Description | +|----------+----------+-------------------------------------------------------| +| 00 MMMMMMMMMM TEST UNIT READY | +| 01 M REWIND | +| 01 O V OO OO REZERO UNIT | +| 02 VVVVVV V | +| 03 MMMMMMMMMM REQUEST SENSE | +| 04 O FORMAT | +| 04 M O FORMAT UNIT | +| 05 VMVVVV V READ BLOCK LIMITS | +| 06 VVVVVV V | +| 07 O INITIALIZE ELEMENT STATUS | +| 07 OVV O OV REASSIGN BLOCKS | +| 08 M GET MESSAGE(06) | +| 08 OMV OO OV READ(06) | +| 08 O RECEIVE | +| 09 VVVVVV V | +| 0A M PRINT | +| 0A M SEND MESSAGE(06) | +| 0A M SEND(06) | +| 0A OM O OV WRITE(06) | +| 0B O OO OV SEEK(06) | +| 0B O SLEW AND PRINT | +| 0C VVVVVV V | +| 0D VVVVVV V | +| 0E VVVVVV V | +| 0F VOVVVV V READ REVERSE | +| 10 O O SYNCHRONIZE BUFFER | +| 10 VM VVV WRITE FILEMARKS | +| 11 VMVVVV SPACE | +| 12 MMMMMMMMMM INQUIRY | +| 13 VOVVVV VERIFY(06) | +| 14 VOOVVV RECOVER BUFFERED DATA | +| 15 OMO OOOOOO MODE SELECT(06) | +| 16 M MM MO RESERVE | +| 16 MM M RESERVE UNIT | +| 17 M MM MO RELEASE | +| 17 MM M RELEASE UNIT | +| 18 OOOOOOOO COPY | +| 19 VMVVVV ERASE | +| 1A OMO OOOOOO MODE SENSE(06) | +| 1B O LOAD UNLOAD | +| 1B O SCAN | +| 1B O STOP PRINT | +| 1B O OO O STOP START UNIT | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 365: (continued) ++=============================================================================+ +| D - DIRECT ACCESS DEVICE Device Column Key | +| .T - SEQUENTIAL ACCESS DEVICE M = Mandatory | +| . L - PRINTER DEVICE O = Optional | +| . P - PROCESSOR DEVICE V = Vendor Specific| +| . .W - WRITE ONCE READ MULTIPLE DEVICE R = Reserved | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| OP DTLPWRSOMC Description | +|----------+----------+-------------------------------------------------------| +| 1C OOOOOOOOOO RECEIVE DIAGNOSTIC RESULTS | +| 1D MMMMMMMMMM SEND DIAGNOSTIC | +| 1E OO OO OO PREVENT ALLOW MEDIUM REMOVAL | +| 1F | +| 20 V VV V | +| 21 V VV V | +| 22 V VV V | +| 23 V VV V | +| 24 V VVM SET WINDOW | +| 25 O GET WINDOW | +| 25 M M M READ CAPACITY | +| 25 M READ CD-ROM CAPACITY | +| 26 V VV | +| 27 V VV | +| 28 O GET MESSAGE(10) | +| 28 M MMMM READ(10) | +| 29 V VV O READ GENERATION | +| 2A O SEND MESSAGE(10) | +| 2A O SEND(10) | +| 2A M M M WRITE(10) | +| 2B O LOCATE | +| 2B O POSITION TO ELEMENT | +| 2B O OO O SEEK(10) | +| 2C V O ERASE(10) | +| 2D V O O READ UPDATED BLOCK | +| 2E O O O WRITE AND VERIFY(10) | +| 2F O OO O VERIFY(10) | +| 30 O OO O SEARCH DATA HIGH(10) | +| 31 O OBJECT POSITION | +| 31 O OO O SEARCH DATA EQUAL(10) | +| 32 O OO O SEARCH DATA LOW(10) | +| 33 O OO O SET LIMITS(10) | +| 34 O GET DATA BUFFER STATUS | +| 34 O OO O PRE-FETCH | +| 34 O READ POSITION | +| 35 O OO O SYNCHRONIZE CACHE | +| 36 O OO O LOCK UNLOCK CACHE | +| 37 O O READ DEFECT DATA(10) | +| 38 O O MEDIUM SCAN | +| 39 OOOOOOOO COMPARE | +| 3A OOOOOOOO COPY AND VERIFY | +| 3B OOOOOOOOOO WRITE BUFFER | +| 3C OOOOOOOOOO READ BUFFER | +| 3D O O UPDATE BLOCK | +| 3E O OO O READ LONG | +| 3F O O O WRITE LONG | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 365: (continued) ++=============================================================================+ +| D - DIRECT ACCESS DEVICE Device Column Key | +| .T - SEQUENTIAL ACCESS DEVICE M = Mandatory | +| . L - PRINTER DEVICE O = Optional | +| . P - PROCESSOR DEVICE V = Vendor Specific| +| . .W - WRITE ONCE READ MULTIPLE DEVICE R = Reserved | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| OP DTLPWRSOMC Description | +|----------+----------+-------------------------------------------------------| +| 40 OOOOOOOOOO CHANGE DEFINITION | +| 41 O WRITE SAME | +| 42 O READ SUB-CHANNEL | +| 43 O READ TOC | +| 44 O READ HEADER | +| 45 O PLAY AUDIO(10) | +| 46 | +| 47 O PLAY AUDIO MSF | +| 48 O PLAY AUDIO TRACK INDEX | +| 49 O PLAY TRACK RELATIVE(10) | +| 4A | +| 4B O PAUSE RESUME | +| 4C OOOOOOOOOO LOG SELECT | +| 4D OOOOOOOOOO LOG SENSE | +| 4E | +| 4F | +| 50 | +| 51 | +| 52 | +| 53 | +| 54 | +| 55 OOO OOOOOO MODE SELECT(10) | +| 56 | +| 57 | +| 58 | +| 59 | +| 5A OOO OOOOOO MODE SENSE(10) | +| 5B | +| 5C | +| 5D | +| 5E | +| 5F | ++=============================================================================+ +</verb></tscreen> + +<tscreen><verb> +Table 365: (concluded) ++=============================================================================+ +| D - DIRECT ACCESS DEVICE Device Column Key | +| .T - SEQUENTIAL ACCESS DEVICE M = Mandatory | +| . L - PRINTER DEVICE O = Optional | +| . P - PROCESSOR DEVICE V = Vendor Specific| +| . .W - WRITE ONCE READ MULTIPLE DEVICE R = Reserved | +| . . R - READ ONLY (CD-ROM) DEVICE | +| . . S - SCANNER DEVICE | +| . . .O - OPTICAL MEMORY DEVICE | +| . . . M - MEDIA CHANGER DEVICE | +| . . . C - COMMUNICATION DEVICE | +| . . . . | +| OP DTLPWRSOMC Description | +|----------+----------+-------------------------------------------------------| +| A0 | +| A1 | +| A2 | +| A3 | +| A4 | +| A5 M MOVE MEDIUM | +| A5 O PLAY AUDIO(12) | +| A6 O EXCHANGE MEDIUM | +| A7 | +| A8 O GET MESSAGE(12) | +| A8 OO O READ(12) | +| A9 O PLAY TRACK RELATIVE(12) | +| AA O SEND MESSAGE(12) | +| AA O O WRITE(12) | +| AB | +| AC O ERASE(12) | +| AD | +| AE O O WRITE AND VERIFY(12) | +| AF OO O VERIFY(12) | +| B0 OO O SEARCH DATA HIGH(12) | +| B1 OO O SEARCH DATA EQUAL(12) | +| B2 OO O SEARCH DATA LOW(12) | +| B3 OO O SET LIMITS(12) | +| B4 | +| B5 | +| B5 O REQUEST VOLUME ELEMENT ADDRESS | +| B6 | +| B6 O SEND VOLUME TAG | +| B7 O READ DEFECT DATA(12) | +| B8 | +| B8 O READ ELEMENT STATUS | +| B9 | +| BA | +| BB | +| BC | +| BD | +| BE | +| BF | ++=============================================================================+ +</verb></tscreen> + +<sect>Example programs + +<p> +Here is the C example program, which requests manufacturer/model and +reports if a medium is loaded in the device. +<tscreen><verb> +#define DEVICE "/dev/sgc" +/* Example program to demonstrate the generic SCSI interface */ +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <fcntl.h> +#include <errno.h> +#include <scsi/sg.h> + +#define SCSI_OFF sizeof(struct sg_header) +static unsigned char cmd[SCSI_OFF + 18]; /* SCSI command buffer */ +int fd; /* SCSI device/file descriptor */ + +/* process a complete scsi cmd. Use the generic scsi interface. */ +static int handle_scsi_cmd(unsigned cmd_len, /* command length */ + unsigned in_size, /* input data size */ + unsigned char *i_buff, /* input buffer */ + unsigned out_size, /* output data size */ + unsigned char *o_buff /* output buffer */ + ) +{ + int status = 0; + struct sg_header *sg_hd; + + /* safety checks */ + if (!cmd_len) return -1; /* need a cmd_len != 0 */ + if (!i_buff) return -1; /* need an input buffer != NULL */ +#ifdef SG_BIG_BUFF + if (SCSI_OFF + cmd_len + in_size > SG_BIG_BUFF) return -1; + if (SCSI_OFF + out_size > SG_BIG_BUFF) return -1; +#else + if (SCSI_OFF + cmd_len + in_size > 4096) return -1; + if (SCSI_OFF + out_size > 4096) return -1; +#endif + + if (!o_buff) out_size = 0; + + /* generic scsi device header construction */ + sg_hd = (struct sg_header *) i_buff; + sg_hd->reply_len = SCSI_OFF + out_size; + sg_hd->twelve_byte = cmd_len == 12; + sg_hd->result = 0; +#if 0 + sg_hd->pack_len = SCSI_OFF + cmd_len + in_size; /* not necessary */ + sg_hd->pack_id; /* not used */ + sg_hd->other_flags; /* not used */ +#endif + + /* send command */ + status = write( fd, i_buff, SCSI_OFF + cmd_len + in_size ); + if ( status < 0 || status != SCSI_OFF + cmd_len + in_size || + sg_hd->result ) { + /* some error happened */ + fprintf( stderr, "write(generic) result = 0x%x cmd = 0x%x\n", + sg_hd->result, i_buff[SCSI_OFF] ); + perror(""); + return status; + } + + if (!o_buff) o_buff = i_buff; /* buffer pointer check */ + + /* retrieve result */ + status = read( fd, o_buff, SCSI_OFF + out_size); + if ( status < 0 || status != SCSI_OFF + out_size || sg_hd->result ) { + /* some error happened */ + fprintf( stderr, "read(generic) result = 0x%x cmd = 0x%x\n", + sg_hd->result, o_buff[SCSI_OFF] ); + fprintf( stderr, "read(generic) sense " + "%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\n", + sg_hd->sense_buffer[0], sg_hd->sense_buffer[1], + sg_hd->sense_buffer[2], sg_hd->sense_buffer[3], + sg_hd->sense_buffer[4], sg_hd->sense_buffer[5], + sg_hd->sense_buffer[6], sg_hd->sense_buffer[7], + sg_hd->sense_buffer[8], sg_hd->sense_buffer[9], + sg_hd->sense_buffer[10], sg_hd->sense_buffer[11], + sg_hd->sense_buffer[12], sg_hd->sense_buffer[13], + sg_hd->sense_buffer[14], sg_hd->sense_buffer[15]); + if (status < 0) + perror(""); + } + /* Look if we got what we expected to get */ + if (status == SCSI_OFF + out_size) status = 0; /* got them all */ + + return status; /* 0 means no error */ +} + +#define INQUIRY_CMD 0x12 +#define INQUIRY_CMDLEN 6 +#define INQUIRY_REPLY_LEN 96 +#define INQUIRY_VENDOR 8 /* Offset in reply data to vendor name */ + +/* request vendor brand and model */ +static unsigned char *Inquiry ( void ) +{ + unsigned char Inqbuffer[ SCSI_OFF + INQUIRY_REPLY_LEN ]; + unsigned char cmdblk [ INQUIRY_CMDLEN ] = + { INQUIRY_CMD, /* command */ + 0, /* lun/reserved */ + 0, /* page code */ + 0, /* reserved */ + INQUIRY_REPLY_LEN, /* allocation length */ + 0 };/* reserved/flag/link */ + + memcpy( cmd + SCSI_OFF, cmdblk, sizeof(cmdblk) ); + + /* + * +------------------+ + * | struct sg_header | <- cmd + * +------------------+ + * | copy of cmdblk | <- cmd + SCSI_OFF + * +------------------+ + */ + + if (handle_scsi_cmd(sizeof(cmdblk), 0, cmd, + sizeof(Inqbuffer) - SCSI_OFF, Inqbuffer )) { + fprintf( stderr, "Inquiry failed\n" ); + exit(2); + } + return (Inqbuffer + SCSI_OFF); +} + +#define TESTUNITREADY_CMD 0 +#define TESTUNITREADY_CMDLEN 6 + +#define ADD_SENSECODE 12 +#define ADD_SC_QUALIFIER 13 +#define NO_MEDIA_SC 0x3a +#define NO_MEDIA_SCQ 0x00 +int TestForMedium ( void ) +{ + /* request READY status */ + static unsigned char cmdblk [TESTUNITREADY_CMDLEN] = { + TESTUNITREADY_CMD, /* command */ + 0, /* lun/reserved */ + 0, /* reserved */ + 0, /* reserved */ + 0, /* reserved */ + 0};/* reserved */ + + memcpy( cmd + SCSI_OFF, cmdblk, sizeof(cmdblk) ); + + /* + * +------------------+ + * | struct sg_header | <- cmd + * +------------------+ + * | copy of cmdblk | <- cmd + SCSI_OFF + * +------------------+ + */ + + if (handle_scsi_cmd(sizeof(cmdblk), 0, cmd, + 0, NULL)) { + fprintf (stderr, "Test unit ready failed\n"); + exit(2); + } + + return + *(((struct sg_header*)cmd)->sense_buffer +ADD_SENSECODE) != + NO_MEDIA_SC || + *(((struct sg_header*)cmd)->sense_buffer +ADD_SC_QUALIFIER) != + NO_MEDIA_SCQ; +} + +void main( void ) +{ + fd = open(DEVICE, O_RDWR); + if (fd < 0) { + fprintf( stderr, "Need read/write permissions for "DEVICE".\n" ); + exit(1); + } + + /* print some fields of the Inquiry result */ + printf( "%s\n", Inquiry() + INQUIRY_VENDOR ); + + /* look if medium is loaded */ + if (!TestForMedium()) { + printf("device is unloaded\n"); + } else { + printf("device is loaded\n"); + } +} + + +</verb></tscreen> +</article> diff --git a/LDP/retired/Snort-Statistics-HOWTO.sgml b/LDP/retired/Snort-Statistics-HOWTO.sgml new file mode 100644 index 00000000..19e23100 --- /dev/null +++ b/LDP/retired/Snort-Statistics-HOWTO.sgml @@ -0,0 +1,2798 @@ +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> + +<article> + +<!-- Header --> + + <artheader> + + <!-- title of HOWTO, include the word HOWTO --> + + <title>Snort-Setup for Statistics HOWTO + v1.01, Feb 23, 2002 + + + Sandro + Poppi + +
+ spoppi at gmx.de +
+
+
+ + + + 1.01 + 2002-02-23 + sp + + - added "Setting up Linux for Snort" section + - added mysql option -p + - added some clarifications in mysql section + + + + + 1.0 + 2002-01-01 + sp + + - first release version + - moved to snort version 1.8.3 + - changed RPMS to point to www.snort.org + - added link for my snortd initscript + - added warning about automatic rule update + - added hint to IDSPM + - changed for rule files to /etc/snort to reflect snort.org's RPMS + - as allways: clarified some parts + + + + + 0.05 + 2001-11-14 + sp + + - renamed HOWTO to Snort-Setup for Statistics HOWTO + - added short statistic script which I was inspired by Greg Sarsons + - clarified some parts and corrected some typos + + + + + 0.04 + 2001-09-29 + sp + + - added section "snort internal statistics" suggested from Greg Sarson + - added short statistic script contributed by Greg Sarson but + commented it out to get a more general version + + + + + 0.03 + 2001-09-19 + sp + + - added throttle option to swatch.conf + - changed ACID to version 0.9.6b15 + - added some comments in ACID section + - added MD5 checksum section but commented it out + + + + + 0.02 + 2001-09-16 + sp + + Some clarifications as suggested from Greg Sarsons, thx ;) + + + + + 0.01 + 2001-09-04 + sp + + Initial version + + + + + + + + Overview + + + + This HOWTO describes how to configure Snort version 1.8.3 to be used in + conjunction with the statistical tools ACID (Analysis Console for Intrusion + Databases) and SnortSnarf. It also intends to get some internal statistics + out of snort, e.g. if there are packets dropped. + + + Additionally a description of how to automatically update Max Vision's + rules, some scripts which may be helpful and a demo swatch configuration is + included. + + + + + + + + + + Introduction + + + Snort-Statistics!introduction + + + + This document was written when I created an IDS sensor with Snort and + using some statistic tools in order to help others implementing it. If at + least one out there can be helped it has been worth the work. + + + + Snort is an excellent Network Intrusion Detection System (NIDS) for various + unices. The Snort homepage can be found at http://www.snort.org/. The version + described here is 1.8.3 which was the actual version at the time of writing. + + + + The statistic tools I will describe here are ACID, a database analysis tool + for Snort which can be found at http://www.cert.org/kb/acid/ and + SnortSnarf, a statistic tool for Snort logs downloadable from + + http://www.silicondefense.com/software/snortsnarf/index.htm. + + + + Additional support packages are needed for ACID. These are a PHP4 capable + webserver like apache (http://www.apache.org/), PHPlot used for + creating graphs in PHP (http://www.phplot.com/) and ADODB used + for connecting to databases with PHP (http://php.weblogs.com/ADODB/). + + + + The description also includes which additional software is needed for ACID + and how to configure along with some scripts I use including a changed + version of the snortd initscript and a short chapter about swatch () a log file watcher script written + in perl. I created a swatch RPM which can be found at http://www.lug-burghausen.org/projects/Snort-Statistics/swatch-3.0.2-1.noarch.rpm. + + + + One hint for those interested in maintaining more than one snort sensor: You + might take a look at IDSPM (IDS Policy Manager) at http://www.activeworx.com/ which is + an application to maintain various sensors with different policies along with + merging capabilities for new rules and a lot more. The only "nasty" thing is + that it runs on W2K/XP and is not (yet?) Open Source. + + + + + + Copyright Information + + + This document is copyrighted (c) 2001, 2002 Sandro Poppi and is + distributed under the terms of the Linux Documentation Project + (LDP) license, stated below. + + + + Unless otherwise stated, Linux HOWTO documents are + copyrighted by their respective authors. Linux HOWTO documents may + be reproduced and distributed in whole or in part, in any medium + physical or electronic, as long as this copyright notice is + retained on all copies. Commercial redistribution is allowed and + encouraged; however, the author would like to be notified of any + such distributions. + + + + All translations, derivative works, or aggregate works + incorporating any Linux HOWTO documents must be covered under this + copyright notice. That is, you may not produce a derivative work + from a HOWTO and impose additional restrictions on its + distribution. Exceptions to these rules may be granted under + certain conditions; please contact the Linux HOWTO coordinator at + the address given below. + + + + In short, we wish to promote dissemination of this + information through as many channels as possible. However, we do + wish to retain copyright on the HOWTO documents, and would like to + be notified of any plans to redistribute the HOWTOs. + + + + If you have any questions, please contact + linux-howto at metalab.unc.edu + + + + + + + Disclaimer + + + No liability for the contents of this documents can be accepted. + Use the concepts, examples and other content at your own risk. + As this is a new edition of this document, there may be errors + and inaccuracies, that may of course be damaging to your system. + Proceed with caution, and although this is highly unlikely, + the author(s) do not take any responsibility for that. + + + + All copyrights are held by their respective owners, unless + specifically noted otherwise. Use of a term in this document + should not be regarded as affecting the validity of any trademark + or service mark. + + + + Naming of particular products or brands should not be seen + as endorsements. + + + + You are strongly recommended to take a backup of your system + before major installation and backups at regular intervals. + + + + + + + New Versions + + + Snort Statistics!news on + + + + This is the initial release. + + + + The main site for this HOWTO is +http://www.lug-burghausen.org/projects/Snort-Statistics/. + + + + Mirrors may be found at the Linux + Documentation Project or Snort homepages. + + + + The newest version of this HOWTO will always be made available on + the main website, in a variety of formats: + + + + + + + HTML. + + + + + + + + compressed +postscript (A4). + + + + + + SGML +source. + + + + + + + + + + + Credits + + + Credits go to a variaty of people including + + + + + + + + Martin Roesch roesch at sourcefire.com Author of Snort + + + + + Roman Danyliw roman at danyliw.com Author of ACID + + + + + James Hoagland hoagland at SiliconDefense.com Author of + SnortSnarf + + + + + Stuart Staniford stuart at SiliconDefense.com Author of + SnortSnarf + + + + + Joe McAlerney joey at siliconDefense.com Author of + SnortSnarf + + + + + John Lim jlim at natsoft.com.my Author of ADODB + + + + + Afan Ottenheimer afan at users.sourceforge.net Author of + PHPlot + + + + + Andreas Östling andreaso at it.su.se Author of + arachnids_upd + + + + + Max Vision vision at whitehats.com "Distributor" of + vision.rules and maintainer of http://www.whitehats.com/ + + + + + Greg Sarsons gsarsons at home.com for proof reading and + suggestions + + + + + All the peaople on the snort-users mailinglist, they + helped me and of course they will help YOU >;) + + + + + ... + + + + + + + If I missed someone it was not because of not honoring her or his work! + + + + + + + + Feedback + + + Feedback is most certainly welcome for this document. Without + your submissions and input, this document wouldn't exist. Please + send your additions, comments and criticisms to the following + email address : spoppi at gmx.de. + + + + + + + Translations + + + There are currently no translations available. + + + + + + + + + + + + + Structure + + + Snort-Statistics!structure + + + + This document is supposed to be a step by step guide on how to install and + configure snort version 1.8.3, ACID, a web based frontend for + statistical realtime snort data with the underlying MySQL database and its + support packages PHPlot and ADODB, SnortSnarf, also a statistical tool with a + web frontend for analysing the snort logfile, arachnids_upd for always + getting the actual rules from Max Vision's http://www.whitehats.com/ site, + and a sample swatch configuration I use to check if snort reports errors + which I do not get because snort has stopped. + + + + + + + + + + + Technical Overview + + + Snort-Statistics!technicaloverview + + + + Snort is mainly a so called Network Intrusion Detection System (NIDS), it is + Open Source and available for a variaty of unices as well as Microsoft + Windows (R). + + + + A NIDS cares for a whole network segment in contrast to a host based IDS + which only cares for the host it is running on. + + + + Since NIDS are mostly used in conjunction with firewalls it is vital to not + being vulnerable for attacks itself. Therefor all interfaces used with snort + bound to should be set up without ip addresses. Since this can not be achieved + in every configuration, e.g. if you want to bind snort on an isdn interface + ippp0, it should be considered to use a standalone computer for snort and set + it up as a firewall and router for the dial-up connection too. + + + + For more information on that topic see the + +Firewall-HOWTO or my + +Firewalling+Masquerading+Diald+dynamic IP-HOWTO. + + + + Snort can be used to care for more than one network segment which we will + discuss later. + + + + Snort also can be used as a sniffer to troubleshoot network problems, but + that's not a topic in this document. + + + + ACID, the Analysis Console for Intrusion Databases, is part of the AIR-CERT + project. It makes use of PHPlot, a library for creating nice graphs in PHP, + and ADODB, an abstraction library for combining PHP and various database + systems like MySQL and PostgreSQL. The ACID homepage says: + + + + "The Analysis Console for Intrusion Databases (ACID) is a PHP-based + analysis engine to search and process a database of incidents generated by + security-related software such as IDSes and firewalls." + + + + Max Vision's IDS rules (referred to as vision.rules + because this is the name of the downloadable file) are used to complete the + rules shipped with snort. + + + + arachnids_upd is a small but fine perl script which downloads the actual + vision.rules using wget and optionally deletes + single rules given in an ASCII file. + + + + + + + + + + + Configuration + + + Snort-Statistics!configuration + + + + This chapter describes the various configuration tasks to get snort and the + tools up and running. + + + + Since I am using RedHat linux 7.x all the given pathnames and configuration + options are eventually RedHat specific while there should be no big problem to + transfer it to any other distribution. + + + + Setting up Linux for Snort + + + Instead of doing the work twice I only provide a link to a document + describing the various tasks of compiling/installing MySQL, Apache, ACID + etc. by Jason Lewis: http://www.packetnexus.com/docs/packetnexus/ + + + + Please keep in mind that I'm not the author of either the document or the + scripts mentioned there. I didn't even test the scripts so please don't ask + me about them ;) + + + + + + Configuring Snort + + + You can start installing snort by getting the actual tarball from http://www.snort.org/ + and compile it yourself or try to find precompiled binaries for your + distribution. + + + + For version 1.8.3 you can find precompiled binaries for rpm based linux + distributions, FreeBSD, Solaris and Windows at www.snort.org. + + + + I'm no longer maintaining my own RPMS since work hasn't to be done more than + once. But I will offer you my adjusted snortd.multi + initscript at +http://www.lug-burghausen.org/projects/Snort-Statistics/snortd.multi. + + + + + My old 1.8.1 RPMS with MySQL support (but without PostgreSQL support!) can + still be found at +http://www.lug-burghausen.org/projects/Snort-Statistics/snort-1.8.1-4.i386.rpm. + To create a postgreSQL enabled version, download the Source +RPM, edit the spec file and rebuild the RPM. If you are not familiar + with creating RPMs you should have a look on the +RPM-HOWTO or http://www.rpm.org/ where + Maximum RPM is located, a downloadable book about RPM + along with other good sources about RPM. + + + + /etc/snort/snort.conf + + + After installing the RPM we have to edit + /etc/snort/snort.conf to reflect our needs. Martin + Roesch created the Snort Users Manual which is shipped with the snort + tarball and the RPMS as a PDF version. You should have a look on it to see + which options you would like to use as not all but only the ones needed for + our configuration here will be covered in this document. + + + + Also the example configuration /etc/snort/snort.conf + shipped with the tarball/RPM is a good place to start because of the + detailed remarks. + + + + Snort Variables + + First we define various variables like HOME_NET, EXTERNAL_NET and + DNS_SERVERS to reflect our network topology. Make sure you use the right + addresses or you get weird, or worse, no alarms. + + + + When using snort in a complex environment, let's say one sensor with + multiple interfaces to watch, the definition of HOME_NET and EXTERNAL_NET + may be hard or at least results in a very long list, you can set both + variables to any. You loose some kind of pre-filtering + for the sake of not having to put in dozens of network ranges in a large + internal network. And you minimize the performance impact of having snort + run through a huge list of addresses for each packet. + + + + To get rid of some nasty messages of (false) portscans define the variable + DNS_SERVERS to hold all ip addresses of dns-servers along with other nodes + like network management stations triggering snort's portscan module. This + is an ongoing process. + + + + You also can define your own variables here which you can refer to in your + own rules. This is helpful e.g. if using pass rules to + suite your environment. + + + + Define all other variables to appropriate values or as in the shipped + /etc/snort/snort.conf to $HOME_NET. + + + + + var HOME_NET any + var EXTERNAL_NET any + # DNS_SERVERS holds the addresses of "noisy" computers like DNS or NWM + # to be ignored from portscans + var DNS_SERVERS [1.1.1.1/32,2.2.2.2/32] + var SMTP_SERVERS $HOME_NET + ... + + + + + + Snort Preprocessors + + + Next we have to set up the preprocessors to be used. While the more + preprocessors you use you get more triggers for alarms but for the cost of + performance. So be careful in choosing preprocessors. + + + + You should also have a look on Marty's Snort Users + Manual because some preprocessors are deprecated. For those you + should use the new introduced ones. + + + + The preprocessors minfrag and + stream are depricated in favor of + stream4, and defrag is deprecated + by frag2. + + + + frag2 is the new IP defragmentation processor + introduced in snort v1.8 which should be more memory efficient than + defrag/minfrag. + + + + From the Snort Users Manual: + The stream4 module provides TCP stream reassembly and stateful + analysis capabilities to Snort. Robust stream reassembly capabilities allow + Snort to ignore ''stateless'' attacks such as stick and snot + produce.Stream4 also gives large scale users the ability to track more than + 256 simultaneous TCP streams. Stream4 should be able to scale to handle + 64,000 simultaneous TCP connections. + + + + The stream4 module consists of two preprocessors + called stream4 and + stream4_reassemble, which both have to be used. + + + + There are various options for both preprocessors while we will use only - + for stream4 - detect_scans for + getting alarms for portscan events and + detect_state_problems to be informed when stream + events like evasive RST packets, data on SYN packets and out of window + sequence numbers occur. + + + + With stream4_reassemble we use the option + ports all what makes the reassembly catch all ports + instead of only some predefined ones. To be honest, this is some kind of + paranoic and impacts the cpu utilization of the snort sensor, but since I + didn't get any bad results listening on a Pentium III 800 MHz on three 100 + Mbit/s full duplex lines with average to low utilization I think it's the + better solution. + + + + Two other preprocessors we will use are portscan and + portscan-ignorehosts which are responsible for + portscan detection (portscan) and for which hosts + portscan detection has to be ignored + (portscan-ignorehosts). + + + + For portscan we define to look for every network using + the form 0.0.0.0/0, set the number of port numbers to + be accessed in the also to be defined detection period in seconds. + Additionally we have to provide the complete path to the portscan logfile. + + + + With portscan-ignorehosts we get rid of some weird + alarms from hosts which talk too much and trigger portscan detection like + name servers and network management stations (see variable + DNS_SERVERS above). + + + + Some preprocessors which are not (yet) mentioned in Marty's Users Manual + but we will use are unidecode which is a replacement + of http_decode and normalizes http and UNICODE + attacks, rpc_decode to normalize rpc traffic on a + given port, bo to check for back orifice traffic and + telnet_decode to normalize telnet negotiation strings. + + + + Other preprocessors like SPADE are not yet covered here but may be in a + future version. Contributions are very welcome >;) + + + + After all that theoretical stuff here is the preprocessor part of + /etc/snort/snort.conf: + + + + + preprocessor frag2 + preprocessor stream4: detect_scans detect_state_problems + preprocessor stream4_reassemble: ports all + preprocessor unidecode: 80 8080 + preprocessor rpc_decode: 111 + preprocessor bo: -nobrute + preprocessor telnet_decode + preprocessor portscan: 0.0.0.0/0 6 3 /var/log/snort/portscan.log + preprocessor portscan-ignorehosts: $DNS_SERVERS + + + + + + Snort Output Modules + + The next part is the configuration of the output modules of which we will + use the syslog module alert_syslog to send alerts to + syslog and database to additionally log to a MySQL + database. + + + + The alert_syslog module requires some options for what + has to be logged. If like in my case you are using SnortSnarf to analyse + the logfile you'll have to add the option LOG_PID else + SnortSnarf has problems. + + + + As stated before we will use ACID and thus we need to set up snort to log + to a database. I chose MySQL for no particular reason (well, I've heard more + from MySQL than from postgreSQL but that's all). + + + + The database output module requires the following + parameters: + + + + + + + log | alert + + + Log to the alert facility. Also possible would be + the log facility. If you would like to get + portscan alerts into the database you have to use + alert here. + + + + + + mysql|postgrsql|odbc|oracle|mssql + + This is the type of database. + + + + + user=<username> + + Here you define the username to be used with the database. + + + + + password=<password> + + The required password for the given user. + + + + + dbname=<databasename> + + The name of the database to be used for logging into. + + + + + host=<hostname> + + + Here you define the host on which the database is running. Use + localhost if the database is running on the snort sensor itself. + + + + + + sensor_name=<sensor name> + + + Here you put in a unique name which is used to differentiate + between various sensors if more than one is logging into a single + database. + + + + + + + + + Now let's take a look on the output module part of + /etc/snort/snort.conf: + + + + + output alert_syslog: LOG_AUTH LOG_ALERT LOG_PID + output database: alert, mysql, user=snort password=mypassword dbname=snort host=localhost sensor_name=mysensor + + + + + If you are using more than one physical snort sensor and would log to a + database I would recommend using a central database on a separate machine. + You then can correlate alert data with a single console getting a better + overview when attacks are found. + + + + + Snort Rule Sets + + + The rules are the vital part of snort. There are various categories of + rules shipped with snort. They can be found in + /etc/snort/, ending with + *.rules. The format in version 1.8+ has changed to + reflect the classification types. In addition priority settings of the + classtypes can also be defined. + + + + If you're using the original snort tarball I suggest copying all rule + files and classification.config into it. + + + + The configuration of classification types is done in + /etc/snort/classification.config. Normally you + don't have to touch it since it is preconfigured for the shipped snort + rules. But if you (again like me) are using Max Vision's + vision.rules you'll have to add some lines because + the classtypes are different. Just copy and paste all config + classification: lines from vision.conf to + /etc/snort/classification.config. And remember + to take the vision.rules for snort 1.8 (called + vision18.rules and + vision18.conf on http://www.whitehats.com/) as the + older ones are not prepared for the new format introduced in snort 1.8! + + + + Here's the /etc/snort/classification.config I + used with vision.rules: + + + + + # + # config classification:shortname,short description,priority + # + #config classification: not-suspicious,Not Suspicious Traffic,0 + config classification: unknown,Unknown Traffic,1 + config classification: bad-unknown,Potentially Bad Traffic, 2 + config classification: attempted-recon,Attempted Information Leak,3 + config classification: successful-recon-limited,Information Leak,4 + config classification: successful-recon-largescale,Large Scale Information Leak,5 + config classification: attempted-dos,Attempted Denial of Service,6 + config classification: successful-dos,Denial of Service,7 + config classification: attempted-user,Attempted User Privilege Gain,8 + config classification: unsuccessful-user,Unsuccessful User Privilege Gain,7 + config classification: successful-user,Successful User Privilege Gain,9 + config classification: attempted-admin,Attempted Administrator Privilege Gain,10 + config classification: successful-admin,Successful Administrator Privilege Gain,11 + + # added from vision18.conf + # classification for use with a management interface + # low risk + config classification: not-suspicious,policy traffic that is not suspicious,0 + config classification: suspicious,suspicious miscellaneous traffic,1 + config classification: info-failed,failed information gathering attempt,2 + config classification: relay-failed,failed relay attempt,3 + config classification: data-failed,failed data integrity attempt,4 + config classification: system-failed,failed system integrity attempt,5 + config classification: client-failed,failed client integrity attempt,6 + # med risk + config classification: denialofservice,denial of service,7 + config classification: info-attempt,information gathering attempt,8 + config classification: relay-attempt,relay attempt,9 + config classification: data-attempt,data integrity attempt,10 + config classification: system-attempt,system integrity attempt,11 + config classification: client-attempt,client integrity attempt,12 + config classification: data-or-info-attempt,data integrity or information gathering attempt,13 + config classification: system-or-info-attempt,system integrity or information gathering attempt,14 + config classification: relay-or-info-attempt,relay of information gathering attempt,15 + # high risk + config classification: info-success,successful information gathering attempt,16 + config classification: relay-success,successful relay attempt,17 + config classification: data-success,successful data integrity attempt,18 + config classification: system-success,successful system integrity attempt,19 + config classification: client-success,successful client integrity attempt,20 + + + + + The classification and rule files are included in + /etc/snort/snort.conf. Some rule files used here have + been copied from the CVS, e.g. virus.rules because + they were not shipped with the standard distribution. + + + + As stated before the vision.rules file will be + fetched via the tool arachnids_upd which is discussed + later. + + + + Arachnids_upd changes the name from vision18.rules to + vision.rules but the rules are of course the ones + prepared for snort 1.8+. + + + + Since the variable definitions for INTERNAL and EXTERNAL in + vision.rules are not the same as with the snort rules + I use a script to change these names. Take a look at the + arachnids_upd section below. + + + + + # Include classification & priority settings + include /etc/snort/classification.config + + include /etc/snort/exploit.rules + include /etc/snort/scan.rules + include /etc/snort/finger.rules + include /etc/snort/ftp.rules + include /etc/snort/telnet.rules + include /etc/snort/smtp.rules + include /etc/snort/rpc.rules + include /etc/snort/rservices.rules + include /etc/snort/backdoor.rules + include /etc/snort/dos.rules + include /etc/snort/ddos.rules + include /etc/snort/dns.rules + include /etc/snort/netbios.rules + include /etc/snort/web-cgi.rules + include /etc/snort/web-coldfusion.rules + include /etc/snort/web-frontpage.rules + include /etc/snort/web-iis.rules + include /etc/snort/web-misc.rules + include /etc/snort/sql.rules + include /etc/snort/x11.rules + include /etc/snort/icmp.rules + include /etc/snort/shellcode.rules + include /etc/snort/misc.rules + include /etc/snort/policy.rules + include /etc/snort/info.rules + #include /etc/snort/icmp-info.rules + include /etc/snort/virus.rules + include /etc/snort/local.rules + + # vision.rules will be catched by arachnids_upd + include /etc/snort/vision.rules + + + + + When you are done with setting up + /etc/snort/snort.conf you should start snort by + calling /etc/rc.d/init.d/snortd start and correct any + errors you get in the log file /var/log/messages + (ignore any database related messages since the database has not been set + up at this time, you also may have to document out the output module + database). If everything is ok you can go on with configuring the other + parts. + + + + + + + + /etc/rc.d/init.d/snortd + + + In /etc/rc.d/init.d/snortd you should edit at least the + line with the interface to be "snort'ed". Replace the definition of + INTERFACE="eth0" with the interface you use. This can + be another ethernet (ethx) but also a + pppx or ipppx interface, e.g. if + you are using ISDN your definition should be like + + + + + INTERFACE="ippp0" + + + + + If your snort sensor is only listening on one interface it's sufficient to + use the shipped snortd initscript. But if you have more than one interface + you may be interested in having a look onto the script I extended for + exactly that case. Even when you only have one interface but wish to use + swatch the way I do you could copy the swatch parts to the shipped snortd + script (see the contrib section of the RPM's documentation). + + + + Next you find the mentioned snortd initscript I extended for snort to listen + on more than one interface. One could now say that you can also use + any as an interface name since the underlying + libpcap makes this possible, but that's not what I + intended to use because I'm not interested in "snorting" the local network + where the snort sensor is set up. This should - in a secure environment - be + a separate network segment with additional security set up, e.g. a firewall + for that segment, so sniffing does not make much sense except if you want + to sniff attacks targeted to the snort network itself. Even then, if you use + more than one sensor concentrated in that segment you only need to set up + one but not all of the sensors for protecting the segment. + + + + I added a new function daemonMult derived from RedHat's + daemon function found in + /etc/rc.d/init.d/functions which is capable of starting + a program more than once. I sent RedHat a patch for their + daemon function to introduce a new option + --mult which eventually will be added. If that happens + the daemonMult function will be obsolete and the call + to snort would change from daemonMult ... to + daemon --mult .... Let's wait and see. + + + + I also changed the subsystem name from snort to snortd to get rid of error + messages when rebooting (the killall script on a redhat box depends on the + correct name), just a little typo. + + + + With my script you can now define multiple interfaces to be watched on, + just use a space separated list with the INTERFACE + variable, like in the listing shown below. + + + + Some sanity checks are also included to see if the interface to listen on is + already up and if there is an IP address defined. If there is an IP address + defined the correspondig config which on a RedHat linux box is found in + /etc/sysconfig/network-scripts/ifcfg-<interface + name> will be used, else the interface is set up as IP-less in + promiscuous mode. + + + + THIS HAS NOT YET BEEN TESTED WITH ANYTHING ELSE THAN ETHERNET INTERFACES! I + WILL HOPEFULLY SOON REVIEW IT WITH ISDN INTERFACES AND REPORT HOW THE + DIFFERENCES ARE! + + + + A single snort process is then started on each interface, and also + swatch will be started to check for errors when + restarting snort for rule updates (see the swatch + section below). + + + + When shutting down snort all IP-less interfaces will be shut down but not + any interfaces with existing IP configurations because that could last to + inaccessability if the "snort'ed" interface is vital for the snort sensor + (learned that the hard way >;) + + + + Maybe a better solution would be to check the interface's config file for an + entry like + + + + + ONBOOT=yes + + + + + and only if there is not yes then the interface will be + shut down. But that's not yet implemented. + + + + Now here is the extended snort initscript: + + + + +#!/bin/sh +# +# snortd Start/Stop the snort IDS daemon. +# +# chkconfig: 2345 40 60 +# description: snort is a lightweight network intrusion detection tool that +# currently detects more than 1100 host and network +# vulnerabilities, portscans, backdoors, and more. +# +# June 10, 2000 -- Dave Wreski Dave Wreski <dave at linuxsecurity.com> +# - initial version +# July 08, 2000 Dave Wreski <<dave at guardiandigital.com> +# - added snort user/group +# - support for 1.6.2 +# April 11, 2001 Sandro Poppi <spoppi at gmx.de> +# - added multiple interfaces option for use with dial up lines +# or more than one sniffer interface +# I don't think the libpcap option to use "-i any" is a good choice, +# because snort would be set up to monitor one or more ip-less interfaces +# while leaving the monitor interface "unprotected" +# - changed the subsystem name from snort to snortd to get rid of error messages +# when rebooting (the killall script on a redhat box depends on the correct name) +# - added a function daemonMult derived from the function daemon in /etc/rc.d/init.d/functions +# to allow starting multiple instances of snort with the convenience of the daemon function +# (eventually this could be integrated into the normal daemon function of redhat, have to get +# in touch with the author) +# January 01, 2002 Sandro Poppi <spoppi at gmx.de> +# - added check if swatch is installed +# - added check for interfaces other than ethernet since only those are expected to work with ifconfig +# +# Source function library. +. /etc/rc.d/init.d/functions + +# A function to start a program even more than once +# rewritten version of the daemon function in /etc/rc.d/init.d/functions +daemonMult() { + # Test syntax. + gotbase= + user= + nicelevel=0 + while [ "$1" != "${1##-}" -o "$1" != "${1##+}" ]; do + case $1 in + '') echo '$0: Usage: daemon [+/-nicelevel] {program}' + return 1;; + --check) + shift + base=$1 + gotbase="yes" + shift + ;; + --user) + shift + daemon_user=$1 + shift + ;; + -*|+*) nicelevel=$1 + shift + ;; + *) nicelevel=0 + ;; + esac + done + + # Save basename. + [ -z $gotbase ] && base=`basename $1` + + # make sure it doesn't core dump anywhere; while this could mask + # problems with the daemon, it also closes some security problems + ulimit -S -c 0 >/dev/null 2>&1 + + # Echo daemon + [ "$BOOTUP" = "verbose" ] && echo -n " $base" + + # And start it up. + if [ -z "$daemon_user" ]; then + nice -n $nicelevel initlog $INITLOG_ARGS -c "$*" && success "$base startup" || failure "$base startup" + else + nice -n $nicelevel initlog $INITLOG_ARGS -c "su $daemon_user -c \"$*\"" && success "$base startup" || failure "$base startup" + fi +} + +# Specify your network interface(s) here +INTERFACE="eth1 eth2" + +# See how we were called. +case "$1" in +start) + if [ -x /usr/bin/swatch ] ; then + echo -n "Starting swatch: " + # inserted poppi to make use of swatch + # starting it before snort to get hints on startup errors of snort + # if using the snort option -s use /var/log/secure, + # if using output alert_syslog: in snort.conf use /var/log/messages + /usr/bin/swatch --daemon --tail /var/log/messages --config-file /etc/swatch/swatchrc & + touch /var/lock/subsys/swatch + echo "done." + echo + fi + + # added multiple interfaces option + for i in `echo "$INTERFACE"` ; do + echo -n "Starting snort on interface $i: " + # inserted to implement ip-less sniffer interface for snort at startup + # if the interface is not yet loaded or if the interface isn't up yet + if [ `/sbin/ifconfig $i 2>&1 | /bin/grep -c "Device not found"` = "0" \ + -o `/sbin/ifconfig $i 2>&1 | /bin/grep -c "UP"` = "0" ] ; then + + # check for interfaces other than ethernet! + if [ `echo $i | /bin/grep -c "^eth"` = "1" ] ; then + # check if there is a config for the given interface + # normally this should be omitted for security reasons for a sniffer interface + if [ -s "/etc/sysconfig/network-scripts/ifcfg-$i" ]; then + # use the config + /sbin/ifup $i + else + # ip less sniffer interface + /sbin/ifconfig $i up promisc + fi + fi + fi + # call the rewritten daemon function from above + daemonMult /usr/sbin/snort -u snort -g snort -d -D \ + -i $i -I -l /var/log/snort -c /etc/snort/snort.conf + echo + done + + touch /var/lock/subsys/snortd + + ;; + stop) + echo -n "Stopping snort: " + killproc snort + rm -f /var/lock/subsys/snortd + + # inserted Poppi + if [ -x /usr/bin/swatch ] ; then + echo + echo -n "Stopping swatch: " + kill `ps x|grep "/usr/bin/swatch"|grep -v grep|awk '{ print $1 }'` + rm -f /var/lock/subsys/swatch + fi + + # shutdown interface if and only if it has NO ip address + # and if it is a ethernet interface + # this is done because we don't want to shutdown interfaces still needed + for i in `echo "$INTERFACES"`; do + if [`echo $i | /bin/grep -c "^eth"` = "1" -a \ + `/sbin/ifconfig $i 2>&1 | /bin/grep -c "inet addr:"` = "0" ] ; then + /sbin/ifconfig $i down + fi + done + echo + ;; + restart) + $0 stop + $0 start + ;; + status) + status snort + #status swatch + ;; + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 +esac +exit 0 + + + + + + + /etc/snort/snort-check + + + This shell script is used to generate winpopups via + smbclient or sending emails to given persons. It was + inspired by Bill Richardson's script published on the snort homepage. + + + + The winpopup part may be obsoleted by the smb output + module introduced in snort 1.8 but I haven't tested it yet. + + + + +#!/bin/sh + +# Script to be run from within swatch to send alerts in multiple formats +# inspired from script on www.snort.org by Bill Richardson +# extended to read a file called "hosts" with names of +# workstation to send a winpopup, syntax is the same as with snortd option -M +# Poppi, 02.05.2001 + +# Prerequisites: +# Samba set up correctly +# Change the following variables according to your system (for RedHat 7.x user it should be ok) + +# hostfile holds the name of the file containing the workstation for winpopups +hostfile="/etc/snort/hosts" + +# recipientfile holds the addresses of all recipients in a single file, +# seperated by newline +recipientfile="/etc/snort/recipients" + +# if a recipient file exists +if [ -s "$recipientfile" ] ; then + # generate the recipientlist with email adresses. + for i in `cat $recipientfile` ; do + recipients="$recipients "$i + done + + echo "$*" | mail -s "Snort-Alert!!!" "$recipients" +fi + +# if a hostfile exists, send winpopups +if [ -s "$hostfile" ] ; then + for i in `cat $hostfile` ; do + echo "Snort-Alert! $*" | smbclient -M $i > /dev/null 2>&1 + done +fi + + + + + /etc/snort/hosts + + + In this file you put in all the workstation names of the hosts which + should get the snort message, one per line: + + + + + ws001 + ws002 + ws003 + + + + + + + /etc/snort/recipients + + + In /etc/snort/recipients you put in email addresses + of recipients who wish (or are urged to ;) receive your snort alarms, one + address per line: + + + + + jane@internal.local.com + henk@snort.info + sandro@snort.info + + + + + If any of these two files is omitted then the corresponding feature is + disabled. + + + + + + + + Snort internal Statistics + + + Snort has the ability built in to print out some internal statistics. This + can be achieved using the following command: + + + + + /bin/kill -SIGUSR1 <pid of snort> + + + + + or if you have more than one snort process running on the same machine and + want to get info about all at once: + + + + + /bin/killall -USR1 snort + + + + + With either of these commands you get internal statistics in the following + way in your syslog (/var/log/messages with RedHat): + + + + +Sep 29 07:51:48 ids01 snort[8000]: =============================================================================== +Sep 29 07:51:48 ids01 snort[8000]: Snort analyzed 27316 out of 27316 packets, +Sep 29 07:51:48 ids01 snort[8000]: dropping 0(0.000%) packets +Sep 29 07:51:48 ids01 snort[8000]: Breakdown by protocol: Action Stats: +Sep 29 07:51:48 ids01 snort[8000]: TCP: 27152 (99.400%) ALERTS: 0 +Sep 29 07:51:48 ids01 snort[8000]: UDP: 0 (0.000%) LOGGED: 0 +Sep 29 07:51:48 ids01 snort[8000]: ICMP: 164 (0.600%) PASSED: 0 +Sep 29 07:51:48 ids01 snort[8000]: ARP: 0 (0.000%) +Sep 29 07:51:48 ids01 snort[8000]: IPv6: 0 (0.000%) +Sep 29 07:51:48 ids01 snort[8000]: IPX: 0 (0.000%) +Sep 29 07:51:48 ids01 snort[8000]: OTHER: 0 (0.000%) +Sep 29 07:51:48 ids01 snort[8000]: DISCARD: 0 (0.000%) +Sep 29 07:51:48 ids01 snort[8000]: =============================================================================== +Sep 29 07:51:48 ids01 snort[8000]: Fragmentation Stats: +Sep 29 07:51:48 ids01 snort[8000]: Fragmented IP Packets: 0 (0.000%) +Sep 29 07:51:48 ids01 snort[8000]: Fragment Trackers: 0 +Sep 29 07:51:48 ids01 snort[8000]: Rebuilt IP Packets: 0 +Sep 29 07:51:48 ids01 snort[8000]: Frag elements used: 0 +Sep 29 07:51:48 ids01 snort[8000]: Discarded(incomplete): 0 +Sep 29 07:51:48 ids01 snort[8000]: Discarded(timeout): 0 +Sep 29 07:51:48 ids01 snort[8000]: Frag2 memory faults: 0 +Sep 29 07:51:48 ids01 snort[8000]: =============================================================================== +Sep 29 07:51:48 ids01 snort[8000]: TCP Stream Reassembly Stats: +Sep 29 07:51:48 ids01 snort[8000]: TCP Packets Used: 27152 (99.400%) +Sep 29 07:51:48 ids01 snort[8000]: Stream Trackers: 1 +Sep 29 07:51:48 ids01 snort[8000]: Stream flushes: 0 +Sep 29 07:51:48 ids01 snort[8000]: Segments used: 0 +Sep 29 07:51:48 ids01 snort[8000]: Stream4 Memory Faults: 0 +Sep 29 07:51:48 ids01 snort[8000]: =============================================================================== + + + + + But remember: With versions prior to 1.8.3 you have to restart snort to get + new statistics, so always combine the kill -SIGUSR1 with + a snort restart if not using the actual version! + + + + You first should have a look on the first 2 lines. If snort tells you that + there are dropped packets you have to take a very close look on your + configuration of the snort box itself not only (but including) the snort + configuration. + + + + E.g. stop all unnecessary services which are not vital for the box. And + take a look on the output of the top command. If the + idle counter is very low you should figure out which processes eat up all + of your cpu time and eventually outsource the corresponding program + packets. This is e.g. true when using ACID and the underlying database and + snort on the same machine with less memory and/or cpu. + + + + The other statistical data lines give you an overview of some of the + preprocessors and their work. You should also have a look on the memory + faults sections. If the number is not 0 you should have a look on your + memory usage and eventually configure the preprocessors to use more memory + (take a look to the appropriate section in + /etc/snort/snort.conf). + + + + Now a short script which I was inspired by Greg Sarsons to get snort's + internal statistics, save them to a file and restart snort. + + + + The statistics file will be archived to + /var/log/snort/archive so you have to create that + directory first ;) + + + + +#!/bin/bash +# Script to generate and extract snort statistics from syslog or given file +# generated after kill -USR1 <snort-pid> +# +# This script assumes that the pid is logged into the logfile! +# This can be obtained using the following line in snort.conf: +# output alert_syslog: LOG_AUTH LOG_ALERT LOG_PID +# +# (c) Sandro Poppi 2001 +# Released under GPL + +echo "Starting gathering snort internal statistics. Please be patient..." + +if [ "$1." == "." -o ! -e "$1" ] ; then + # no or unexistent file given, using default + log_file="/var/log/messages" + +else + # when using non-standard logfile location make sure snort uses this logfile + # when sending signal USR1 else this script won't work! + log_file="$1" +fi + +# find out snort pids +snort_pid=`/sbin/pidof snort` + +# get internal statistics for all snort processes +# not using killall to get already sorted output +for i in `echo $snort_pid` ; do + kill -USR1 $i + + # sleep for 2 secs to let snort time to send statistics to syslog ;) + sleep 2 +done + +# immediately restart snort after sending signal USR1 +# this may be ommitted when using CVS version of snort after about 01.11.2001 +# or any version from 1.8.2 or higher +/etc/rc.d/init.d/snortd restart + +for i in `echo $snort_pid` ; do + # process logfile + + filename=/var/log/snort/archive/snort.`date "+%Y-%m-%d"`.$i.log + + # check for existing file and rename it if existing + if [ -e "$filename" ] ; then + mv "$filename" "$filename.bak" + fi + + egrep "snort\[$i\]:" $log_file > "$filename" + + # check if there are dropped packets using lines like + # Oct 22 18:02:06 xbgh17183 snort[573]: dropping 0(0.000%) packets + if [ "`egrep "dropping" $filename | awk -F "[ (]" '{ print $7 }'`" != "0" -a \ + "`egrep -c "dropping" $filename`" != "0" ] ; then + echo "Snort's dropping packets!!! Take a look on the configuration and/or the system's performance!!!" + fi + +done + +echo "Gathering snort internal statistics finished..." + + + + + + + Testing Snort + + + To test snort you should edit /etc/rc.d/init.d/snortd + and make the interface listen on the loopback device + lo. For people with a network card installed you can + use eth0 instead but you have to use a second pc to + run snot because no packet is sent over the interface if snot and snort are + run on the same machine! + + + + Probably the simplest way to test snort is to use snot + which can be found on http://www.sec33.com/sniph/. + + + + You have to have libnet installed for snot. Since on RedHat 7.x there is no + RPM available you could use libnet-1.0.2-6mdk.i586.rpm + from Mandrake Soft, which can be found on http://rpmfind.net/ and of course on + Mandrake's site http://www.mandrake.com/. Most + Mandrake RPMs could be used with no problem on a RedHat system. But be + warned: Mandrake does not provide i386 RPMs so you + can't use them with a processor less than an old Pentium P5. In such a case + you have to get the sources from http://www.packetfactory.net/projects/libnet +and compile it from scratch yourself. + + + + To compile snot you only have to untar the tarball, cd into the snot + directory and call make. If compilation exits without + an error snot is ready to use, if not you are almost always missing some + development packages. + + + + To prepare snot you should first copy + /etc/snort/snort.conf into the snot directory and + cat one or more rule files to the end of the copied + snort.conf using e.g.: + + + + + cat /etc/snort/backdoor.rules >> snort.conf + + + + + Then on one console you should call tail -f + /var/log/messages, while on another you should try to run the + tests. + + + + Snot can then be called the following way assuming you used + lo as the interface name in the snortd initscript: + + + + + ./snot -r snort.conf -d localhost -n 5 + + + + + With that command you tell snot to use the copied + snort.conf, the destination + is localhost and for not triggering too many alerts + restrict it to a maximum of 5. + + + + You'll probably get some messages saying ignoring additional parameters + because snot can not handle yet the new parameters introduced in snort 1.8. + Don't panic, just ignore the messages, snot works fine though. + + + + In /var/log/messages you should now see some snort + alerts, e.g.: + + + + +Sep 10 18:22:33 ids01 snort[1536]: <lo> GateCrasher access: 192.168.213.151:6969 -> 127.0.0.1:3170 +Sep 10 18:22:33 ids01 snort[1536]: <lo> GateCrasher access: 192.168.213.151:6969 -> 127.0.0.1:3170 +Sep 10 18:22:33 ids01 snort[1536]: <lo> GateCrasher access: 192.168.155.231:6969 -> 127.0.0.1:57580 +Sep 10 18:22:33 ids01 snort[1536]: <lo> GateCrasher access: 192.168.155.231:6969 -> 127.0.0.1:57580 +Sep 10 18:22:33 ids01 snort[1536]: <lo> Deep Throat access: 192.168.170.42:2140 -> 127.0.0.1:60521 + + + + + If you get similiar alerts it's ok, if not please take again a look on your + configuration until you get this far. + + + + Now it's time to edit /etc/snort/snort.conf again and + put in the correct value to the INTERFACE variable, + restart snort and get a cup of coffee. You have deserved it! + + + + + + + + Configuring MySQL + + + To allow Snort to send alerts to MySQL you first have to install MySQL. With + most linux distributions there are MySQL packages available so you should + use them. If not you'll probably have to compile and install it from scratch + by downloading the tarball from http://www.mysql.org/. Take a look at + the documentation shipped with MySQL to set it up. + + + + When you have a running MySQL daemon (with RedHat after installing the RPMs + run /etc/rc.d/init.d/mysql start) you have to initialize + a snort database. This is documented in the next section. + + + + Since there should be a password set for each account you'll have to use the + -p option on the mysql commandline. + + + + +[root@ids01 /root]# mysql -u root -p +Reading table information for completion of table and column names +You can turn off this feature to get a quicker startup with -A + +Welcome to the MySQL monitor. Commands end with ; or \g. +Your MySQL connection id is 133 to server version: 3.23.32 + +Type 'help;' or '\h' for help. Type '\c' to clear the buffer + +mysql>create database snort; +Query OK, 1 row affected (0.00 sec) + +mysql> connect snort +Reading table information for completion of table and column names +You can turn off this feature to get a quicker startup with -A + +Connection id: 139 +Current database: snort + +mysql> status +-------------- +mysql Ver 11.12 Distrib 3.23.32, for redhat-linux-gnu (i386) + +Connection id: 139 +Current database: snort +Current user: root@localhost +Current pager: stdout +Using outfile: '' +Server version: 3.23.32 +Protocol version: 10 +Connection: Localhost via UNIX socket +Client characterset: latin1 +Server characterset: latin1 +UNIX socket: /var/lib/mysql/mysql.sock +Uptime: 1 day 2 hours 6 min 21 sec + +Threads: 14 Questions: 4272 Slow queries: 0 Opens: 58 Flush tables: 1 Open tables: 18 Queries per second avg: 0.045 +-------------- + +mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on snort.* to snort@localhost; +Query OK, 0 rows affected (0.00 sec) + +mysql> flush privileges; +Query OK, 0 rows affected (0.00 sec) + +mysql> exit +Bye + + + + + To generate the required table structure of the database use the + create_mysql script which can be found in the contrib + section of the original tarball or my RPM. + + + + + [root@ids01 /root]# mysql -u root -p snort < ./contrib/create_mysql + + + + + You'll have to add a userid/password pair for the database, remember to + change xxxx to a password suitable for your + environment! + + + + +[root@ids01 /root]# mysql -u root -p mysql +Reading table information for completion of table and column names +You can turn off this feature to get a quicker startup with -A + +Welcome to the MySQL monitor. Commands end with ; or \g. +Your MySQL connection id is 148 to server version: 3.23.32 + +Type 'help;' or '\h' for help. Type '\c' to clear the buffer + +mysql> insert into user (User,Password) values('snort',PASSWORD('xxxx')); +Query OK, 1 row affected (0.00 sec) + +mysql> exit +Bye + + + + + Now add some extra tables for your convenience shipped in the contrib + section of the snort tarball and my RPM using the command + + + + + zcat snortdb-extra.gz | mysql -u root -p snort + + + + + If you wish to use the archiving feature of ACID you'll have to create + another database snort_archive (or any other name you + prefer) exactly the same way as you defined the snort + database. + + + + From now on the database is ready to be used for logging with the database + output module of snort which you could now activate in + /etc/snort/snort.conf. + + + + + + Configuring ADODB + + + ADODB is a required part for ACID. It delivers database connection support + for PHP based programs like ACID. + + + + Install ADODB in a directory available for your webserver. On a RedHat box + this usually is /var/www/html/adodb/. + + + + In ADODB version 1.31 there is a bug in adodb.inc.php + which may still exist in newer versions. You'll have to change the path in + line 40 to reflect your local requirements. It's vital to delete the command + dirname() completely so that it looks like this: + + + + + if (!defined('_ADODB_LAYER')) { + define('_ADODB_LAYER',1); + + define('ADODB_FETCH_DEFAULT',0); + define('ADODB_FETCH_NUM',1); + define('ADODB_FETCH_ASSOC',2); + define('ADODB_FETCH_BOTH',3); + + GLOBAL + $ADODB_vers, // database version + $ADODB_Database, // last database driver used + $ADODB_COUNTRECS, // count number of records returned - slows down query + $ADODB_CACHE_DIR, // directory to cache recordsets + $ADODB_FETCH_MODE; // DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default... + + $ADODB_FETCH_MODE = ADODB_FETCH_DEFAULT; + /** + * SET THE VALUE BELOW TO THE DIRECTORY WHERE THIS FILE RESIDES + * ADODB_RootPath has been renamed ADODB_DIR + */ + if (!defined('ADODB_DIR')) define('ADODB_DIR','/var/www/html/adodb'); + + + + + + That's all what has to be done with ADODB. + + + + + + Configuring PHPlot + + + After downloading PHPlot just tar the package into a directory visible for + your webserver. On a RedHat box this usually is + /var/www/html/phplot/. Nothing to configure here. + + + + + Configuring ACID + + + As stated before ACID needs a couple of additional programs installed to + work correctly. While a database system like MySQL version 3.23+, a + webserver with PHP 4.0.2+ support like apache with the + PHP module mod_php and ADODB version 0.93+ are + required, the graphics library gd version 1.8+ and + PHPlot version 4.4.6+ are optional but recommended. Since + apache, the PHP module and + gd are almost always included and installed with any + linux distribution they are not covered in this document. + + + + For snort 1.8+ you'll need at least ACID 0.9.6b13. ACID is shipped with my + RPM in the contrib section but may be an outdated version since ACID is + developed rapidly. So you should always have a look at ACID's homepage if a + newer version exists. + + + + Install ACID into a directory visible to your webserver like + /var/www/html/acid/. + + + + In /var/www/html/acid/acid_conf.php you'll have to edit + some variables to suit your environment. + + + + First of all define the database type in the variable + DBtype. Next define all alert_* + and archive_* variables. + + + + In ChartLib_path you define the path to PHPlot, in our + case /var/www.html/phplot. + + + + The last variable you have to define is portscan_file + where you put in the complete path and filename of snort's portscan logfile. + + + + All other variables should be sufficient for now. You can edit them to suit + your needs. + + + + Here's the config I use: + + + + +<?php + +$ACID_VERSION = "0.9.6b15"; + +/* Path to the DB abstraction library + * (Note: DO NOT include a trailing backslash after the directory) + * e.g. $foo = "/tmp" [OK] + * $foo = "/tmp/" [OK] + * $foo = "c:\tmp" [OK] + * $foo = "c:\tmp\" [WRONG] + */ +$DBlib_path = "/var/www/html/adodb"; + +/* The type of underlying alert database + * + * MySQL : "mysql" + * PostgresSQL : "postgres" + */ +$DBtype = "mysql"; + +/* Alert DB connection parameters + * - $alert_dbname : MySQL database name of Snort alert DB + * - $alert_host : host on which the DB is stored + * - $alert_port : port on which to access the DB + * - $alert_user : login to the database with this user + * - $alert_password : password of the DB user + * + * This information can be gleaned from the Snort database + * output plugin configuration. + */ +$alert_dbname = "snort"; +$alert_host = "localhost"; +$alert_port = ""; +$alert_user = "snort"; +$alert_password = "xxxx"; + +/* Archive DB connection parameters */ +$archive_dbname = "snort_archive"; +$archive_host = "localhost"; +$archive_port = ""; +$archive_user = "snort"; +$archive_password = "xxxx"; + +/* Type of DB connection to use + * 1 : use a persistant connection (pconnect) + * 2 : use a normal connection (connect) + */ +$db_connect_method = 1; + +/* Path to the graphing library + * (Note: DO NOT include a trailing backslash after the directory) + */ +$ChartLib_path = "/var/www/html/phplot"; + +/* File format of charts ('png', 'jpeg', 'gif') */ +$chart_file_format = "png"; + +/* Chart default colors - (red, green, blue) + * - $chart_bg_color_default : background color of chart + * - $chart_lgrid_color_default : gridline color of chart + * - $chart_bar_color_default : bar/line color of chart + */ +$chart_bg_color_default = array(255,255,255); +$chart_lgrid_color_default = array(205,205,205); +$chart_bar_color_default = array(190, 5, 5); + +/* Maximum number of rows per criteria element */ +$MAX_ROWS = 20; + +/* Number of rows to display for any query results */ +$show_rows = 50; + +/* Number of items to return during a snapshot + * Last _X_ # of alerts/unique alerts/ports/IP + */ +$last_num_alerts = 15; +$last_num_ualerts = 15; +$last_num_uports = 15; +$last_num_uaddr = 15; + +/* Number of items to return during a snapshot + * Most Frequent unique alerts/IPs/ports + */ +$freq_num_alerts = 5; +$freq_num_uaddr = 15; +$freq_num_uports = 15; + +/* Number of scroll buttons to use when displaying query results */ +$max_scroll_buttons = 12; + +/* Debug mode - how much debugging information should be shown + * Timing mode - display timing information + * SQL trace mode - log SQL statements + * 0 : no extra information + * 1 : debugging information + * 2 : extended debugging information + * + * HTML no cache - whether a no-cache directive should be sent + * to the browser (should be = 1 for IE) + * + * SQL trace file - file to log SQL traces + */ +$debug_mode = 0; +$debug_time_mode = 1; +$html_no_cache = 1; +$sql_trace_mode = 0; +$sql_trace_file = ""; + +/* Auto-Screen refresh + * - Refresh_Stat_Page - Should certain statistics pages refresh? + * - Stat_Page_Refresh_Time - refresh interval (in seconds) + */ +$refresh_stat_page = 1; +$stat_page_refresh_time = 180; + +/* Display First/Previous/Last timestamps for alerts or + * just First/Last on the Unique Alert listing. + * 1: yes + * 0: no + */ +$show_previous_alert = 1; + +/* Sets maximum execution time (in seconds) of any particular page. + * Note: this overrides the PHP configuration file variable + * max_execution_time. Thus script can run for a total of + * ($max_script_runtime + max_execution_time) seconds + */ +$max_script_runtime = 180; + +/* How should the IP address criteria be entered in the Search screen? + * 1 : each octet is a separate field + * 2 : entire address is as a single field + */ +$ip_address_input = 2; + +/* Resolve IP to FQDN (on certain queries?) + * 1 : yes + * 0 : no + */ +$resolve_IP = 0; + +/* Should summary stats be calculated on every Query Results page + * (Enabling this option will slow page loading time) + */ +$show_summary_stats = 1; + +/* DNS cache lifetime (in minutes) */ +$dns_cache_lifetime = 20160; + +/* Whois information cache lifetime (in minutes) */ +$whois_cache_lifetime = 40320; + +/* Snort spp_portscan log file */ +$portscan_file = "/var/log/snort/portscan.log"; + +/* Event cache Auto-update + * + * Should the event cache be verified and updated on every + * page log? Otherwise, the cache will have to be explicitly + * updated from the 'cache and status' page. + * + * Note: enabling this option could substantially slow down + * the page loading time when there are many uncached alerts. + * However, this is only a one-time penalty. + * + * 1 : yes + * 0 : no + */ +$event_cache_auto_update = 1; + +/* Link to external Whois query */ +$external_whois_link = "http://www.samspade.org/t/ipwhois?a="; + +?> + + + + + You wonder why I use xxxx as password? Well, do you + like your password to be available for everyone in the world? j/k >8) + + + + When first calling ACID via your browser you'll get a hint that you have to + install ACID support in the chosen database. Click on + Setup and ACID should create the required entries in + the database. If everything is set up correctly you'll get all informations + which are currently in the database, normally nothing at this time ;) + + + + Try to trigger some snort rules with snot (see section + above) or e.g. nmap (see http://www.nmap.org/, a portscanner with + many more capabilities) or nessus (see http://www.nessus.org/, a security + scanner to find vulnerabilities of a system). + + + + Now you should get all alarms right the time they happen with ACID. + + + + + + Configuring SnortSnarf + + + SnortSnarf is another tool which analyses snort's logfile instead of a + database. + + + + Install SnortSnarf by taring it into a directory you like, I use + /opt/SnortSnarf/. + + + + Copy /opt/SnortSnarf/Time-modules/lib/Time to + /opt/SnortSnarf/include/SnortSnarf/Time to make the + required perl modules available for SnortSnarf . + + + + Copy the following files to the webserver's cgi-bin + directory (e.g. /var/www.cgi-bin/): + + + + + /opt/SnortSnarf/cgi/* + /opt/SnortSnarf/include/ann_xml.pl + /opt/SnortSnarf/include/web_utils.pl + /opt/SnortSnarf/include/xml_help.pl + + + + + If you would like to use the annotation feature with which you can create + notes to an incident in SnortSnarf you first have to create the directory + /var/www/html/SnortSnarf/annotations, copy + /opt/SnortSnarf/new-annotation-base.xml to + /var/www/html/SnortSnarf/annotations and call + + + ./setup_anns_dir.pl -g apache /var/www/html/SnortSnarf/annotations + + + in /opt/SnortSnarf/utilities. + + + + Check the rights in + /var/www/html/SnortSnarf/annotations and make them look + like this: + + + + +[root@ids01 SnortSnarf]# ll -a /var/www/html/SnortSnarf/annotations/ +total 16 +drwxrwx--- 2 root apache 4096 May 23 14:31 . +drwxr-xr-x 8 root root 4096 May 23 14:17 .. +-rw-r--r-- 1 apache apache 478 May 23 14:31 new-annotation-base.xml + + + + + I created a wrapper script called + /opt/SnortSnarf/snortsnarf.sh to get rid of the nasty + @INC errors (someone with better perl know-how could give me a hint how to + get rid of the errors, thx). I'm calling + /opt/SnortSnarf/snortsnarf.sh via cron every hour from + 6 am to 6 pm. + + + + My crontab enrty looks like this: + + + + +# generate SnortSnarf statistics every hour from 6am to 6pm +0 6,7,8,9,10,11,12,13,14,15,16,17,18 * * * /opt/SnortSnarf/snortsnarf.sh + + + + + SnortSnarf is called to analyse five logfiles + /var/log/messages*, put the generated HTML files into + /var/www/html/SnortSnarf and make use of the annotation + feature which is described above. + + + + Here's the /opt/SnortSnarf/snortsnarf.sh listing: + + + + +#!/bin/sh +# wrapper for use with crontab to get rid of the @INC problem +# Poppi, 22.05.2001 +cd /opt/SnortSnarf +./snortsnarf.pl -d /var/www/html/SnortSnarf -db /var/www/html/SnortSnarf/annotations/new-annotation-base.xml -dns -rulesfile /etc/snort/snort.conf -ldir "file://var/log/snort/" /var/log/messages /var/log/messages.1 /var/log/messages.2 /var/log/messages.3 /var/log/messages.4 + + + + + Test SnortSnarf by calling snortsnarf.sh and take a + look with your browser to /var/www/html/SnortSnarf/. + + + + + + Configuring Arachnids_upd + + + Be warned: Automatic updating the rules without any encryption or + athentication can create backdoors because the rules could be compromised to + allow an attacker to be hidden from your IDS! So use that with care! + + + + Another issue is that www.whitehats.com is often offline so no rules can be + downloaded. + + + + Untar the arachnids_upd package to a directory of your choice, I choose + /opt/arachnids_upd/. + + + + For snort 1.8+ you'll have to edit + /opt/arachnids_upd/arachnids_upd.pl and change the + filename of the file to download to: + + + + + my $url = "http://www.whitehats.com/ids/vision18.rules.gz"; # Default URL. + + + + + Since Arachnids_upd makes use of wget it should be + installed on your system and configured to work with your internet + connection. + + + + An example version of ~.wgetrc is shown here for connecting via a proxy + server with user authentication: + + + + + proxy_user = user + proxy_passwd = xxxx + http_proxy = <proxy>:<port> + ftp_proxy = <proxy>:<port> + use_proxy = on + + + + + Replace <proxy> with the name or ip address of your proxy and + <port> with the port number the proxy uses. If you don't use a proxy + you don't need any of these entries. + + + + Again I created a shell script to get new rules, change the variable names + of vision.rules to suite the definition in + /etc/snort/snort.conf and restart snort for the new + rules to take effect. + + + + +#!/bin/sh +# Script to generate the correct updates of vision.rules using arachnids_upd.pl +# Poppi 22.05.2001 + +# get new rules (requires ~/.wgetrc to be set up to access internet) +/opt/arachnids_upd/arachnids_upd.pl -o /opt/arachnids_upd/vision.rules -b /opt/arachnids_upd/rules.backup/ -c + +# change the variable names according to the ones used in /etc/snort/snort.conf and copy the new file to the right place +cat /opt/arachnids_upd/vision.rules | sed s/EXTERNAL/EXTERNAL_NET/g | sed s/INTERNAL/HOME_NET/g > /etc/snort/vision.rules + +# restart snort for the rules to take effect +/etc/rc.d/init.d/snortd restart + + + + + As arachnids_upd is also capable of deleting rules in + vision.rules while downloading you can if you like + edit /opt/arachnids_upd/arachnids.ignore and put in the + IDS numbers which should be ignored. + + + + + # Put the IDS numbers of the rules that should be disabled in here. + # One number per line. + + # Examples: + + 1 # Ignore IDS1 + 2 # Ignore IDS2 + 3 # Ignore ISD3 + + # I think you get it now :) + + + + + + + Configuring Swatch + + + Swatch is an excellent package to take care for any logfile. It can be + configured using regular expressions to alert if anything bad is logged in + the logfile. + + + + Swatch requires the following perl modules to be installed: + + + + + perl-TimeDate + perl-Date-Calc + perl-Time-HiRes + perl-File-Tail + + + + + Swatch is available as an RPM from http://www.lug-burghausen.org/projects/Snort-Statistics/swatch-3.0.2-1.noarch.rpm + along with the source RPM I created http://www.lug-burghausen.org/projects/Snort-Statistics/swatch-3.0.2-1.src.rpm. + + + + Swatch is configured via a single config file + /etc/swatch/swatch.conf. + + + + I'm shipping it with a demo swatch.conf containing two + rules for snort messages and snort errors shown below along with some other + examples from the original swatch package. + + + + +# global swatch.conf file +# * Poppi, 30.04.2001 +# - initial version +# +# * Poppi, 08.06.2001 +# - added error support; make sure to start swatch BEFORE snort ;) +# +# Poppi, 19.09.2001 +# - added throttle for not getting too much alarms of the same incident + +# normal snort messages (with PID) +# get rid of double alerts for 10 secs, e.g. pings +watchfor /snort\[/ + bell + exec /etc/snort/snort-check $0 + throttle 00:00:10 + +# snort error messages could be with or without the [!] indicator +watchfor /snort: (\[\!\])* ERROR/ + bell + exec /etc/snort/snort-check $0 + + + + + The first rule is for getting all alerts generated via the output module + alert_syslog, the second for getting any error messages + snort generates at startup if anything went wrong (like errors in a rule + file). + + + + Both rules do ring the pc bell (well, if the sensor is used in a room + without operators in sight this does not make much sense ;) and make use of + the snort-check script described before to alert the + given persons. In $0 swatch gives you the complete line + of the logfile entry which triggered swatch. + + + + Swatch has to be started prior to snort. Instead of generating an own swatch + initscript with the correct chkconfig dates I chose to + include it in /etc/rc.d/init.d/snortd because the + dependencies of my use of swatch are such that I - again for me - decided to + do that. I know that's not the "fine english way", and the swatch part can + be put into an own initscript relatively easy. Maybe I will change this in + the future. + + + + + + + + + + + + + Security Issues + + + Snort Statistics!security issues + + + + Snort is running under an own userid/group pair + snort/snort. This should make sure that any buffer + overflow not yet fixed (if any) only gets the rights the snort user has. For + people for whom this is not enough you might use a changeroot'ed environment + using snort's command line option -t. But please don't + ask me how to create it, I've never done it and maybe will not do it anytime. + + + + As with all security related systems don't allow more services as needed. If + you do a standard installation of any linux distribution take a look into + /etc/inetd.conf if your distribution is still using the + older inetd or /etc/xinetd.d/* on an + xinetd based system and disable all services + not really vital for your system. E.g. you don't want to use telnet, replace + it with ssh. + + + + Also take a look at the initscripts, on a Sytem V based system like RedHat + found in /etc/rc.d/init.d/*. If there are any services + like nfs and portmap which you + don't use on such a system delete the corresponding packages completely. + + + + And you should read a lot of security related papers and HOWTOs, like the + Security-HOWTO, the System Administrators + Guide or Network Administrator guide. + + + + Or take a look on various security related websites like http://www.securityfocus.com/, + http://www.linuxsecurity.org/ or + http://www.insecure.org/ + + + + + + + + + + + Getting Help + + + Snort-Statistics!assistance, obtaining + + + + In the end you might find yourself unable to solve your problems + and need help from someone else. The most efficient way is either + to ask someone local or in your nearest Linux user group, search + the web for the nearest one. + + + + But first of all try a look on http://www.snort.org/ and the snort + mailinglists. The people out there helped me very much. + + + + Another possibility is to ask on Usenet News in one of the many, + many newsgroups available. The problem is that these have such a + high volume and noise (called low signal-to-noise ratio) that your + question can easily fall through unanswered. + + + + No matter where you ask it is important to ask well or you will + not be taken seriously. Saying just snort + does not work is not going to help you and instead the + noise level is increased even further and if you are lucky someone + will ask you to clarify. + + + + Instead describe your problems in some detail that will enable + people to help you. The problem could lie somewhere you did not + expect. Therefore you are advised to list the following information + about your system: + + + + + + + Software + + + + + + /etc/snort/snort.conf + + + + /etc/swatch/swatch.conf if used + + + + + excerpt of /var/log/messages, but only filter the relevant + entries + + + + + + used Linux distribution or operating system and version + + + + + + Software that shows the error (with version number + or date) + + + + + + + + + + + + + + And you can ask me directly. But please remember: I'm having a live beyond + computers and my spare time is rare. I will almost always answer my emails + but this can take some times. Also I'm subscribed to the snort-users + mailinglist too so you reach me this way too. + + + + + + + + + + + + Questions and Answers + + + Snort-Statistics!FAQ + + + Snort-Statistics!frequently asked questions + + + + This is just a collection of what I believe are the most common + questions people might have. Give me more feedback and I will turn + this section into a proper FAQ. + + + + + This part needs tweeking. As questions and answers arrive I will put them in + here. Contributions are welcome. For this time always take a look on hte FAQ + section on http://www.snort.org/. + + + + + + + + Q: + + + + A: + + + + + + + + + + +
+ + + + diff --git a/LDP/retired/Term-Firewall.sgml b/LDP/retired/Term-Firewall.sgml new file mode 100644 index 00000000..699df502 --- /dev/null +++ b/LDP/retired/Term-Firewall.sgml @@ -0,0 +1,417 @@ + + +
+ + Using Term to Pierce an Internet Firewall mini-HOWTO + + 1996Barak Pearlmutter + 2001David C. Merrill + + + Barak + Pearlmutter + +
bap@cs.unm.edu
+
+
+ + + David + C. + Merrill + +
david -AT- lupercalia.net
+
+
+ + + + 1.1 + 2001-07-14 + dcm + + Cleaned up a bit, reorganized a bit, converted to DocBook SGML + and relicensed under GFDL. + + + + 1.0 + 1996-07-15 + pb + Initial Release. + + + + + + This document explains how to use the term program + to pierce a firewall from the inside, even without root privileges. + + + + Term is an old program that almost no one uses anymore, + because the 7-bit serial lines it is meant to cross are nowhere + to be found anymore, and full IP ppp access is dirt cheap. + + + + + + Archived Document Notice: + This document has been archived by the LDP because it does not apply + to modern Linux systems. It is no longer being actively maintained. + + + + + + +
+ + +Preface + + + Disclaimer + + + While every precaution has been taken in the preparation of this document, + the Linux Documentation Project and the author(s) assume no responsibility + for errors or omissions, or for damages resulting from the use of the + information contained herein. + + + + + License + + + This document is made available under the terms of the + GNU Free Documentation License (GFDL), + which is hereby incorporated by reference. + + + + + + + +Introduction + + +The term program is usually used to provide host-to-host services +over a modem or serial line. + +However, sometimes it is useful to establish a term +connection between two machines that communicate via telnet. +The most +interesting example is connecting two hosts which are +separated by ethernet firewalls or SOCKS servers. Such firewalls +provide facilities for establishing a telnet connection through the +firewall, typically by using the SOCKS protocol, to allow inside +machines to get connections out, and requiring outside users to telnet +first to a gateway machine which requires a one-time password. These +firewalls make it impossible to, for instance, have X clients on an +inside machine communicate with an X server on an outside machine. +But, by setting up a term connection, these restrictions can all be +bypassed quite conveniently, at the user level. + + + + + +The Basic Procedure + + +Setting up a term connection over a telnet substrate is a two-phase +process. First your usual telnet client is used to set up a telnet +connection and log in. Next, the telnet client is paused and control +of the established telnet connection is given to term. + + + + + +Detailed Directions + + +First, from a machine inside the firewall, telnet to a target machine +outside the firewall and log in. + + + +Unless you are under linux and will be using the proc filesystem (see +below) make sure your shell is an sh style shell. Ie if your default +shell is a csh variant, invoke telnet by: + + +setenv SHELL /bin/sh; telnet machine.outside + + +After logging in, on the remote (outside) machine invoke the command: + + +term -r -n off telnet + + +Now break back to the telnet prompt on the local (inside) machine, +using ^] or whatever, and use the telnet shell escape command +! to invoke term: + + +telnet> ! term -n on telnet >&3 <&3 + + +That's it! + + + +If you have a variant telnet, you might have to use some other file +descriptor than 3; easy to check using strace. But three seems to +work on all bsd descendent telnet clients I've tried, under both SunOS +4.x and the usual linux distributions. + + + +Some telnet clients do not have the ! shell escape command. Eg the +telnet client distributed with Slackware 3.0 is one such client. The +sources that the Slackware telnet client is supposedly built from + + + + +ftp://ftp.cdrom.com:/pub/linux/slackware-3.0/source/n/tcpip/NetKit-B-0.05.tar.gz + + + +A simple solution is therefore to +obtain these sources and recompile them. This unfortunately is a task +I have had no luck with. Plus, if you are running from inside a SOCKS +firewall, you will need a SOCKSified telnet client anyway. To that +end, I was able to compile a SOCKSified telnet client from: + + + +ftp://ftp.nec.com/pub/security/socks.cstc/socks.cstc.4.2.tar.gz + + + +or, if you're outside the USA, + + + +ftp://ftp.nec.com/pub/security/socks.cstc/export.socks.cstc.4.2.tar.gz + + + +Alternatively, under linux kernels up to 1.2.13, you can pause the +telnet with ^]^z, figure out its pid, and invoke: + + +term -n on -v /proc/&,t;telnetpid>/fd/3 telnet + + +This doesn't work with kernels after 1.3.x, which closed some +mysterious security hole by preventing access to these fd's by +processes other than the owner process and its children. + + + + + +Multiple Term Sockets + + +It is a good idea to give the term socket an explicit name. +This is the telnet; argument in the invocations +of term above. +Unless you have the TERMSERVER environment variable set to telnet as +appropriate, you invoke term clients with the -t switch, +e.g., trsh -t telnet. + + + + + +The <<filename>˜/.term/termrc.telnet</filename> Init File + + +I have checked line clarity using linecheck over this medium. +I expected it to be completely transparent, but it is not. +However, the only bad character seems to be 255. +The ˜/.term/termrc.telnet I use +(the .telnet is the name of the term connection, see above) +contains: + + +baudrate off +escape 255 +ignore 255 +timeout 600 + + +Perhaps it could be improved by diddling, +I am getting a throughput of only about 30k cps over +a long-haul connection through a slow firewall. +Ftp can move about 100k cps over the same route. +A realistic baudrate might avoid some timeouts. + + + + + +Direction + + +Obviously, if you are starting from outside the firewall and zitching +in using a SecureID card or something, you will want to reverse the +roles of the remote vs local servers given above. (If you don't +understand what this means, perhaps you are not familiar enough with +term to use the trick described in this file responsibly.) + + + + + +Security + + +This is not much more of a vulnerability than the current possibility +of having a telnet connection hijacked on an unsecured outside +machine. The primary additional risk comes from people being able to +use the term socket you set up without you even being aware of it. So +be careful out there. (Personally, I do this with an outside machine +I know to be pretty secure, namely a linux laptop I maintain myself +that does not accept any incoming connections.) + + + +Another possibility is to add + + + +socket off + + + +to the remote ˜/.term/termrc.telnet file, or + + + +add "-u off" + + + +to the invocation of term. +This prevents the socket from being hijacked from the remote end, +with only a minor loss of functionality. + + + + + +Telnet Mode + + +Be sure the remote telnetd is not in some nasty seven-bit mode. +Or if it is, you have to tell term about it when you invoke term, +by adding the -a switch at both ends. +(I sometimes use >^] telnet> set outbin or +set bin, or invoke telnet with a -8 switch +to put the connection into eight-bit mode.) + + + + + +Bugs and Term Wish List + + +The linecheck program has some problems checking telnet connections +sometimes. This is sometimes because it doesn't check the return code +of the read() call it makes. For network connections, +this call to read() can return -1 +with an EINTR (interrupted) or +EAGAIN (try again) error code. +Obviously this should be checked for. + + + +There are a number of features that could ease the use of term over +telnet. These primarily relate to an assumption that influenced the +design of term, namely that the connection is low bandwidth, low +latency, and somewhat noisy. + + + +A telnet connection is in general high bandwidth, high latency, and +error free. This means that the connection could be better utilized +if (a) the maximum window size was raised, well above the limit +imposed by term's N_PACKETS/2=16, +(b) there was an option to turn off sending and checking packet checksums, +and (c) larger packets were permitted when appropriate. + + + +Also, to enhance security, it would be nice to have a term option to +log all connections through the socket it monitors to a log file, or +to stderr, or both. This would allow one to see if one's term +connection is being subverted by nasty hackers on the outside insecure +machine. + + + + + +Tricks That Do Not Seem to Work + + +Some telnet clients and servers agree to encrypt their communications, +to prevent eavesdropping on the connection. Unfortunately, the hack +used above (using the network connection that the telnet client has +set up while the telnet client is idle) won't work in that case. +Instead, one really must go through the telnet client itself, so it +can do its encryption. It seems like that requires a simple hack to +the telnet client itself, to add a command that runs a process with +its stdin and stdout are connected +to the live telnet connection. +This would also be useful for various bots, so perhaps someone has +already hacked it up. + + + + + +Related Resources + + +A vaguely related trick is to SOCKSify one's Term library. +Details, including patches to SOCKS, are available from +Steven Danz danz@wv.mentorg.com. + + + + + +Acknowledgments + + +Thanks for valuable suggestions from: + + + + + Gary Flake flake@scr.siemens.com + + + Bill Riemers bcr@physics.purdue.edu + + + Greg Louis glouis@dynamicro.on.ca + + + + + +
+ diff --git a/LDP/retired/USB-Digital-Camera-HOWTO.xml b/LDP/retired/USB-Digital-Camera-HOWTO.xml new file mode 100644 index 00000000..be567fc8 --- /dev/null +++ b/LDP/retired/USB-Digital-Camera-HOWTO.xml @@ -0,0 +1,1011 @@ + + + + + +USB Digital Camera HOWTO + + DaveKelly +
daveekelly@earthlink.net
+
+
+April 2002 + + + + 2.0 + 2002-06-02 + tab + Converted to Docbook XML 4.1.2 + + + 1.0 + 2002-04-13 + dek + Initial release + + + + +
+ + + + +License + + +Copyright +Copyright 2001 Dave Kelly, et al. + +Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in . + + + + +Intent + +This HOWTO is intended for the new Linux user who +already has a camera with Universal Serial Bus (USB) mass storage capabilities +or wants to buy one. If you were like me, someone gave you one for your +birthday, and you just could not take it back without hurting some feelings. So, +you get into your Linux documentation and make it work. There is nothing we +can't do, and there are no dumb questions, only information we don't have +yet. + + + + +Scope of Devices +This procedure works with the Linux +kernel version 2.4.8, and I tested it with a Sony P-50 Cybershot with a 4 MB and +64 MB memory stick, and a USB smart card reader for an Olympus camera. I have +read that the procedure will also work on kernel versions back to 2.2.19, but +there are no guarantees. I know the procedure does not work on my old kernel +version of 2.2.15. + +The information in this document is how I solved my problems. There are other +way to do this but it may require recompiling the kernel, which I did not want +to do. This document should give you the necessary information to make USB mass +storage active at boot time. + +Also, Linux is an evolving technology, a hands on technology, and while this +document may not give you the answers to your specific question, it should give +you a place to start exploring for those answers. Plus the serendipity of +discovering new thing along the way. + +The following excerpt from the "gphoto2 README" might give you some insight +to other cameras that will work with this procedure. I don't know who to give +credit for this, as I could not find a name.) Check the gphoto link for +updated information: http://www.gphoto.org + +
+Then, there are cameras supporting the +so-called USB Mass Storage protocol. This is a protocol that has been published +and lets you access any storage device, be it a camera or a disk connected via +USB to your computer. As there are already drivers for this protocol out there, +you don't need an additional program like gphoto2. + + As of now, the following cameras seem to support the USB Mass Storage protocol: + + Casio QV [2x00,3x00,8000] + Fuji FinePix S1 Pro, [1400,2400,4700]Zoom, 1300, 4500 + HP PhotoSmart 315, 618, 912 + Leica Digilux 4.3 + Konica KD300Z + Kyocera Finecam s3 + Minolta Dimage 7 + Nikon Coolpix 995 + Olympus C-100, C-200Z, C-700, C-860L, C-2040, C-3020Z, C-3040Z, C-4040Zoom, D-510, E-10 + Pentax Optio 330 + Sony DSC-F505(V), DSC P5, DSC-F707 + + +Again, those cameras cannot be accessed through gphoto2. + +Other cameras support a protocol called PTP or USB Imaging Devices that has +been developed by Kodak and other. gphoto2 does not support PTP yet, but jPhoto does. Here is a short list of cameras that use this protocol: + + + Kodak DC-4800, DX-3215, DX-3500, DX-3600, DX-3700, DX-3900, +MC3 and all the cameras that use Kodak Easy Share™ system. + Sony DSC-P5, DSC-F707 (both need user configuration of the camera) + + +These cameras won't be supported until gphoto2 implements PTP. +
+
+ + +Reading Material +You are encouraged to read the following manuals and HOWTOs. The information in them is helpful. + + +Man Pages + + lsmod + modprobe + mount + mv + su + fstab + mtab + dir + install + mknod + chown + + + + +HOWTOs + + Module-HOWTO + Bash-Prog-Intro-HOWTO + SCSI-2.4-HOWTO + Hardware-HOWTO + + + Most distros come with all the HOWTOs. If yours did not, they are available at:http://www.tldp.org. + + + +Websites + + http://www2.one-eyed-alien.net/~mdharm/Linux-usb/ + http://www.Linux-usb.org/USB-guide/book1.html + + + +
+ + +Assumptions + +My system is a Athlon 900 with a 40 gig hard +drive. I have no SCSI or USB devices. My kernel was compiled without any of the +SCSI or USB drivers. I compiled the SCSI and USB drivers as modules. I have +version 2.4.8_26mdk of the Linux kernel with Mandrake 8.1. Since we are working +on the kernel level, this document should be applicable to any distro. + +I also make the following assumptions in this document: + + You do not have any SCSI or USB modules loaded or mounted. + You are the superuser and have the root password. + The word camera can refer to a device of type camera, card reader, any USB mass storage device. + The mount point camera, /mnt/camera, does not refer to a device in the aforementioned context. Look in the directory /mnt and you will probably see cdrom, disk, floppy, and maybe several others device names. In +mine, you will see these plus camera. These are directories, and they are +mount points. + The symbol [bash]$ means the command line prompt. Do not type +it when you are entering a command. It is where you type the command line to +give user input to the computer. + + + + +Preliminary Setup + +At this point you need to make some +decisions. You will need to create a directory for a mount point, and you will +need a name for this directory. I use camera and place it in /mnt. The name of +the directory (camera in my case) can be any word of your choice. The command +for creating this directory is: + + +[bash]$ mkdir -m 777 /mnt/camera + + +I prefer for all my pictures to be in one directory with subdirectories by +subject matter, so I also created a directory named picture, and placed it in +my home directory. The name of the directory (picture in my case) can be any +word of your choice. The command for creating this directory is: + + +[bash]$ mkdir -m 777 ~/picture + + +See , listed at the end of this document. + +The big decision! Are you going to do this as user or +superuser/root? + + + +The Script Files + +The following script file is the result +of reading several of the Linux newsgroups and a lot of HOWTOs and manuals. I +take no credit for originality but confess that this is a compilation of what +those more experienced have told me. A very big thank you to all those in the +newsgroups who responded to my questions and the ones posted by others who were +seeking this information. + +To get started, using your favorite text editor select a name for the file +and, type in the following script for a user or superuser. + + +If You Login as User + +Type in the following script file: + + +echo "Please enter a directory name for the pictures." +read DIRPATH +mkdir ~/picture/$DIRPATH +su -c "/sbin/modprobe usb-storage; mount -t vfat /dev/sda1 /mnt/camera; +/etc/rc.d/init.d/usb start; +mv /mnt/camera/dcim/100msdcf/*.jpg ~/picture/$DIRPATH; +umount /mnt/camera; +chown -R your_login_name ~/picture/$DIRPATH" + + + + +If You Login as Superuser + +If you are not creating this script for use as superuser, go to . + +Type in the following script file. + + +echo "Please enter a directory name for the pictures." +read DIRPATH +mkdir picture/$DIRPATH +/sbin/modprobe usb-storage +mount -t vfat /dev/sda1 /mnt/camera +/etc/rc.d/init.d/usb start +mv /mnt/camera/dcim/100msdcf/*.jpg picture/$DIRPATH; +umount /mnt/camera +chown -R your_login_name picture/$DIRPATH + + + + +Make it Executable + +Now make the script file executable. The command for that is: + +As user: + +[bash]$ su -c "chmod a=r+w+x your_script_file_name" + + +As superuser: + +[bash#] chmod a=r+w+x your_script_file_name + + + + +What is Happening while the script is running + +When you run the script, it will create a subject matter directory. DIRPATH should describe the pictures and is entered at the prompt. If your_script_file_name = getcamJ,(J for getting the pictures with .jpg extensions) the command sequence would +look like this: + + +[bash]$ getcamJ +Please enter a directory name for the pictures. +bash]$ something +Password: +[bash]$ your root password + + +If you run this script file in superuser mode the rest of this paragraph does +not apply. You have to be superuser to run this. Consequently, the 'su' command. +The -c flag will let you execute one command and return to your present working directory. The quotation marks allow you to enter more that one command. +And the semicolon allows one command to execute right after the last. + +/sbin/modprobe usb-storage: modprobe will install the USB mass storage module along with any other modules or drivers needed. Mainly the SCSI driver. +Make sure that you have in your /dev directory the following entries. sda0, +sda1, sda2, sda3, sda4, sdb0, sdb1, sdb2, sdb3, sdb4. Set sda1 to the appropriate device if you have other SCSI devices mounted, probably sdb1. + +Mount your SCSI driver: mount -t vfat /dev/sda1 /mnt/camera + +Start your USB: /etc/rc.d/init.d/usb start + +Move your pictures from your camera to your hard drive. mv will also remove your pictures from your camera: mv /mnt/camera/dcim/100msdcf/*.jpg picture/$DIRPATH; + +Unmount your SCSI driver: umount /mnt/camera + +Then: chown -R your_login_name picture/$DIRPATH. When you do something as +superuser (su) or root, root owns those files/pictures. Some of the things you +may want to do to these files/pictures may give you a permission denied error. +This allows the user to work without those errors. Read the manual for more information. + +My system is set up with no USB or SCSI compiled into the kernel. All this +was compiled as modules. This script file assumes your system is the same. If +not, you will have to make some modifications. Please read the manuals and +HOWTOs. Or ask on one of the Linux newsgroups. + + + + + +Exploring and Fine Tuning + +OK, you should be set up and +ready to do some exploring. Go take some trash pictures with your camera in all +the different formats. Mine will take in 4 formats, TIFF, GIF, JPEG, and MPEG, +and it also provides a thumbnail of each picture. In my Sony P-50 these will be +stored on the memory media in 4 different sub-folders, 100msdcf, imcif100, thm, +and moml0001. These are in 2 folders, dcim, and mssony. You need to find how +your camera names the directories. You can do this in the following +manner: + + + Copy the above script file to a working file name. + With your text editor change line: mv /mnt/camera/dcim/100msdcf/*.jpg picture/$DIRPATH to mv /mnt/camera/* picture/$DIRPATH + Run the script from a command line as follows: + +[bash]$ ./your_script_file_name + + +(notice the dot and forward slash) + + + +DON'T PANIC + +THE MODIFIED SCRIPT FILE MAY GIVE YOU SOME +ERRORS. Just ignore them for now. Before you panic and say it does not +work, look and see if you have pictures. If you do, write down the directory +path names. Go back to your text editor and substitute them for +dcim/100msdcf/*.jpg in the script file. You may want to make several script +files to handle the each of the different picture formats. + +At this point the directory on your hard drive should look something like +. Enter this command to confirm it does: + +[bash]$ dir -R name-of-your-picture-directory + + +The information in this document and the manuals and HOWTOs should get you up +and running. +Good Luck. +Dave + + + + +Troubleshooting or PANIC! + +If nothing has gone right, let's do some troubleshooting. Use your camera and +see if you still have pictures on it. If you do, skip the rest of this +paragraph. If you don't, they should be someplace, check again. If not, and you +can not find them, go take some more. Turn your camera off and plug it in and +boot up again. + +Check to see if the mount point unlinked by mv,/mnt/camera is there. If it's gone create it again. Sometimes the mount point disappears in modified +mode. Also, I have notice on my system that sometimes the SCSI device in /dev +(sda1) gets removed. Check that also and replace if needed. + +Clean up all the extra directories you got from the script you ran that +produced the errors and run your new script with the directories and see if it +works. To make it easier to clean up all the directories and files you may have +to su - if you're in user mode. Be sure to change back when you get through. +See at the end of this document. + +Type: + + +[bash]$ dmesg + + +and you should see this somewhere: + + +hub.c: USB new device connect on bus1/1, assigned device number 2 +usb.c: USB device 2 (vend/prod 0x54c/0x10) is not claimed by any active driver. (The +0x54c/0x10 will be different for different vendors.) + + +If you see this, your USB mass storage device in recognized. + +Now turn your camera on and run the script file (the modified one) and you +should see something like this when you run dmesg again: + + +[bash]$ dmesg + +SCSI subsystem driver Revision: 1.00 +Initializing USB Mass Storage driver... +usb.c: registered new driver usb-storage +scsi0 : SCSI emulation for USB Mass Storage devices +Vendor: Sony Model: Sony DSC Rev: 3.22 +Type: Direct-Access ANSI SCSI revision: 02 +WARNING: USB Mass Storage data integrity not assured +USB Mass Storage device found at 2 +USB Mass Storage support registered. +Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0 +SCSI device sda: 126848 512-byte hdwr sectors (65 MB) +sda: Write Protect is off +/dev/scsi/host0/bus0/target0/lun0: p1 +usb-uhci.c: interrupt, status 3, frame# 1628 + + +Now run this command and read . + +[bash]$ lsmod + + +If the information from running lsmod appears as in ,and your dmesg shows the information listed above, and there are no pictures, I don't +know what is wrong. Unfortunately, the only thing I know to do is go thru the +whole process again. Only this time use the re-direction option >filename +to capture the results. Post this to one of these 2 newsgroups: + + alt.OS.Linux.mandrake + comp.OS.Linux.hardware + + +telling what you've done and ask for help. Include everything you can think of, the more +information the better, and e-mail me at the same time. My address is: daveekelly@earthlink.net. + + + +Last Things Last + +After you have got everything working correctly and working just the way you want it to, this is something you can do if you want to. Not required. You can continue to run the executable script file +from the directory you wrote it in with the dot slash option preceding the name +(./) or you can install it in one of the directories that hold other executable +applications. I would recommend /usr/sbin. The command for that is: + + +[bash]$ install file_name /usr/sbin + + + + +Appendix A + + +PART 1 + +This is the way I want my picture directory to be set up. A primary +directory picture and a sub-directory describing the content smkbot. + + +picture/smkbot: +dsc00117.jpg dsc00120.jpg dsc00123.jpg dsc00126.jpg dsc00129.jpg +dsc00118.jpg dsc00121.jpg dsc00124.jpg dsc00127.jpg dsc00130.jpg +dsc00119.jpg dsc00122.jpg dsc00125.jpg dsc00128.jpg dsc00131.jpg + + + + +PART 2 + +With the modified version of the script file you have the pictures +scattered over several directories. But right now, this is what we want. + + +picture/trash: +camera + +picture/trash/camera: +dcim mssony + +picture/trash/camera/dcim: +100msdcf + +picture/trash/camera/dcim/100msdcf: +dsc00357.jpg dsc00360.jpg dsc00363.jpg txt00365.gif +dsc00358.jpg dsc00361.jpg dsc00364.jpg txt00365.thm +dsc00359.jpg dsc00362.jpg dsc00366.jpg + +picture/trash/camera/mssony: +imcif100 + +picture/trash/camera/mssony/imcif100: +dsc00364.jpg dsc00366.tif + + + + + +Appendix B + +What we want to see here is the word usb-storage under the Used by +column: + + +Module Size Used by +nls_iso8859-12880 0 (autoclean) +nls_cp437 4400 0 (autoclean) +sd_mod11792 0 (autoclean) +vfat 9968 0 (autoclean) +fat 32192 0 (autoclean) [vfat] +usb-storage 52528 0 +scsi_mod 91072 2 [sd_mod usb-storage] +ppp_deflate 42208 0 (autoclean) +bsd_comp 4576 0 (autoclean) +ppp_async 6672 0 (autoclean) +ppp_generic 19616 0 (autoclean) [ppp_deflate bsd_comp ppp_async] +slhc 5136 0 (autoclean) [ppp_generic] +parport_pc 20240 1 (autoclean) +lp 5808 0 (autoclean) +parport 24768 1 (autoclean) [parport_pc lp] +es1371 26768 1 +soundcore 4208 4 [es1371] +ac97_codec 9312 0 [es1371] +gameport 1856 0 [es1371] +af_packet 12560 0 (autoclean) +ip_vs 62000 0 (autoclean) +usb-uhci 21232 0 (unused) +usbcore 50752 1 [usb-storage usb-uhci] +rtc 5600 0 (autoclean) + + + + +Appendix C + +When you go to clean up all those test directories, use the following +command. BUT BE VERY VERY CAREFUL: + + +[bash]$ rm -Rf picture/test_directory + + +You could lose more than you bargin for, test_directory +should be what you entered for $DIRPATH in the scripts above. (It +never hurts for first time user to slip over somewhere else and create a +directory tree, copy file to it, and test this command line before using it on +something irreplacable.) Again read the manual. + + + + +Gnu Free Documentation License + +Version 1.1, March 2000 + +
+Copyright (C) 2000 Free Software Foundation, Inc. +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +
+ + +PREAMBLE + +The purpose of this License is to make a manual, textbook, + or other written document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by + others. + +This License is a kind of "copyleft", which means that + derivative works of the document must themselves be free in the + same sense. It complements the GNU General Public License, which + is a copyleft license designed for free software. + +We have designed this License in order to use it for manuals + for free software, because free software needs free documentation: + a free program should come with manuals providing the same + freedoms that the software does. But this License is not limited + to software manuals; it can be used for any textual work, + regardless of subject matter or whether it is published as a + printed book. We recommend this License principally for works + whose purpose is instruction or reference. + + + +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that + contains a notice placed by the copyright holder saying it can be + distributed under the terms of this License. The "Document", + below, refers to any such manual or work. Any member of the + public is a licensee, and is addressed as "you". + +A "Modified Version" of the Document means any work + containing the Document or a portion of it, either copied + verbatim, or with modifications and/or translated into another + language. + +A "Secondary Section" is a named appendix or a front-matter + section of the Document that deals exclusively with the + relationship of the publishers or authors of the Document to the + Document's overall subject (or to related matters) and contains + nothing that could fall directly within that overall subject. + (For example, if the Document is in part a textbook of + mathematics, a Secondary Section may not explain any mathematics.) + The relationship could be a matter of historical connection with + the subject or with related matters, or of legal, commercial, + philosophical, ethical or political position regarding + them. + +The "Invariant Sections" are certain Secondary Sections + whose titles are designated, as being those of Invariant Sections, + in the notice that says that the Document is released under this + License. + +The "Cover Texts" are certain short passages of text that + are listed, as Front-Cover Texts or Back-Cover Texts, in the + notice that says that the Document is released under this + License. + +A "Transparent" copy of the Document means a + machine-readable copy, represented in a format whose specification + is available to the general public, whose contents can be viewed + and edited directly and straightforwardly with generic text + editors or (for images composed of pixels) generic paint programs + or (for drawings) some widely available drawing editor, and that + is suitable for input to text formatters or for automatic + translation to a variety of formats suitable for input to text + formatters. A copy made in an otherwise Transparent file format + whose markup has been designed to thwart or discourage subsequent + modification by readers is not Transparent. A copy that is not + "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include + plain ASCII without markup, Texinfo input format, LaTeX input + format, SGML or XML using a publicly available DTD, and + standard-conforming simple HTML designed for human modification. + Opaque formats include PostScript, PDF, proprietary formats that + can be read and edited only by proprietary word processors, SGML + or XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML produced by some word + processors for output purposes only. + +The "Title Page" means, for a printed book, the title page + itself, plus such following pages as are needed to hold, legibly, + the material this License requires to appear in the title page. + For works in formats which do not have any title page as such, + "Title Page" means the text near the most prominent appearance of + the work's title, preceding the beginning of the body of the + text. + + + +VERBATIM COPYING + +You may copy and distribute the Document in any medium, + either commercially or noncommercially, provided that this + License, the copyright notices, and the license notice saying this + License applies to the Document are reproduced in all copies, and + that you add no other conditions whatsoever to those of this + License. You may not use technical measures to obstruct or + control the reading or further copying of the copies you make or + distribute. However, you may accept compensation in exchange for + copies. If you distribute a large enough number of copies you + must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated + above, and you may publicly display copies. + + + +COPYING IN QUANTITY + +If you publish printed copies of the Document numbering more + than 100, and the Document's license notice requires Cover Texts, + you must enclose the copies in covers that carry, clearly and + legibly, all these Cover Texts: Front-Cover Texts on the front + cover, and Back-Cover Texts on the back cover. Both covers must + also clearly and legibly identify you as the publisher of these + copies. The front cover must present the full title with all + words of the title equally prominent and visible. You may add + other material on the covers in addition. Copying with changes + limited to the covers, as long as they preserve the title of the + Document and satisfy these conditions, can be treated as verbatim + copying in other respects. + +If the required texts for either cover are too voluminous to + fit legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + +If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a publicly-accessible + computer-network location containing a complete Transparent copy + of the Document, free of added material, which the general + network-using public has access to download anonymously at no + charge using public-standard network protocols. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + +It is requested, but not required, that you contact the + authors of the Document well before redistributing any large + number of copies, to give them a chance to provide you with an + updated version of the Document. + + + +MODIFICATIONS + +You may copy and distribute a Modified Version of the + Document under the conditions of sections 2 and 3 above, provided + that you release the Modified Version under precisely this + License, with the Modified Version filling the role of the + Document, thus licensing distribution and modification of the + Modified Version to whoever possesses a copy of it. In addition, + you must do these things in the Modified Version: + + +Use in the Title Page + (and on the covers, if any) a title distinct from that of the + Document, and from those of previous versions (which should, if + there were any, be listed in the History section of the + Document). You may use the same title as a previous version if + the original publisher of that version gives permission. + + +List on the Title Page, + as authors, one or more persons or entities responsible for + authorship of the modifications in the Modified Version, + together with at least five of the principal authors of the + Document (all of its principal authors, if it has less than + five). + + +State on the Title page + the name of the publisher of the Modified Version, as the + publisher. + + +Preserve all the + copyright notices of the Document. + + +Add an appropriate + copyright notice for your modifications adjacent to the other + copyright notices. + + +Include, immediately + after the copyright notices, a license notice giving the public + permission to use the Modified Version under the terms of this + License, in the form shown in the Addendum below. + + +Preserve in that license + notice the full lists of Invariant Sections and required Cover + Texts given in the Document's license notice. + + +Include an unaltered + copy of this License. + + +Preserve the section + entitled "History", and its title, and add to it an item stating + at least the title, year, new authors, and publisher of the + Modified Version as given on the Title Page. If there is no + section entitled "History" in the Document, create one stating + the title, year, authors, and publisher of the Document as given + on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. + + +Preserve the network + location, if any, given in the Document for public access to a + Transparent copy of the Document, and likewise the network + locations given in the Document for previous versions it was + based on. These may be placed in the "History" section. You + may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. + + +In any section entitled + "Acknowledgements" or "Dedications", preserve the section's + title, and preserve in the section all the substance and tone of + each of the contributor acknowledgements and/or dedications + given therein. + + +Preserve all the + Invariant Sections of the Document, unaltered in their text and + in their titles. Section numbers or the equivalent are not + considered part of the section titles. + + +Delete any section + entitled "Endorsements". Such a section may not be included in + the Modified Version. + + +Do not retitle any + existing section as "Endorsements" or to conflict in title with + any Invariant Section. + + +If the Modified Version includes new front-matter sections + or appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + +You may add a section entitled "Endorsements", provided it + contains nothing but endorsements of your Modified Version by + various parties--for example, statements of peer review or that + the text has been approved by an organization as the authoritative + definition of a standard. + +You may add a passage of up to five words as a Front-Cover + Text, and a passage of up to 25 words as a Back-Cover Text, to the + end of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by + this License give permission to use their names for publicity for + or to assert or imply endorsement of any Modified Version. + + + +COMBINING DOCUMENTS + +You may combine the Document with other documents released + under this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice. + +The combined work need only contain one copy of this + License, and multiple identical Invariant Sections may be replaced + with a single copy. If there are multiple Invariant Sections with + the same name but different contents, make the title of each such + section unique by adding at the end of it, in parentheses, the + name of the original author or publisher of that section if known, + or else a unique number. Make the same adjustment to the section + titles in the list of Invariant Sections in the license notice of + the combined work. + +In the combination, you must combine any sections entitled + "History" in the various original documents, forming one section + entitled "History"; likewise combine any sections entitled + "Acknowledgements", and any sections entitled "Dedications". You + must delete all sections entitled "Endorsements." + + + +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and + other documents released under this License, and replace the + individual copies of this License in the various documents with a + single copy that is included in the collection, provided that you + follow the rules of this License for verbatim copying of each of + the documents in all other respects. + +You may extract a single document from such a collection, + and distribute it individually under this License, provided you + insert a copy of this License into the extracted document, and + follow this License in all other respects regarding verbatim + copying of that document. + + + +AGGREGATION WITH INDEPENDENT WORKS +A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, does not as a whole count as a + Modified Version of the Document, provided no compilation + copyright is claimed for the compilation. Such a compilation is + called an "aggregate", and this License does not apply to the + other self-contained works thus compiled with the Document, on + account of their being thus compiled, if they are not themselves + derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to + these copies of the Document, then if the Document is less than + one quarter of the entire aggregate, the Document's Cover Texts + may be placed on covers that surround only the Document within the + aggregate. Otherwise they must appear on covers around the whole + aggregate. + + + +TRANSLATION + +Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires + special permission from their copyright holders, but you may + include translations of some or all Invariant Sections in addition + to the original versions of these Invariant Sections. You may + include a translation of this License provided that you also + include the original English version of this License. In case of + a disagreement between the translation and the original English + version of this License, the original English version will + prevail. + + + +TERMINATION +You may not copy, modify, sublicense, or distribute the + Document except as expressly provided for under this License. Any + other attempt to copy, modify, sublicense or distribute the + Document is void, and will automatically terminate your rights + under this License. However, parties who have received copies, or + rights, from you under this License will not have their licenses + terminated so long as such parties remain in full + compliance. + + + +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised + versions of the GNU Free Documentation License from time to time. + Such new versions will be similar in spirit to the present + version, but may differ in detail to address new problems or + concerns. See http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing + version number. If the Document specifies that a particular + numbered version of this License "or any later version" applies to + it, you have the option of following the terms and conditions + either of that specified version or of any later version that has + been published (not as a draft) by the Free Software Foundation. + If the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + + + +How to use this License for your documents + +To use this License in a document you have written, include + a copy of the License in the document and put the following + copyright and license notices just after the title page: + +
+Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License". +
+ +If you have no Invariant Sections, write "with no Invariant + Sections" instead of saying which ones are invariant. If you have + no Front-Cover Texts, write "no Front-Cover Texts" instead of + "Front-Cover Texts being LIST"; likewise for Back-Cover + Texts. + +If your document contains nontrivial examples of program + code, we recommend releasing these examples in parallel under your + choice of free software license, such as the GNU General Public + License, to permit their use in free software. +
+
+ +
\ No newline at end of file diff --git a/LDP/retired/Ultra-DMA.sgml b/LDP/retired/Ultra-DMA.sgml new file mode 100644 index 00000000..6f193b78 --- /dev/null +++ b/LDP/retired/Ultra-DMA.sgml @@ -0,0 +1,794 @@ + + + + +
+ +The Linux Ultra-DMA Mini-Howto +<author>Brion Vibber, <tt><htmlurl url="mailto:brion@pobox.com" +name="brion@pobox.com"></tt> +<date>v3.01, 6 December 2001 + +<abstract> +This document is intended to explain how to use Ultra-DMA aka Ultra-ATA +aka Ultra33 and Ultra66 hard drives and interfaces with Linux. The most +recent version of this mini-Howto can be obtained in HTML format at +<htmlurl url="http://pobox.com/~brion/linux/Ultra-DMA.html" +name="http://pobox.com/˜brion/linux/Ultra-DMA.html">. +</abstract> + +<toc> + +<sect>Introduction and Disclaimer<label id="main-intro"> +<p> + + This document is intended to explain how to use Ultra-DMA aka Ultra-ATA + aka Ultra33 and Ultra66 hard drives and interfaces with Linux. In many cases there is + no difficulty in using them, but some tweaking can increase performance. In + other cases, you need to go to extraordinary lengths simply to access your + hard drives. + +<sect1>Disclaimer<label id="disclaimer"> +<p> + + The information in this is document is, to the best of my knowledge, correct, and + should work. However, there may be typos, there may be mysterious + transmission errors, and there may be strange incompatibilities within your + own system that prevent the techniques described herein from working + properly. So... before you go fiddling around with you hard drive, <bf>BACK + UP ANY DATA YOU WANT TO KEEP!</bf> If you are not already performing regular + backups, please start doing so for your own good. + +<sect1>Credits<label id="credits"> +<p> + + <url name="Michel Aubry" url="mailto:giovanni@sudfr.com"> - UDMA-enabled + VIA-related patch for <=2.0.33 + & more info, grand unified UDMA patch for 2.0.34+ + + <url name="Andrew Balsa" url="mailto:andrebalsa@altern.org"> - Provided + some general UDMA info and the udma-generic patch for Intel TX, SiS, and VP1 + on <=2.0.33; also the grand unified UDMA patch for 2.0.34+ + + Maxime Baudin - French translation + + Bokonon - ``Controller'' vs. ``interface'' + + <url name="John G." url="mailto:prefect@ipass.net"> - + VIA VP2 patch for <=2.0.33 & info + + Martin Gaitan - Promise Ultra33 ide0/ide1 installation workaround + + <url name="Andre M. Hedrick" url="mailto:andre@suse.com"> - + current Linux IDE subsystem maintainer + + Håvard Tautra Knutsen - Norwegian translation + + Norman Jacobowitz - Bugged me to add info on the VP3 + + John Levon - Info on TX Pro mobos + + Peter Monta - Info on using two Ultra33 cards + + Masayoshi Nakano - Japanese translation + + <url name="Gadi Oxman" url="mailto:gadio@netvision.net.il"> - The + Promise Ultra33 patch for <=2.0.34 & finding the secret + numbers for the workaround + + Andy Pearce - Suggested adding info on the additional device files for hde-h + + <url name="Andrei Pitis" url="mailto:pink@roedu.net"> - LILO patch + + <url name="Brion Vibber" url="mailto:brion@pobox.com"> - The document itself + +<sect1>Document History<label id="history"> +<p> + + v3.01, 6 December 2001: Relicensed under <htmlurl + url="http://www.gnu.org/copyleft/fdl.html" + name="GNU Free Documentation License">; no content changes. + + v3.0, 9 November 1999: Finally found time to update some key changes such as + the relocation of the IDE patch archive to the <url name="Kernel.org archives" + url="http://www.kernel.org/pub/linux/kernel/people/hedrick">... pesky school! + Updated all sunsite links to new <htmlurl url="ftp://metalab.unc.edu" + name="metalab.unc.edu"> or <htmlurl url="http://www.linuxdoc.org" + name="www.linuxdoc.org"> + + v2.1, 27 May 1999: Corrects some minor omissions and errors from 2.0 and adds + information on the Promise Ultra66 and 2.2/2.3 kernels. + + v2.0, 7 August 1998: Major updates and almost total restructuring of the + document into onboard (motherboard) and offboard (add-in cards) interfaces; + the Grand Unified UDMA patch(a part of the Jumbo patch) + for 2.0.35. Put credits in alphabetical order by last name. Changed + ``controller'' to ``interface'' in many cases to be more technically + correct. Added info on enabling/disabling UDMA, the blacklist, and more! + + v1.45, 6 July 1998: Minor updates - Red Hat 5.1 and 2.0.34 patch for + Promise Ultra33, LILO patch for booting off of PCI interfaces such as + the Promise Ultra33 + + v1.41, 3 May 1998: Fixed a couple of typos, added translators to credits. + + v1.4, 28 April 1998: UDMA-Generic patch, some more general info. Copying + section added. + + v1.3, 5 March 1998: VIA VP3 info, better patching instructions, + pointer to more recent Promise patch. + + v1.2, 27 January 1998: Additional Promise workaround info. + + v1.1, 21 January 1998: New info about VIA chipset, installing <em/around/ + the Promise Ultra33, and enabling Bus Master & UDMA transfer modes. + + v1.0, 19 January 1998: More or less complete, first version done in SGML. + +<sect1>Copying<label id="copying"> +<p> + + Copyright (c) 1998-2001 Brion L. Vibber + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being "Introduction and Disclaimer", with no + Front-Cover Texts, and with no Back-Cover Texts. + + You should have received a copy of the GNU Free Documentation License + along with this document; if you did not, you may find it at + <htmlurl url="http://www.gnu.org/copyleft/fdl.html" + name="http://www.gnu.org/copyleft/fdl.html">. + +<sect>What is Ultra-DMA and why do I want it?<label id="udma-intro"> +<p> + +Here's a brief overview of IDE-based drive technologies: + +<sect1>IDE, EIDE, & ATAPI<label id="classic"> +<p> + + These are older drive technologies. Most non-SCSI hard drives and drive + interfaces that you can buy today or are likely to be using are EIDE, + although many of the larger drives now available are UDMA. + +<sect1>Bus Master DMA<label id="bm"> +<p> + + Bus Master DMA is a technology for increasing the speed of hard disk data + transfers which requires support from the motherboard and the BIOS, and at + least some support from the drive. + + You can learn more at <htmlurl + url="http://developer.intel.com/design/pcisets/busmastr/FAQs.htm" + name="http://developer.intel.com/design/pcisets/busmastr/FAQs.htm">. + +<sect1>Ultra-DMA aka Ultra-ATA aka Ultra33 aka...<label id="udma"> +<p> + Ultra-DMA has many names, but we'll just call it UDMA in here. + + UDMA is a more advanced technology which provides for even faster + throughput, up to 33.3 MB/s in UDMA mode 2 and 66.7 MB/s in UDMA mode 4, + twice to four times that of EIDE, for much lower prices + than SCSI. Many new computers come with large UDMA drives and UDMA + interfaces, and it's possible to add a UDMA interface card (such as + the Promise Ultra33 or Ultra66) to an existing system to boost speed, even on older + non-UDMA drives. + + You can learn great details about UDMA at + <htmlurl url="http://www.quantum.com/src/whitepapers/ultraata/" + name="http://www.quantum.com/src/whitepapers/ultraata/"> + + Note that cable length should be kept shorter for UDMA, compared to plain DMA, + preferably less than 30 cm (12") maximum length though 18 inches will + usually be fine. 66 MB/s requires a special 80-conductor cable and should + definately not be longer. If you get a lot of CRC errors, try using a shorter + cable. + + +<sect1>Just how ``Ultra'' is it anyway?<label id="speed"> +<p> + + Before we get any farther, let's clear up a misconception. That 33 or 66 MB/sec + figure is the <bf/burst transfer rate/, and it's not something you're going to + see very often. To explain, here is a clip from udma­generic's UDMA.txt: + +<tscreen><verb> +Burst (instantaneous) transfer rates are supposed to go from 16.6MB/s (PIO +mode 4) to 16.6MB/s (DMA mode 2) up to 33MB/s (UDMA). In his patch against +kernel 2.1.55, Kim-Hoe Pang actually checked the UDMA burst transfer rate +with a logic analiser: 60ns/word, which translates into 33MB/s. + +Note that burst transfer rates only affect data transfers to/from the EIDE +drive cache (476kB for the IBM 6.4GB drive), and IMHO are not particularly +relevant for most Linux users. + +The Linux kernel uses as much RAM as possible to cache hard disk data +accesses, and so if data is not in the kernel cache there is little chance +that it will be in the (much smaller) hard disk cache. +</verb></tscreen> + + Much more relevant is the <bf/sustained transfer rate/, the speed at + which data can be transferred from the drive to main memory where it + can be used. An easy way to measure the sustained transfer rate is to + use <tt/hdparm/, for instance ``<tt>hdparm ­Tt /dev/hda</tt>'' to measure + the rate of the first IDE device. + +<tscreen><verb> +Here is some data gathered after extensive testing, using the hdparm utility +(also written by Mark Lord): + +PIO mode 4 transfer rates under Linux: +/- 5.2MB/s + +DMA mode 2 transfer rates under Linux: +/- 7.2MB/s + +UDMA mode 2 transfer rates under Linux: +/- 9.8MB/s +</verb></tscreen> + + As you can see, UDMA is still almost twice as fast as plain EIDE and + significantly faster than plain bus mastering DMA. Most current UDMA drives + will give you between 10 and 15 MB/s using UDMA mode 2 (33 MB/s) or 4 (66 MB/s) + enabled. + + Also, using DMA vastly reduces CPU usage during disk I/O vs PIO. + +<sect1>How does UDMA compare to SCSI?<label id="udma-vs-scsi"> +<p> + + I don't have any hard numbers to give you, but the general consensus is that + high-end SCSI can give better performance than UDMA. However if you've looked + at the price tags on any hard drives lately you'll notice that UDMA drives + tend to be much less expensive. The performance/price ratio favors UDMA in + most cases. + +<sect>Using your UDMA hard drive with an EIDE interface<label id="udma-on-eide"> +<p> + + This is easy to do. Since all UDMA drives are fully EIDE backward-compatible, + just plunk your drive on your EIDE interface like it was any old hard + drive and Linux should have no problems detecting or using it. + However, you will of course be limited to the slower speed of EIDE. + +<sect>Using your hard drives with a UDMA interface<label id="using-udma"> +<p> + + Well, there is good news and there is bad news. The good news is that a UDMA + interface can be used with both UDMA hard drives and legacy EIDE hard + drives, and will be a lot faster than an EIDE interface. + + The bad news is that the old stock kernels (2.0.x) do not currently + support UDMA very well. The new 2.2.x kernels do support UDMA33, however, + and kernel patches are available to add UDMA support for kernels that lack it. + + In addition, certain UDMA interfaces that are add-in cards rather than built + into the motherboard require either a patch or some trickery to use on older kernels. That is why + this document exists - to explain how to get the patches and work the trickery. + +<sect>Offboard PCI UDMA interfaces<label id="pci"> +<p> + + These are UDMA interfaces on PCI cards that can be used to add UDMA + support to an existing computer without replacing the motherboard, or + for adding support for an additional four drives to a machine which has + had its onboard interfaces filled. They can also be found preinstalled + in some computers, especially Gateway 2000 and Dell machines. + + Most of them are not supported by the old stable kernels (2.0.x), but many should + work with a 2.2.x kernel - the Red Hat 6.0 and SuSE 6.1 distributions are + based on 2.2.x kernels, as are the most recent versions of most other distros. + However some of the latest cards (the Promise Ultra66 for instance) won't + work even with the current 2.2.x kernels, if you have this or can't get a + newer distribution then you must apply a kernel patch or upgrade to a newer + kernel version. + If you need to install Linux onto a hard drive on one of these interfaces + in this case, you will need to use a few odd tricks. + +<sect1>Promise Ultra33<label id="promise"> +<p> + + This is a PCI card that has two UDMA channels on it, supporting up to four + drives total. You can look up specifications & pricing at + <htmlurl url="http://www.promise.com" name="http://www.promise.com">. + This card shipped in early model Gateway 2000 Pentium II systems. + + Kernels 2.0.35 and later and all 2.2.x kernels support the Ultra33 and + you should have no trouble installing a distribution that uses these kernels. + However, the older stable kernels (2.0.34 and below) do not, and + since most older Linux distributions include these older kernels it can + be a little difficult to get Linux installed if you can't or don't want + to use a newer version (for instance if you are standardized on a particular + version of a distribution throughout your organization). + + <bf/Installing Linux with the Ultra33/ + + Although there is a patch for the Ultra33 interface, + it is not very easy to apply a patch and recompile your kernel if you have + not installed Linux yet! So, here is a workaround which allows you to + install. Thanks to Gadi Oxman for the following information on getting the + interface settings: + +<tscreen><verb> +If we can access the console with the installation disk, we can also +use "cat /proc/pci" to display the Promise interface settings: + + RAID bus interface: Promise Technology Unknown device (rev 1). + Vendor id=105a. Device id=4d33. + Medium devsel. IRQ 12. Master Capable. Latency=32. + I/O at 0xe000. (a) + I/O at 0xd804. (b) + I/O at 0xd400. (c) + I/O at 0xd004. (d) + I/O at 0xc800. (e) + +and pass "ide2=a,b+2 ide3=c,d+2" as a command line parameter to the kernel. +</verb></tscreen> + + Note that the numbers probably are not the same as what you will have. + Just as an example, the parameters to use for the above set of numbers + would be ``<tt/ide2=0xe000,0xd806 ide3=0xd400,0xd006/''. + If you are only using the first channel on the Ultra33 (for + instance, if you only have one drive, or two if they are master and slave on + the same channel), then you won't need to specify <tt/ide3/. + + <bf/Red Hat 5.1:/ Boot with the boot diskette and press enter when prompted. + The kernel will load, and then you will be asked for a language, keyboard + type, and installation method. You may be prompted for additional information + about the source media; it doesn't matter right now what you tell it as long + as you can get to the next step. Next you should see a screen titled + ``Select Installation Path''; press Alt-F2 now to get to a command prompt. + Run ``<tt>cat /proc/pci</tt>'', write down + the numbers as above, and reboot from the boot disk. This time, type + ``<tt>linux ide2=</tt> <em/(this is where you put the numbers like shown + above)/<tt/ ide3=/<em/(more numbers)/''. It should now be able to install + onto your hard disk without difficulty, however LILO will probably not be able to + install; instead make a boot floppy and boot it with the same parameters + until you can patch LILO and and the kernel. + + <bf/Red Hat 5.0/ and <bf/Slackware 3.4:/ These are similar, but with the wrinkle + that the setup programs ignore <tt>/dev/hde-h</tt> (the drives on <tt/ide2/ and <tt/ide3/). + In order to install to or from these drives it is necessary to override one or + both of the onboard interface's channels. However be sure not to override a + device that you need to install; for instance if you are installing from a CD-ROM drive on + <tt>/dev/hdd</tt> (<tt/ide1/ - onboard interface) to a hard drive on <tt>/dev/hde</tt> + (<tt/ide2/ - the Ultra33), you should override the non-essential <tt/ide0/ with + <tt/ide2/ and leave <tt/ide1/ intact. Assuming the numbers above you would boot with + ``<tt/ide0=0xe000,0xd806/''. Red Hat 5.0 will give you a shell prompt if you use + the rescue disk capability, and Slackware includes a shell in the regular installation + process. However Red Hat 5.0 is difficult to boot after installation; if you have + problems you could try downloading a Slackware boot disk from <htmlurl + url="ftp://ftp.cdrom.com/pub/linux/slackware-3.5/bootdsks.144/" + name="ftp://ftp.cdrom.com/pub/linux/slackware-3.5/bootdsks.144/"> + and using that to boot. + + With another Linux distribution you will have to improvise a bit, but the + process should be about the same as the above. + + <bf><em>IMPORTANT:</em></bf> Without the patch (discussed in the + section <ref id="unified" name="Unified IDE">), the + kernel <bf>needs</bf> these boot parameters in order to access your hard + disk! Therefore it is very important that when you configure LILO, either on + the hard disk or on a boot floppy, that you give it the <bf>exact same + parameters</bf> that you gave when installing. Otherwise your system won't + boot! It should be possible to give them to LILO when you boot (ie, press + Shift, type in ``<tt/linux ide2=/<em/...../'' each time you boot), but only + if you kept the numbers! It is recommended that you patch your kernel as soon + as possible so you will not have to worry about that anymore; once you are + booting with a patched kernel, you can get rid of the boot parameters. Also, + as far as I know there is no way to pass boot parameters to a plain kernel + boot floppy (as made with ``<tt/make zdisk/''), you <bf>must</bf> use LILO or + another loader (such as LOADLIN) that lets you pass boot parameters. + + However, unpatched kernels and installation programs often have a difficult + time actually using ide2 and ide3, even if the drives are detected properly. + So if you can't get Linux to install using the above technique, try + specifying ide0 or ide1 instead of ide2 or ide3 (thanks to Martin Gaitan for + this technique). This essentially replaces the on-board interface + with the Promise Ultra33 as far as the kernel is concerned, and you can + follow the directions in the next section as if you had physically moved it. + Note that if you're using an IDE CD-ROM drive connected to your on-board + interface to install from, you will want to make sure that you do not take + over the interface that the CD is on or you will not be able to install! If + the CD is hda or hdb, use ide1 for your hard drive, and if it is hdc or hdd, + then use ide0. + + <bf/Installing Linux Around the Ultra33/ + + If you cannot get the software workaround to work, you will have to try a + more brute force approach. Here's an alternative method that is virtually + guaranteed to work, but will require you to open up your computer and mess + about in it. <bf/NOTE:/ If you are not familiar with the process of + connecting and disconnecting IDE drives, <bf/read the manuals/ that came + with your computer, your hard drive, and/or the Promise Ultra33 before + attempting this! If you screw something up and don't know how to put it + back, you could end up being sorry! + + That being said, it's all really quite simple. Most motherboards these days + have built-in EIDE interfaces. Disconnect your hard drive from the Ultra33 + and connect it to the onboard interface. If you have other IDE devices, + such as a CD-ROM, tape, or ZIP drive, on your oboard interface, it is + easiest if you either add the hard drive on an unused channel (the secondary + instead of the primary) or temporarily displace a device that you don not + need immediately (such as ZIP or tape). Install Linux. Download and apply + the Promise UDMA patch (see next section). + + Now you are ready to move the drive back onto the Promise... almost. To be + safe, make a kernel-image boot floppy (<tt>cd /usr/src/linux ; make + zdisk</tt>), which you will be able to use to boot your system in case LILO + doesn't work. Actually, to be <em/very/ safe, make two and put one away for + now. + + Okay, now it is time + to think a little... if you have just one hard drive and it is going to be on + the Promise, then it will most likely be <tt>/dev/hde</tt> (<tt/a/ and + <tt/b/ are for the primary + onboard interface, <tt/c/ and <tt/d/ for the secondary onboard interface). + If you are going to put any other drives on it, then the slave of the + Promise's first channel will be <tt>/dev/hdf</tt>, the master of the second + will be <tt>/dev/hdg</tt>, and the slave of the second will be + <tt>/dev/hdh</tt>. + + Edit <tt>/etc/fstab</tt>, and change all the partitions of the hard drives + you are moving from the onboard drives (<tt>/dev/hda</tt>, <tt>hdb</tt>, + etc) to their new locations on the Promise (<tt>/dev/hde</tt>, <tt>hdf</tt>, + etc). If you had to displace any devices (such as a CD-ROM or ZIP drive) + that you want to leave on the onboard interface, then change them to their + new locations as well. For instance, if your CD-ROM was originally the + master on the primary channel (<tt>/dev/hda</tt>), but you put your hard disk + there and had to bump the CD to the slave (<tt>/dev/hdb</tt>) or to the + secondary channel (<tt>/dev/hdc</tt>), and now you want to put it back, then + change it to <tt>/dev/hda</tt>. + + If you are using LILO, reconfigure LILO to use the new location of the drive + (LILO configuration is beyond the scope of this document, if you do not know + how, read the <url url="http://www.linuxdoc.org/HOWTO/mini/LILO.html" + name="LILO mini-HOWTO">), + or else it probably will not be able to boot unless you use that boot floppy + I had you make, which you will also want to configure to boot off the new + partition. This is done using the <tt/rdev/ command. Put the floppy in the + drive and type ``<tt>rdev /dev/fd0 /dev/hde1</tt>''. Of course that's assuming + your root partition is the first on your first UDMA drive. If not (mine is + <tt>/dev/hde7</tt>, for instance), then obviously use the appropriate + partition number! + + Reboot. Your system should now work fine. + + <bf/Patching for the Ultra33/ + + Kernels 2.0.35 and later support the Promise Ultra33 natively; download an upgrade + from your Linux distribution or from <htmlurl name="http://www.kernel.org" + url="http://www.kernel.org">. + + For instructions on how to compile the kernel, read the <htmlurl name="Kernel HOWTO" + url="http://www.linuxdoc.org/HOWTO/Kernel­HOWTO.html">. + + <bf/Using two Ultra33 cards in one machine/ + + This is currently not working correctly... don't do it right now unless you're + willing to fiddle with the kernel to try to get things to work. + +<sect1>Promise Ultra66<label id="promise66"> +<p> + This is essentially the same as the Ultra33 with support for the new UDMA mode 4 + 66 MB/sec transfer speed. Unfortunately it is not yet supported by 2.2.x + kernels. + + There is a patch for 2.0.x and 2.2.x kernels availabe at + <htmlurl url="http://www.kernel.org/pub/linux/kernel/people/hedrick" + name="http://www.kernel.org/pub/linux/kernel/people/hedrick">, and support is + included in the 2.3.x development kernel series at least as of 2.3.3. + + However to get far enough to patch or upgrade the kernel you'll have to pull + the same dirty tricks as for the Ultra33 as in the section above, or else + use a boot disk image <url name="provided by Promise" + url="http://www.promise.com/latest/latedrivers.htm#linuxu66"> + +<sect1>Artop ATP850UF<label id="artop"> +<p> + + This card is supported by the unified IDE code. Installation of Linux onto a system + with one of these as the interface for the target disk may be similar to the + workarounds for the Promise Ultra33. + +<sect1>Adding device files +<p> + + The tertiary and quaternary IDE interfaces (ide2 and ide3) use device files of + the form <tt>/dev/hde*</tt> through <tt>/dev/hdh*</tt>. On older kernels these + devices were not automatically created, so you may need to add them manually + for things to work properly. + + This can be done easily if you have a current copy of the Linux kernel source + installed; simply run <tt>/usr/src/linux/scripts/MAKEDEV.ide</tt> and it will create + all relevant device files. + +<sect>Onboard UDMA interfaces<label id="onboard"> +<p> + + These are UDMA­capable drive interfaces built into motherboards. They use + the standard IDE I/O ports and so are fully usable at the slower non­UDMA + speeds on an unpatched 2.0.x kernel such as are used when installing Linux. + Thus they should not cause any difficulties during installation, and patching + for UDMA speed is a welcome luxury instead of a necessary step. Some UDMA + support is in the latest 2.0.x kernels I believe, and is built into current + 2.2.x kernels for the Intel chipsets. + +<sect1>Intel FX, HX, VX, TX, LX, and BX<label id="intel"> +<p> + + Thanks again to Gadi for this info: + +<tscreen><verb> +Bus mastering DMA support for the Intel TX chipset is available in 2.0.31 +and above. +</verb></tscreen> + + In older kernels (such as Slackware 3.4's 2.0.30), the interface will be + used in the slower EIDE mode. + In either case the interface will be automatically detected by the kernel + and you should have no trouble using it. + + Full UDMA mode 2 support for these chipsets is included in 2.2.x kernels + and the unified IDE patch; see <ref id="unified" name="Unified IDE">. + +<sect1>The VIA VP2 and Related Chipsets<label id="via"> +<p> + + This interface also can be autodetected and used in EIDE mode by an unpatched + kernel, but if you have one of these, you will want to grab a patch so you + can get faster throughput and do away with annoying "unkown PCI device" + messages. + + One is available at + <htmlurl url="http://www.ipass.net/~prefect" + name="http://www.ipass.net/˜prefect/">; it is designed for the VIA VP2/97 + chipset, found on FIC's PA-2007 and PA-2011 motherboards, but may work on related chipsets. + It has been reported that it functions on the newer VIA VP3 chipset, your mileage may vary. + + Note that this patch only supports Bus Mastering mode, + not full UDMA mode, but it's still better than plain-vanilla EIDE mode. + Follow the directions at the patch's site for enabling BMDMA mode. + + There is another patch that supports full UDMA mode at + <htmlurl url="http://www.pyreneesweb.com/Udma/udma.html" + name="http://www.pyreneesweb.com/Udma/udma.html">, + designed for the VIA VT82C586B, and it ought to work on the + VP2, VP3, VPX, P6 and AGP Apollo chipsets. Follow the directions + for installation and UDMA enabling there, but it is recommended that you + back up any data you want to keep, as there are potential problems with + incompatible motherboards. But, if it does work, it should work without + problems. + + Note that the VP1 chipset is not known to work with these patches, + but is supported by the <ref id="unified" name="Unified IDE"> patch. + +<sect1>TX Pro and other ``Pro'' boards +<p> + + UDMA is not currently supported for the TX Pro motherboards. They are not + the same as a TX mobo, and apparently misreport their DMA capabilities hence + the problem. Someone is working on this I hear, so a patch may appear some + time in the future but not yet. + +<sect1>HPT 366<label id="hpt366"> +<p> + + This chipset is on the popular Abit BP-6 motherboard and others, and provides + UDMA mode 4 66MB/s support on two generals, generally in addition to two + other mode 2 33MB/s channels. It is supported by the current <ref id="unified" + name="unified IDE code"> but not in any current release kernels. Installation + thus may require workarounds similar to the <ref id="promise" + name="Promise Ultra33"> did on older 2.0.x kernels. + + + +<sect>Unified IDE Patches<label id="unified"> +<p> + + The unified IDE patches provide support for many chipsets and offboard cards, + and are available for 2.0.x, 2.2.x, and the 2.3.x development kernels. If your + chipset isn't supported by a current stock kernel, you'll want to patch it with + these. + + The unified IDE code is maintained by <url name="Andre Hedrick" url="mailto:andre@suse.com">, + and patches are available at <url name="your local kernel archive mirror" + url="http://www.kernel.org/pub/linux/kernel/people/hedrick">. + + UDMA support is provided for at least the following chipsets, and probably + many more I don't know about: + +<itemize> +<item>All Intel chipsets: FX, HX, VX, TX, LX +<item>All SiS chipsets (only SiS5598 tested, but this entire family of + chipsets has the same bult-in 5513 interface device). +<item>VIA chipsets (only 82C586B tested, but again this family of + chipsets has the same interface structure). Special diagnostics + support is available for the VIA interfaces. +<item>Promise and Artop PCI UDMA interface cards support. +<item>Aladdin V (ALi15x3) chipset +<item>HPT343 board and HPT366 onboard chipset (caveat, see <ref id="hpt366" name="Abit BP-6">) +</itemize> + + It is also designed to be easy to extend to support other chipsets. + +Here are a few notes from Andre Balsa, the author of an earlier patch: + +<tscreen><verb> +Performance with IBM UDMA drives on a good motherboard approches the +maximum head transfer rates: about 10 Mb/s (measured with hdparm -t -T). + +The Intel TX chipset has a single FIFO for hard disk data shared by +its two IDE interfaces, so using 2 UDMA drives will not yield such a +great improvement over a single UDMA drive. +However, the SiS5598 has two completely separate interfaces, each with +its own FIFO. Theoretically, one could approach 66Mb/s burt transfer +rates on motherboards with the SiS5598 chip, using the md driver and +data striping over two drives. The SiS5571 has the same interface +architecture, I think. I don't have the VIA chipsets datasheets, so I +can't say anything about those. + +The Linux IDE (U)DMA kernel driver by Mark Lord has a particularly +low setup time (i.e. latency for data transfers). It is ideal for +frequent, small data transfers (such as those in Linux news servers), +and might be in some cases superior to its SCSI counterparts. +</verb></tscreen> + + +<sect>Activating and Deactivating UDMA<label id="activate"> +<p> + + Normally, a UDMA-aware kernel will automatically enable UDMA support for + drives and interfaces that support it. In most cases that it doesn't, the kernel + either doesn't know how to drive your IDE chipset (get yourself a patch, see + <ref id="unified" name="above">) or doesn't believe it is safe to enable + it (meaning you shouldn't!). + + However in some cases the drive is capable of UDMA but the BIOS drops the ball + and doesn't report it properly, and forcing the issue can be useful. + +<sect1>Using kernel boot parameters<label id="bootparam"> +<p> + + On kernels 2.1.113 and up, you can enable DMA for both drives on a given IDE + interface using the <tt/ideX=dma/ kernel parameter, where X is the number + of the interface (the first is 0). This may not actually force UDMA though. + + Kernel boot parameters can be set using LILO, LOADLIN, or most Linux boot + loaders. For more information see the <htmlurl name="Bootdisk HOWTO" + url="http://www.linuxdoc.org/HOWTO/Bootdisk-HOWTO.html">. + + +<sect1>Using hdparm<label id="hdparm"> +<p> + + <tt/hdparm/ is a program used to tweak the parameters of hard drives under + Linux. Among other things you can use it to enable or disable UDMA for a + drive and test its sustained transfer rate. + + The current version of <tt/hdparm/, is 3.6 as of this writing. Unpatched older versions + will not properly report or set information on UDMA, so be sure to upgrade! You + can obtain the source code for hdparm 3.6 at + <htmlurl url="http://metalab.unc.edu/pub/Linux/system/hardware/hdparm-3.6.tar.gz" + name="http://metalab.unc.edu/pub/Linux/system/hardware/hdparm-3.6.tar.gz">. + + Compile and install it something like this: + +<tscreen><verb> +tar zxvf /tmp/download/hdparm-3.6.tar.gz +cd hdparm-3.5 +make +su root +(type password when prompted) +make install +cp /usr/local/sbin/hdparm /sbin/hdparm +exit +</verb></tscreen> + + <bf/To enable DMA for a hard drive:/ <tt>hdparm -d1 /dev/hda</tt> + + <bf/To disable DMA for a hard drive:/ <tt>hdparm -d0 /dev/hda</tt> + + <bf/To measure transfer rate of a hard drive:/ <tt>hdparm -Tt /dev/hda</tt> + + <bf/To see what options are enabled for a hard drive:/ <tt>hdparm /dev/hda</tt> + + <bf/To see more info on your drive than you wanted to know/: (this will show which UDMA + modes are supported/enabled) + <tt>hdparm -i /dev/hda</tt> + + For more detailed info (such as how to choose which UDMA mode to use) read + the man page (``<tt/man 8 hdparm/''). + +<sect>Problems + +<sect1>The UDMA Blacklist<label id="blacklist"> +<p> + + The following drives are ``blacklisted''. You should <bf/not/ use UDMA with + these drives as it may cause corruption of data. To avoid this, the driver + should automatically disable DMA for these drives. + +<itemize> + <item>Western Digital WDC AC11000H, AC22100H, AC32500H, AC33100H, AC31600H - all versions + <item>Western Digital WDC AC32100H revision 24.09P07 + <item>Western Digital WDC AC23200L revision 21.10N21 +</itemize> + +<sect1>Are you overclocking? +<p> + + If you are, beware! Here is a quote from the old udma-generic documentation: + +<tscreen><verb> +DON'T OVERCLOCK the PCI bus. 37.5MHz is the maximum supported speed for +the PCI bus. Some (supposedly compatible) UDMA drives will not even take +37.5MHz, but should be OK at 33.3MHz. + +In any case, NEVER, NEVER set the PCI bus to 41.5MHz. + +The RECOMMENDED safe setting is 33MHz. +</verb></tscreen> + +<sect1>Is your BIOS current? +<p> + + Here is another clip from the udma-generic docs: + +<tscreen><verb> +The real work involved in setting up the chips for DMA transfers is done +mostly by the BIOS of each motherboard. Now of course one hopes that the +BIOS has been correctly programmed... + +For example, the ASUS SP-97V motherboard with its original BIOS (Rev. 1.03) +would malfunction with the modified Linux driver in both DMA mode 2 and UDMA +modes; it would work well using PIO mode 4, or under Windows 95 in all +modes. I downloaded the latest BIOS image (Rev. 1.06) from the ASUS Web site +and flashed the BIOS EPROM with the latest BIOS revision. It has been +working perfectly ever since (at 66 MHz bus speeds). + +What this tells us is that the BIOS sets up the DMA controller with specific +timing parameters (active pulse and recovery clock cycles). My initial BIOS +revision probably had bad timings. Since the Windows 95 driver sets up those +timings by itself (i.e. it does not depend on the BIOS to setup the hard +disk controller timing parameters), I initially had problems only with the +Linux driver, while Windows 95 worked well. + +So, let me state this again: this Linux (U)DMA driver depends on the BIOS for +correct (U)DMA controller setup. If you have problems, first check that you +have the latest BIOS revision for your specific motherboard. + +... + +New BIOS revisions can be downloaded from your motherboard manufacturer's +Web site. Flashing a new BIOS image is a simple operation but one must +strictly follow the steps explained on the motherboard manual. + +Late Award BIOS revisions seem stable with respect to UDMA. Anything with a +date of 1998 should be fine. +</verb></tscreen> + +<sect1>If you still can't get it to work!<label id="help"> +<p> + + If nothing in this document proved helpful, or at least not helpful enough + to get your machine working, your best bet is to write up a message that + fully describes your difficulty, what type of UDMA interface you have, + whether it is onboard or on a card, if your drive is actually UDMA or plain + EIDE, exactly what configuration of drives you have, what version (distribution + & kernel versions if possible) of Linux you are using, and anything + else that sounds useful, and post it to the newsgroup + <htmlurl url="news:comp.os.linux.hardware" name="comp.os.linux.hardware">. + You will probably get some helpful suggestions soon. + +<sect>If you have some information about UDMA stuff that's not in this mini-howto... +<label id="suggest"> +<p> + + Great! If you know something I don't, by all means send it to me + (<htmlurl url="mailto:brion@pobox.com" name="brion@pobox.com">) + and I will put it in this document and update it fairly soon. + +</article> diff --git a/LDP/retired/VPN.sgml b/LDP/retired/VPN.sgml new file mode 100644 index 00000000..a5e07fb2 --- /dev/null +++ b/LDP/retired/VPN.sgml @@ -0,0 +1,360 @@ +<!doctype linuxdoc system> + +<article> + +<title>The VPN HOWTO +<author>Arpad Magosanyi <mag@bunuel.tii.matav.hu> v0.2,7 Aug1997 +<date>v0.3, 2001-12-01 + +<p> +<bf>Archived Document Notice:</bf> This document has been archived by the LDP +because it does not apply to modern Linux systems. It is no longer +being actively maintained. +</p> + +<sect>Changes +<p> + +The 'no controlling tty problem' -> -o 'BatchMode yes' by Zot O'Connor <zot@crl.com> + +warning about kernel 2.0.30 by mag +<sect>Blurb +<p> + +This is the Linux VPN howto, a collection of information on how to set up a Virtual Protected Network in Linux (and other unices in general). +<sect1>Copyright +<p> + +This document is part of the Linux Documentation Project. The copyright notice is the following: +<p> +The VPN mini HOWTO written by me can be copied, +distributed, and/or modified under the terms of the GNU Free Documentation +License, Version 1.1 or any later version published by the Free Software +Foundation; with the Invariant Section being the section entitled "About +the ppp over ssh vpn technique", with any Front-Cover Text containing the p= +hrase +"Based on the work of Arpad Magosanyi", and with any Back-Cover Text. + +<sect1>Disclaimer +<p> + +As usual: the author not responsible for any damage. For the correct wording, see the relevant part of the GNU GPL 0.1.1 +<sect1>Disclaimer +<p> + +We are dealing with security: you are not safe if you haven't got good security policy, and other rather boring things. +<sect1>Credits +<p> + +Thanks to all of who has written the tools used. + +Thanks to Zot O'Connor <zot@crl.com> for pointing out the "no controlling tty" problem, and it's solution. +<sect1>State of this document +<p> + +This is very preliminary. You should have thorough knowledge of administrating IP, at least some knowledge of firewalls, ppp and ssh. You should know them anyway if you want to set up a VPN. I just decided to write down my experiences not to forget them. There are possibly some security holes indeed. To be fair I've tried it on hosts configured as routers not firewalls, saying: It's simple from that point. +<sect1>Related documentations +<p> +<itemize> +<item>The Linux Firewall-HOWTO /usr/doc/HOWTO/Firewall-HOWTO +<item>The Linux PPP-HOWTO /usr/doc/HOWTO/PPP-HOWTO.gz +<item>The ssh documentations /usr/doc/ssh/* +<item>The Linux Network Admins' Guide +<item>NIST Computer Security Special Publications http://csrc.ncsl.nist.gov/nistpubs/ +<item>Firewall list (majordomo@greatcircle.com) +</itemize> +<sect>Introduction +<p> + +As firewalls are in more and more widely use in internet and intranet security, the ability to do nice VPNs is important. Here are my experiences. Comments are welcome. +<sect1>Naming conventions +<p> + +I will use the terms "master firewall" and "slave firewall", though making a VPN has nothing to do with client-server architecture. I simply refer to them as the active and passive participants of the connection's setup. The host which is starts the setup will be referred as the master, and the passive participant will be the slave. +<sect>Doing it +<p> +<sect1>Planning +<p> + +Before you start to set up your system, you should know the networking details. I assume you have two firewalls protecting one intranet per firewall, and they are both connected to the internet. So now you should have two network interfaces (at least) per firewall. Take a sheet of paper, write down their IP addresses and network mask. You will need one more IP adresses per firewall for the VPN you want to do now. Those addresses should be outside of your existing subnets. I suggest using addresses from the "private" address ranges. They are the followings: +<itemize> +<item>10.0.0.0 - 10.255.255.255 +<item>172.16.0.0 - 172.31.255.255 +<item>192.168.0.0 - 192.168.255.255 +</itemize> + +For the sake of example, here's a sample configuration: The two bastions are called fellini and polanski. They have one interface for the internet (-out), one for the intranet (-in), and one for the vpn (-vpn). The addresses and netmasks: +<itemize> +<item>fellini-out: 193.6.34.12 255.255.255.0 +<item>fellini-in: 193.6.35.12 255.255.255.0 +<item>fellini-vpn: 192.168.0.1 point-to-point +<item>polanski-out: 193.6.36.12 255.255.255.0 +<item>polanski-in: 193.6.37.12 255.255.255.0 +<item>polanski-vpn: 192.168.0.2 point-to-point +</itemize> + +So we have the plan. +<sect1>Gathering the tools +<p> + +You will need a +<itemize> +<item>Linux firewall +<item>kernel +<item>very minimal configuration +<item>ipfwadm +<item>fwtk +<item>Tools for the VPN +<item>ssh +<item>pppd +<item>sudo +<item>pty-redir +</itemize> + +Current versions: +<itemize> +<item>kernel: 2.0.29 Use a stable kernel, and it must be newer than 2.0.20, because the ping'o'death bug. At the time of writing 2.0.30 is the last "stable" kernel, but it has some bugs. If you want to have the fast and cool networking code introduced in it, try a prepatch. the 3rd is working for me nicely. +<item>base system: I prefer Debian. YMMV. You absolutely don't want to use any big packages, and you never even tought of using sendmail, of course. You also definitely don't want to enable telnet, ftp, and the 'r' commands (as usual in case of any other unix hosts). +<item>ipfwadm: I've used 2.3.0 +<item>fwtk: I've used 1.3 +<item>ssh: >= 1.2.20. There are problems with the underlying protocol in the older versions. +<item>pppd: I've used 2.2.0f for the tests, but I'm not sure if is it secure, this is why I turned the setuid bit off, and used sudo to launch it. +<item>sudo: 1.5.2 the newest I am aware of +<item>pty-redir: It is written by me. Try ftp://ftp.vein.hu/ssa/contrib/mag/pty-redir-0.1.tar.gz. Its version number is 0.1 now. Tell me it there is any problem with it. +</itemize> +<sect1>Compile and install +<p> + +Compile or otherwise install the gathered tools. Look at every one's documentation (and the firewall-howto) for details. Now we have the tools. +<sect1>Configure the other subsystems +<p> + +Configure your firewall rules, etc. You need to enable ssh traffic between the two firewll hosts. It means a connection to port 22 on the slave from the master. Start sshd on the slave and verify if you can login. This step is untested, please tell me your results. +<sect1>Set up the accounts for the VPN +<p> + +Create an account on the slave firewall use your favourite tool (e.g. vi, mkdir, chown, chmod) you might create an account on the master also, but I think you want to set up the connection at boot time, so your ordinary root account will do. Can anyone point out risks on using the root account on the master? +<sect1>Generate an ssh key for your master account +<p> + +Use the ssh-keygen program. Set empty password for the private key if you want to do automatic setup of the VPN. +<sect1>Set up automatic ssh login for the slave account +<p> + +Copy the newly generated public key in the slave account under .ssh/authorized_keys, and set up file permissions like the following: +<verb> +drwx------ 2 slave slave 1024 Apr 7 23:49 ./ +drwx------ 4 slave slave 1024 Apr 24 14:05 ../ +-rwx------ 1 slave slave 328 Apr 7 03:04 authorized_keys +-rw------- 1 slave slave 660 Apr 14 15:23 known_hosts +-rw------- 1 slave slave 512 Apr 21 10:03 random_seed +</verb> + +The first row being ˜slave/.ssh, and the second is ˜slave. +<sect1>Tighten ssh security on the bastions. +<p> + +It means the followings on my setup in sshd_conf: +<verb> +PermitRootLogin no +IgnoreRhosts yes +StrictModes yes +QuietMode no +FascistLogging yes +KeepAlive yes +RhostsAuthentication no +RhostsRSAAuthentication no +RSAAuthentication yes +PasswordAuthentication no +PermitEmptyPasswords no +</verb> + +Password authentication is turned off, so login is only possible with authorized keys. (You've turned off telnet and the 'r' commands of course). +<sect1>Enable execution of ppp and route for both accounts. +<p> + +As the master account is the root in my case, it has nothing to do. For the slave account, the following lines appear in /etc/sudoers: +<verb> +Cmnd_Alias VPN=/usr/sbin/pppd,/usr/local/vpn/route +slave ALL=NOPASSWD: VPN +</verb> + +As you can see, I am using some scripts to set up ppp and the routing tables on the slave host. +<sect1>Do the scripting +<p> + +On the master host there is a full-blown init script I am using: +<verb> +#! /bin/sh +# skeleton example file to build /etc/init.d/ scripts. +# This file should be used to construct scripts for /etc/init.d. +# +# Written by Miquel van Smoorenburg <miquels@cistron.nl>. +# Modified for Debian GNU/Linux +# by Ian Murdock <imurdock@gnu.ai.mit.edu>. +# +# Version: @(#)skeleton 1.6 11-Nov-1996 miquels@cistron.nl +# + +PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11/: +PPPAPP=/home/slave/ppp +ROUTEAPP=/home/slave/route +PPPD=/usr/sbin/pppd +NAME=VPN +REDIR=/usr/local/bin/pty-redir +SSH=/usr/bin/ssh +MYPPPIP=192.168.0.1 +TARGETIP=192.168.0.2 +TARGETNET=193.6.37.0 +MYNET=193.6.35.0 +SLAVEWALL=polanski-out +SLAVEACC=slave + +test -f $PPPD || exit 0 + +set -e + +case "$1" in + start) + echo setting up vpn + $REDIR $SSH -o 'Batchmode yes' -t -l $SLAVEACC $SLAVEWALL sudo $PPPAPP >/tmp/device + TTYNAME=`cat /tmp/device` +echo tty is $TTYNAME + sleep 10s + if [ ! -z $TTYNAME ] + then + $PPPD $TTYNAME ${MYPPPIP}:${TARGETIP} + else + echo FAILED! + logger "vpn setup failed" + fi + sleep 5s + route add -net $TARGETNET gw $TARGETIP + $SSH -o 'Batchmode yes' -l $SLAVEACC $SLAVEWALL sudo $ROUTEAPP + ;; + stop) + ps -ax | grep "ssh -t -l $SLAVEACC " | grep -v grep | awk '{print $1}' | xargs kill + ;; + *) + # echo "Usage: /etc/init.d/$NAME {start|stop|reload}" + echo "Usage: /etc/init.d/$NAME {start|stop}" + exit 1 + ;; +esac + +exit 0 + +</verb> + +The slave uses one script for routing setup (/usr/local/vpn/route): +<verb> +#!/bin/bash +/sbin/route add -net 193.6.35.0 gw 192.168.0.1 +</verb> + +and its .ppprc consists of the following: +<verb> +passive +</verb> +<sect>Look at what's happening: +<p> + +The master logs in into the slave, starts pppd, and redirects this all thing into a local pty. It consists of the following steps: +<itemize> +<item>allocating a new pty +<item>sshing into the slave +<item>running pppd on the slave +<item>the master runs pppd in this local pty +<item>and sets up the routing table on the client. +</itemize> + +There are (not very tight) timing considerations involved, this is why that 'sleep 10s'. +<sect>Doing it by hand. +<p> +<sect1>Logging in +<p> + +You've already tried if ssh works well, aren't you? If the slave refuses to log you in, read the logs. Perhaps there are problems with file permissions or the sshd setup. +<sect1>Firing up ppp +<p> + +Log in into slave, and issue: +<verb>sudo /usr/sbin/pppd passive + +</verb> + +You should see garbage coming at this point. If it works good, if not, there is some problem either with sudo, either with pppd. Look what the commands had said, and at the logs and at the <em>/etc/ppp/options</em>, and the <em>.ppprc </em>file. If it works, write this 'passive' word into .ppprc, and try again. To get rid off the garbage and continue working, press enter,'˜' and '^Z'. You should have the master's prompt now, and kill %1. See the section about tuning if you want to know more of the escape character. +<sect1>Together the two +<p> + +Well, then +<verb>ssh -l slave polanski sudo /usr/sbin/pppd + +</verb> + +should work also, and deliver the garbage right into your face. +<sect1>Pty redirecting +<p> + +Try to redirect this whole thing this time: +<verb>/usr/local/bin/pty-redir /usr/bin/ssh -l slave polanski sudo /usr/sbin/pppd + +</verb> + +Nice long sentence isn't it? You should use the full path into the ssh executable, as the pty-redir program allows only this form for security reasons. Now you've got a device name from the program. Let's say, you've got <em>/dev/ttyp0 </em> You can use the ps command to look what has happened. Look for 'p0' +<sect1>Is anything on the device? +<p> + +Try +<verb>/usr/sbin/pppd /dev/ttyp0 local 192.168.0.1:192.168.0.2 + +</verb> + +to establish the connection. Look at the output of the ifconfig command to see if the device has established, and use ping to check your virtual net. +<sect1>Setting up the routes +<p> + +Set up the routes on the master host, and on the slave also. Now you should be able to ping one host in one intranet from other host in the other intranet. Set up the additional firewalling rules. Now as you have the VPN, you can set up the rules concerning the connectivity of the two intranets. +<sect>Tuning +<p> +<sect1>Configuration tuning +<p> + +As I said this HOWTO is mainly a quick memo on how I had set up a VPN. There are things in the configuration I didn't experiment yet. These things will go into their place when I try them, or anyone tells me "it works in the following way" The most important thing is that the connection ppp uses is not 8-bit yet. I believe it has something to do either with ssh configuration or the pty setup. In this configuration ssh uses the tilde (˜) character as an escape character. It might stop or slow down the communication, as any newline-tilde sequence causes ssh to give a prompt. Ssh documentation said: <On most systems, setting the escape character to ``none'' will also make the session transparent even if a tty is used.> The corresponding flag to ssh is '<em>-e</em>', and you can also set it in the configuration file. +<sect1>Bandwith vs. cicles +<p> + +Creating anything virtual comes with utilization of real-world resources. A VPN eats up bandwidth and computing resources. The goal would be to get balance between the two. You can tune it with the '-C' switch or the 'CompressionLevel' option. You might try using another cipher, but I don't recommend it. Also note that the round-trip-time can be longer if you use better compression. Any experiments on it are welcome. +<sect>Vulnerability analisis +<p> + +I try to cover here the vulnerability issues arising from this particular setup and VPNs in general. Any comments are warmly welcome. +<itemize> +<item>sudo: Well, I'm excessively using sudo. I believe it's still safer than using setuid bits. It's still a backdraw of Linux that it hasn't got more fine-grained access control. Waiting for POSIX.6 compatibility <http://www.xarius.demon.co.uk/software/posix6/>. What is worse, there are shell scripts which are getting called through sudo. Bad enough. Any idea out there? +<item>pppd: It runs suid root also. It can be configured by user's .ppprc. There might be some nice buffer overruns in it. The bottom line: secure your slave account as tightly as you can. +<item>ssh: Beware that ssh older than 1.2.20 has security holes. What is worse, we made a configuration such when the master account had been compromised, the slave account is also compromised, and wide open to attacks using the two sudoed programs. It is because I've choosen not to have password on the master's secret key to enable automatic setup of the VPN. +<item>firewall: With inproperly set firewall rules on one bastion, you open both of the intranets. I recommend using IP masquerading (as setting up incorrect routes is a bit less trivial), and doing hard control on the VPN interfaces. +</itemize> + + +<sect1>About the ppp over ssh VPN technique +<p> +I developed this technique when there was no usable, standard +VPN for Linux. Now this is no longer the case. +At the time of writing this, you have the following alternatives: +If you want to use standard IPSEC VPN, you can use FreeS/WAN or pipsecd. +For PPTP you can use PoPToP (but be aware that PPTP protocol has +weaknesses). It is also worth to mention CIPE which is a lightweight +alternative for IPSEC. +<p> +This wide range of alternatives means that the ssh/ppp implementation +described in this howto is in the most cases not the best solution. +This is due the fact that this implementation is complex to set up +and has performance problems because of its tcp based nature. +<p> +I believe that the ssh/ppp technique is no longer beneficial for +building a VPN for non-illegal purposes in most cases, so I have +discontinued maintaining this HOWTO. + + +</article> diff --git a/LDP/retired/WWW-HOWTO.sgml b/LDP/retired/WWW-HOWTO.sgml new file mode 100644 index 00000000..d3f19777 --- /dev/null +++ b/LDP/retired/WWW-HOWTO.sgml @@ -0,0 +1,1222 @@ +<!doctype linuxdoc system> + +<article> + +<title>Linux WWW HOWTO +<author>by Wayne Leister, <tt> +<htmlurl url="mailto:n3mtr@qis.net" name="n3mtr@qis.net"></tt> +<date>v0.82, 19 November 1997 + +<abstract> +This document contains information about setting up WWW services under Linux +(both server and client). It tries not to be a in +detail manual but an overview and a good pointer to further information. +<p> +<bf>Archived Document Notice:</bf> This document has been archived by the LDP +because it is severely out-of-date. If you are interested in maintaining +this document, contact +<htmlurl url="http://tldp.org" name="The Linux Documentation Project">. +</p> +</abstract> + +<toc> + +<!-- Introduction SECTION ================================================== --> + +<sect>Introduction +<p> + +Many people are trying Linux because they are looking for a +really good <em>Internet capable</em> operating system. +Also, there are institutes, universities, non-profits, and small +businesses which want to set up Internet sites on a +small budget. This is where the WWW-HOWTO comes in. This document +explains how to set up clients and servers for the largest +part of the Internet - <em>The World Wide Web</em>. + +All prices in this document are stated in US dollars. This document +assumes you are running Linux on an Intel platform. Instructions and +product availability my vary from platform to platform. There are many +links for downloading software in this document. Whenever possible use a +mirror site for faster downloading and to keep the load down on the main +server. + +The US government +forbids US companies from exporting encryption stronger than 40 bit in +strength. Therefore US companies will usually have two versions of +software. The import version will usually support 128 bit, and the export +only 40 bit. This applies to web browsers and servers supporting secure +transactions. Another name for secure transactions is Secure Sockets Layer +(SSL). We will refer to it as SSL for the rest of this document. + +<sect1>Copyright +<p> +This document is Copyright (c) 1997 by Wayne Leister. +The original author of this document was Peter Dreuw.(All versions prior to 0.8) + +<quote> +This HOWTO is free documentation; you can redistribute it and/or +modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version.</quote> + +<quote> +This document is distributed in the hope that it will be useful, but +without any warranty; without even the implied warranty of +merchantability or fitness for a particular purpose. See the GNU +General Public License for more details.</quote> + +<quote> +You can obtain a copy of the GNU General Public License by writing to +the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, +USA. +</quote> + +Trademarks are owned by there respective owners. + +<sect1>Feedback +<p> +Any feedback is welcome. I do not claim to be an expert. +Some of this information was taken from badly +written web sites; there are bound to be errors and omissions. +But make sure you have the latest version before +you send corrections; It may be fixed in the next version (see the next +section for where to get the latest version). +Send feedback to +<htmlurl url="mailto:n3mtr@qis.net" name="n3mtr@qis.net">. + +<sect1>New versions of this Document +<p> +New versions of this document can be retrieved in text format from Sunsite at +<url url="http://sunsite.unc.edu/pub/Linux/docs/HOWTO/WWW-HOWTO"> and almost any +Linux mirror site. You can view the latest HTML version on the web at +<url url="http://sunsite.unc.edu/LDP/HOWTO/WWW-HOWTO.html">. +There are also HTML versions available on Sunsite in a +tar archive. + + +<!-- WWW = CLIENT SECTION =========================================== --> + + +<sect>Setting up WWW client software +<p> +The following chapter is dedicated to the setting up web browsers. +Please feel free to contact me, if your favorite web browser is not +mentioned here. In this version of the document only a few of the browsers +have there own section, but I tried to include all of them (all I could +find) in the overview section. In the future those browsers that deserve +there own section will have it. + +The overview section is designed to help you decide which browser to use, +and give you basic information on each browser. The detail section is +designed to help you install, configure, and maintain the browser. + +Personally, I prefer the Netscape; it is the only browser that keeps up +with the latest things in HTML. For example, Frames, Java, Javascript, +style sheets, secure transactions, and layers. Nothing is worse than trying +to visit a web site and finding out that you can't view it because your +browser doesn't support some new feature. + +However I use Lynx when I don't feel like firing up the +X-windows/Netscape monster. + +<sect1>Overview +<p> +<descrip> +<tag><ref id="netscape" name="Navigator/Communicator"></tag> Netscape Navigator +is the only browser mentioned here, which is capable of +advanced HTML features. Some of these features are frames, Java, Javascript, +automatic update, +and layers. It also has news and mail capability. But it is a resource hog; +it takes up lots of CPU time and memory. It also sets up a separate cache +for each user wasting disk space. Netscape is a commercial product. +Companies have a 30 day trial period, but there is no limit for individuals. +I would encourage you to register anyway to support Netscape in there efforts +against Microsoft (and what is a measly $40US). My guess is if Microsoft wins, +we will be forced to use MS Internet Explorer on a Windows platform :( + +<tag><ref id="lynx" name="Lynx"></tag> Lynx is the one of the smallest web +browsers. It is the king of text based +browsers. It's free and the source code is available under the GNU public +license. It's text based, but it has many special features. + +<tag/Kfm/ Kfm is part of the K Desktop Environment (KDE). KDE is a system +that runs on top of X-windows. It gives you many features like drag an +drop, sounds, a trashcan and a unified look and feel. Kfm is the K File Manager, but +it is also a web browser. Don't be fooled by the name, for a young product +it is very usable as a web browser. It already supports frames, tables, ftp +downloads, looking into tar files, and more. The current version of Kfm is +1.39, and it's free. Kfm can be used without KDE, but you still need the librarys that +come with KDE. For more information about KDE and Kfm visit the KDE website +at <url url="http://www.kde.org">. + +<tag><ref id="emacs" name="Emacs"></tag> Emacs is the one program that does everything. It is a word processor, +news reader, mail reader, and web browser. It has a steep learning curve at +first, because you have to learn what all the keys do. The X-windows version +is easier to use, because most of the functions are on menus. +Another drawback is that it's mostly text based. (It can display graphics if +you are running it under X-windows). It is also free, and the source code +is available under the GNU public license. + +<tag/NCSA Mosaic/ Mosaic is an X-windows browser developed by the National +Center for Supercomputing Applications (NCSA) at the University of Illinois. +NCSA spent four years on the project and has now moved on to other things. +The latest version is 2.6 which was released on July 7, 1995. Source code +is available for non-commercial use. <url url="http://www.spyglass.com" +name="Spyglass Inc."> has the commercial rights to Mosaic. Its a solid +X-windows browser, but it lacks the new HTML features. For more info visit +the NCSA Mosaic home page at +<url url="http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/">. +The software can be downloaded from +<url url="ftp://ftp.ncsa.uiuc.edu/Mosaic/Unix/binaries/2.6/Mosaic-linux-2.6.Z">. + +<tag/Arena/ Arena was a X-windows concept browser for the W3C (World Wide Web +Consortium) when they were testing HTML 3.0. Hence it supports all the HTML +3.0 standards such as style sheets and tables. Development was taken over +by Yggdrasil Computing, with the idea to turn it into a full fledge free +X-windows browser. However development has stopped in Feb 1997 with version +0.3.11. Only part of the HTML 3.2 standard has been implemented. The +source code is released under the GNU public licence. +For more information see the web site at +<url url="http://www.yggdrasil.com/Products/Arena/">. +It can be downloaded from +<url url="ftp://ftp.yggdrasil.com/pub/dist/web/arena/">. + +<tag/Amaya/ Amaya is the X-windows concept browser for the W3C for HTML 3.2. +Therefore it supports all the HTML 3.2 standards. It also supports some of +the features of HTML 4.0. It supports tables, forms, client side image +maps, put publishing, gifs, jpegs, and png graphics. It is both a browser and +authoring tool. The latest public release is 1.0 beta. Version 1.1 beta +is in internal testing and is due out soon. For more information visit the +Amaya web site at <url url="http://www.w3.org/Amaya/">. +It can be downloaded from +<url url="ftp://ftp.w3.org/pub/Amaya-LINUX-ELF-1.0b.tar.gz">. + +<tag/Red Baron/ Red Baron is an X-windows browser made by Red Hat Software. +It is bundled with +The Official Red Hat Linux distribution. I could not find much information +on it, but I know it supports frames, forms and SSL. +If you use Red Baron, please help me fill in this section. +For more information visit the Red Hat website at +<url url="http://www.redhat.com"> + +<tag/Chimera/ Chimera is a basic X-windows browser. It supports some of the +features of HTML 3.2. The latest release is 2.0 alpha 6 released August 27, +1997. For more information visit the Chimera website at +<url url="http://www.unlv.edu/chimera/">. +Chimera can be downloaded from +<url url="ftp://ftp.cs.unlv.edu/pub/chimera-alpha/chimera-2.0a6.tar.gz">. + +<tag/Qweb/ Qweb is yet another basic X-windows browser. It supports +tables, forms, and server site image maps. The latest version is 1.3. For +more information visit the Qweb website at +<url url="http://sunsite.auc.dk/qweb/"> +The source is available from +<url url="http://sunsite.auc.dk/qweb/qweb-1.3.tar.gz"> +The binaries are available in a Red Hat RPM from +<url url="http://sunsite.auc.dk/qweb/qweb-1.3-1.i386.rpm"> + +<tag/Grail/ Grail is an X-windows browser developed by the Corporation for +National Research Initiatives (CNRI). Grail is written entirely in Python, +a interpreted object-oriented language. The latest version is 0.3 +released on May 7, 1997. It supports forms, bookmarks, history, frames, +tables, and many HTML 3.2 things. + +<tag/Internet Explorer/ There are rumors, that Microsoft is going to port the Internet Explorer to +various Unix platforms - maybe Linux. If its true they are taking +their time doing it. If you know something more reliable, +please drop me an e-mail. +</descrip> + + +In my humble opinion most of the above software is unusable for serious web +browsing. I'm not trying to discredit the authors, I know they worked very +hard on these projects. Just think, if all of these people had worked together +on one project, maybe we would have a free browser that would rival Netscape +and Internet Explorer. + +In my opinion out of all of the broswers, Netscape and Lynx are the best. +The runners up would be Kfm, Emacs-W3 and Mosaic. + + + <!-- Lynx =================================== --> + + +<sect>Lynx<label id="lynx"> +<p> +Lynx is one of the smaller (around 600 K executable) and faster +web browsers available. It does not eat up much bandwidth nor system +resources as it only deals with text displays. It can display on any +console, terminal or xterm. You will not need an <em>X Windows system</em> +or additional system memory to run this little browser. + +<sect1>Where to get +<p> +Both the Red Hat and Slackware distributions have Lynx in them. Therefore I +will not bore you with the details of compiling and installing Lynx. + +The latest version is 2.7.1 and can be retrieved from <url +url="http://www.slcc.edu/lynx/fote/"> or from almost any friendly Linux +FTP server like +<htmlurl url="ftp://sunsite.unc.edu/pub/Linux/apps/www/browsers/" +name="ftp://sunsite.unc.edu under /pub/Linux/apps/www/broswers/"> +or mirror site. + +For more information on Lynx try these locations: +<descrip> +<tag/Lynx Links/ <url url="http://www.crl.com/~subir/lynx.html"> +<tag/Lynx Pages/ <url url="http://lynx.browser.org"> +<tag/Lynx Help Pages/ +<url url="http://www.crl.com/~subir/lynx/lynx_help/lynx_help_main.html"> +(the same pages you get from lynx --help and typing ? in lynx) +</descrip> + +Note: The Lynx help pages have recently moved. If you have an older version +of Lynx, you will need to change your lynx.cfg (in /usr/lib) to point to the +new address(above). + +I think the most special feature of Lynx against all other +web browsers is the capability for batch mode retrieval. One can write +a shell script which retrieves a document, file or anything like that +via <em/http/, <em/FTP/, <em/gopher/, <em/WAIS/, <em/NNTP/ or +<em>file://</em> - url's and save it to disk. +Furthermore, one can fill in data into HTML forms in batch mode by simply +redirecting the standard input and using the <em/-post_data/ option. + +For more special features of Lynx just look at the help files and the man +pages. If you use a special feature of Lynx that you would like to see +added to this document, let me know. + + <!-- Emacs W3 ================================= --> + +<sect>Emacs-W3<label id="emacs"> +<p> +There are several different flavors of Emacs. The two most popular are +GNU Emacs and XEmacs. GNU Emacs is put out by the Free Software +Foundation, and is the original Emacs. It is mainly geared toward text based +terminals, but it does run in X-Windows. XEmacs (formerly Lucid Emacs) +is a version that only runs on X-Windows. It has many special features that +are X-Windows related (better menus etc). + +<sect1>Where to get +<p> + +Both the Red Hat and Slackware distributions include GNU Emacs. + +The most recent GNU emacs is 19.34. It doesn't seem to +have a web site. The FTP site is +at <url url="ftp://ftp.gnu.ai.mit.edu/pub/gnu/">. + +The latest version of XEmacs is 20.2. The XEmacs FTP site is at +<url url="ftp://ftp.xemacs.org/pub/xemacs">. +For more information about XEmacs goto see its web page at +<url url="http://www.xemacs.org">. + +Both are available from the Linux archives at +<htmlurl url="ftp://sunsite.unc.edu/pub/Linux/apps/editors/emacs/" +name="ftp://sunsite.unc.edu under /pub/Linux/apps/editors/emacs/"> + + +If you got GNU Emacs or XEmacs installed, you probably got the W3 browser +running to. + +The Emacs W3 mode is a nearly fully featured web browser system +written in the Emacs Lisp system. It mostly deals with text, but can +display graphics, too - at least - if you run the emacs under the X Window +system. + +To get XEmacs in to W3 mode, goto the apps menu and select browse the web. + +I don't use Emacs, so if someone will explain how to get it into the W3 mode +I'll add it to this document. Most of this information was from the +original author. If any information is incorrect, please let me know. Also +let me know if you think anything else should be added about Emacs. + + + <!-- Netscape Navigator/Communicator ======================= --> + + +<sect>Netscape Navigator/Communicator<label id="netscape"> +<p> +<sect1>Different versions and options. +<p> +Netscape Navigator is the King of WWW browsers. Netscape Navigator can do +almost everything. But on the other hand, it is one of the most memory hungry +and resource eating program I've ever seen. + +There are 3 different versions of the program: + +Netscape Navigator includes the web browser, netcaster (push client) +and a basic mail program. + +Netscape Communicator includes the web browser, a web editor, an advanced +mail program, a news reader, netcaster (push client), and a +group conference utility. + +Netscape Communicator Pro includes everything Communicator has plus a group +calendar, IBM terminal emulation, and remote administration features (administrators +can update thousands of copies of Netscape from their desk). + +In addition to the three versions there are two other options you must pick. + +The first is full install or base install. The full install includes +everything. The base install includes enough to get you started. You can +download the additional components as you need them (such as multimedia +support and netcaster). These components can be installed by the Netscape +smart update utility (after installing goto help->software updates). At +this time the full install is not available for Linux. + +The second option is import or export. If you are from the US are Canada +you have the option of selecting the import version. This gives you the +stronger 128 bit encryption for secure transactions (SSL). The export version +only has 40 bit encryption, and is the only version allowed outside the US +and Canada. + +The latest version of the Netscape Navigator/Communicator/Communicator Pro +is 4.03. There are two different versions for Linux. One is for the old +1.2 series kernels and one for the new 2.0 kernels. If you don't have a 2.0 +kernel I suggest you upgrade; there are many improvements in the new kernel. + +Beta versions are also available. If you try a beta version, they +usually expire in a month or so! + +<sect1>Where to get +<p> + +The best way to get Netscape software is to go through their web site at +<url url="http://www.netscape.com/download/">. They have menu's to guide +you through the selection. When it ask for the Linux version, it is +referring to the kernel (most people should be using 2.0 by now). If your +not sure which version kernel you have run 'cat /proc/version'. +Going through the web site is the only way to get the import versions. + +If you want an export version you can download them +directly from the Netscape FTP servers. The FTP servers are also more up to +date. For example when I first wrote this the web interface did not have the +non-beta 4.03 for Linux yet, but it was on the FTP site. Here are the links +to the export Linux 2.0 versions: + +Netscape Navigator 4.03 is at +<url url="ftp://ftp.netscape.com/pub/communicator/4.03/shipping/english/unix/linux20/navigator_standalone/navigator-v403-export.x86-unknown-linux2.0.tar.gz"> + +Netscape Communicator 4.03 for Linux 2.0 (kernel) is at +<url url="ftp://ftp.netscape.com/pub/communicator/4.03/shipping/english/unix/linux20/base_install/communicator-v403-export.x86-unknown-linux2.0.tar.gz"> + +Communicator Pro 4.03 for Linux was not available at the time I wrote this. + +These url's will change as new versions come out. If these links break you +can find them by fishing around at the FTP site +<url url="ftp://ftp.netscape.com/pub/communicator/">. + +These servers are heavily loaded at times. Its best to wait for off peak +hours or select a mirror site. Be prepared to wait, these +archives are large. Navigator is almost 8megs, and Communicator base +install is 10megs. + +<sect1>Installing +<p> +This section explains how to install version 4 of Netscape Navigator, +Communicator, and Communicator Pro. + +First unpack the archive to a temporary directory. +Then run the <tt/ns-install/ script (type <tt>./ns-install</tt>). Then make a symbolic link +from the <tt>/usr/local/netscape/netscape</tt> binary to +<tt>/usr/local/bin/netscape</tt> +(type <tt>ln -s /usr/local/netscape/netscape /usr/local/bin/netscape</tt>). +Finally set the system wide environment variable <tt>$MOZILLA_HOME</tt> to +<tt>/usr/local/netscape</tt> so Netscape can find its files. If you are using bash +for your shell edit your <tt>/etc/profile</tt> and add the lines: + +<tscreen><verb> +MOZILLA_HOME="/usr/local/netscape" +export MOZILLA_HOME +</verb></tscreen> + +After you have it installed the software can automatically update itself +with smart update. +Just run Netscape as root and goto help->software updates. If you only got +the base install, you can also install the Netscape components from there. + +Note: This will not remove any old versions of Netscape, you must manually +remove them by deleting the Netscape binary and Java class file +(for version 3). + +<!-- WWW - SERVER SECTION ======================================== --> + + +<sect>Setting up WWW server systems +<p> +This section contains information on different http server software +packages and additional server side tools like script languages for +CGI programs etc. There are several dozen web servers, I only covered those +that are fully functional. As some of these are commercial products, +I have no way of trying +them. Most of the information in the overview section was pieced together +from various web sites. +If there is any incorrect or missing information please let me know. + +For a technical description on the http mechanism, take a look at +the RFC documents mentioned in the chapter "For further reading" of +this HOWTO. + +I prefer to use the Apache server. It has almost all the features you would +ever need and its free! I will admit that this section is heavily biased +toward Apache. I decided to concentrate my efforts on the Apache section +rather than spread it out over all the web servers. I may cover other web +servers in the future. + + + <!-- Overview =============================== --> + + +<sect1>Overview +<p> +<descrip> +<tag/Cern httpd/ This was the first web server. It was developed by the +European Laboratory for Particle Physics (CERN). CERN httpd is no longer +supported. The CERN httpd server +is reported to have some ugly bugs, to be quite slow and resource hungry. +The latest version is 3.0. For more information visit the CERN httpd home +page at <url url="http://www.w3.org/Daemon/Status.html">. +It is available for download at +<url url="ftp://sunsite.unc.edu/pub/Linux/apps/www/servers/httpd-3.0.term.tpz"> +(no it is not a typo, the extension is actually .tpz on the site; probably +should be .tgz) + +<tag/NCSA HTTPd/ The NCSA HTTPd server is the father to Apache (The +development split into two different servers). Therefore the setup files +are very similar. NCSA HTTPd is free and the source code is available. +This server not covered in this document, although +reading the Apache section may give you some help. The NCSA server was once +popular, but most people are replacing it with Apache. Apache is a drop in +replacement for the NCSA server(same configuration files), and it fixes several +shortcomings of the NCSA server. NCSA HTTPd accounts for 4.9% (and +falling) of all web servers. (source September 1997 +<url url="http://www.netcraft.com/survey/" name="Netcraft survey">). +The latest version is 1.5.2a. For +more information see the NCSA website at <url url="http://hoohoo.ncsa.uiuc.edu">. + +<tag><ref id="apache" name="Apache"></tag> Apache is the king of all web +servers. Apache and its source code is free. Apache is modular, therefore +it is easy to add features. Apache is very flexible and has many, many +features. Apache +and its derivatives makes up 44% of all web domains (50% if you count all +the derivatives). +There are over 695,000 Apache servers in operation (source November 1997 +<url url="http://www.netcraft.com/survey/" name="Netcraft survey">). + +The official Apache is missing SSL, but there are two +derivatives that fill the gap. Stronghold is a commercial product that is +based on Apache. It retails for $995; an economy version is available for +$495 (based on an old version of Apache). Stronghold is the number two +secure server behind Netscape (source +<url url="http://www.c2.net/products/stronghold" name="C2 net"> and +<url url="http://www.netcraft.com/survey/" name="Netcraft survey">). +For more information visit the Stronghold website at +<url url="http://www.c2.net/products/stronghold/">. It was developed +outside the US, so it is available with 128 bit SSL everywhere. + +Apache-SSL is a free implementation of SSL, but it is not for commercial use +in the US (RSA has US patents on SSL technology). It can be used for +non-commercial use in the US if you link with the free RSAREF library. For +more information see the website at +<url url="http://www.algroup.co.uk/Apache-SSL/">. + +<tag/Netscape Fast Track Server/ Fast Track was developed by Netscape, but the +Linux version is put out by Caldera. The Caldera site lists it as Fast +Track for OpenLinux. I'm not sure if it only runs on Caldera OpenLinux or +if any Linux distribution will do (E-mail me if you have the answer). +Netscape servers account for 11.5% (and falling) of all web servers (source +September 1997 <url url="http://www.netcraft.com/survey/">). +The server sells for $295. It is also included with the Caldera OpenLinux +Standard distribution which sells for $399 ($199.50 educational). The web +pages tell of a nice administration interface and +a quick 10 minute setup. The server has support for 40-bit SSL. +To get the full 128-bit SSL you need +Netscape Enterprise Server. Unfortunately that is not available for Linux :( +The latest version available for Linux is 2.0 (Version 3 is in beta, but its +not available for Linux yet). +To buy a copy goto the Caldera web site at +<url url="http://www.caldera.com/products/netscape/netscape.html"> +For more information goto the Fast Track page at +<url url="http://www.netscape.com/comprod/server_central/product/fast_track/"> + + +<tag/WN/ WN has many features that make it attractive. First it is smaller +than the CERN, NCSA HTTPd, an Apache servers. It also has many built-in +features that would require CGI's. For example site searches, enhanced +server side includes. It can also decompress/compress files on the fly +with its filter feature. It also has the ability to retrieve only part of a +file with its ranges feature. It is released under the GNU public license. +The current version is 1.18.3. For more information see the WN website at +<url url="http://hopf.math.nwu.edu/">. + +<tag/AOLserver/ AOLserver is made by America Online. I'll admit that I +was surprised by the features of a web server coming from AOL. In addition +to the standard features it supports database connectivity. Pages can query +a database by Structured Query Language (SQL) commands. The database is +access through Open Database Connectivity (ODBC). It also has built-in +search engine and TCL scripting. If that is not enough you can add your own +modules through the c Application Programming Interface (API). I almost +forgot to mention support for 40 bit SSL. And you get all this for free! +For more information visit the AOLserver site at +<url url="http://www.aolserver.com/server/"> + +<tag/Zeus Server/ Zeus Server was developed by Zeus Technology. They claim +that they are the fastest web server (using WebSpec96 benchmark). The +server can be configured and controlled from a web browser! It can limit processor and memory +resources for CGI's, and it executes them in a secure environment (whatever +that means). It also supports unlimited virtual servers. It sells for $999 +for the standard version. If you want the secure server (SSL) the price jumps +to $1699. They are based outside the US so 128 bit SSL is available +everywhere. For more information visit the Zeus Technology website at +<url url="http://www.zeus.co.uk">. The US website is at +<url url="http://www.zeus.com">. +I'll warn you they are cocky about the +fastest web server thing. But they don't even show up under top web servers +in the Netcraft Surveys. + +<tag/CL-HTTP/ CL-HTTP stands for Common Lisp Hypermedia Server. If you are +a Lisp programmer this server is for you. You can write your CGI scripts in +Lisp. It has a web based setup function. It also supports all the standard +server features. CL-HTTP is free and the source code is available. +For more information visit the CL-HTTP website at +<url url="http://www.ai.mit.edu/projects/iiip/doc/cl-http/home-page.html"> +(could they make that url any longer?). +</descrip> + +If you have a commercial purpose (company web site, or ISP), I would +strongly recommend that you use Apache. If you are looking for easy setup at the +expense of advanced features then the Zeus Server wins hands down. I've +also heard that the Netscape Server is easy to setup. +If you have an internal use you can be a bit more flexible. +But unless one of them has a feature that you just have to use, I +would still recommend using one of the three above. + +This is only a partial listing of all the servers available. For a more +complete list visit Netcraft at +<url url="http://www.netcraft.com/survey/servers.html"> or Web Compare at +<url url="http://webcompare.internet.com">. + + <!-- Apache httpd ============================= --> + + +<sect>Apache<label id="apache"> +<p> +The current version of Apache is 1.2.4. Version 1.3 is in beta testing. +The main Apache site is at +<url url="http://www.apache.org/">. Another good source of information is +Apacheweek at +<url url="http://www.apacheweek.com/">. +The Apache documentation is ok, so I'm not going to go into detail in setting +up apache. The documentation is on the website and is +included with the source (in HTML format). There are also text files +included with the source, but the HTML version is better. The documentation +should get a whole lot better once the Apache Documentation Project gets +under way. Right now most of the documents are written by the developers. +Not to discredit the developers, but they are a little hard to understand +if you don't know the terminology. + +<sect1>Where to get +<p> +Apache is included in the Red Hat, Slackware, and OpenLinux distributions. +Although they may not be the latest version, they are very reliable +binaries. The bad news is you will have to live with their directory +choices (which are totally different from each other and the Apache defaults). + +The source is available from the Apache web site at +<url url="http://www.apache.org/dist/"> +Binaries are are also available at apache at the same place. +You can also get binaries from sunsite at +<url url="ftp://sunsite.unc.edu/pub/Linux/apps/www/servers/">. +And for those of us running Red Hat the latest binary RPM file can usually +be found in the contrib directory at +<url url="ftp://ftp.redhat.com/pub/contrib/i386/"> + +If your server is going to be used for commercial purposes, it is highly +recommended that you get the source from the Apache website and compile it +yourself. The other option is to use a binary that comes with a major +distribution. For example Slackware, Red Hat, or OpenLinux distributions. The +main reason for this is security. An unknown binary could have a back door for +hackers, or an unstable patch that could crash your system. This also gives +you more control over what modules are compiled in, and allows you to set +the default directories. It's not that difficult to compile Apache, and +besides you not a real Linux user until you compile your own programs ;) + + +<sect1>Compiling and Installing +<p> +First untar the archive to a temporary directory. Next change to the src +directory. Then edit the Configuration file if you want to include any special +modules. The most +commonly used modules are already included. There is no need to change the +rules or makefile stuff for Linux. Next run the Configure shell script +(<tt>./Configure</tt>). Make sure it says Linux platform and gcc as the compiler. +Next you may want to edit the httpd.h file to change the default directories. +The server home (where the config files are kept) default is +<tt>/usr/local/etc/httpd/</tt>, but you may want to change +it to just <tt>/etc/httpd/</tt>. And the server root (where the HTML pages are +served from) default is +<tt>/usr/local/etc/httpd/htdocs/</tt>, but I like the directory +<tt>/home/httpd/html</tt> (the +Red Hat default for Apache). If you are going to be using su-exec (see +special features below) you +may want to change that directory too. The server root can also be changed from the +config files too. But it is also good to compile it in, just encase Apache +can't find or read the config file. Everything else should be changed +from the config files. +Finally run make to compile Apache. + +If you run in to problems with include files missing, check the following +things. Make sure you have the kernel headers (include files) installed for +your kernel version. Also make sure you have these symbolic links in place: +<tscreen><verb> +/usr/include/linux should be a link to /usr/src/linux/include/linux +/usr/include/asm should be a link to /usr/src/linux/include/asm +/usr/src/linux should be a link to the Linux source directory (ex.linux-2.0.30) +</verb></tscreen> +Links can be made with <tt>ln -s</tt>, it works just like the cp command except it +makes a link (<tt>ln -s source-dir destination-link</tt>) + +When make is finished there should be an executable named httpd in the +directory. This needs to be moved in to a bin directory. +<tt>/usr/sbin</tt> or +<tt>/usr/local/sbin</tt> would be good choices. + +Copy the conf, logs, and icons sub-directories from the source to the server +home directory. Next rename 3 of the files files in the conf sub-directory +to get rid of the <tt>-dist</tt> extension (ex. <tt>httpd.conf-dist</tt> becomes +<tt/httpd.conf/) + +There are also several support programs that are included with Apache. They +are in the <tt/support/ directory and must be compiled and installed separately. +Most of them can be make by using the makefile in that directory (which is +made when you run the main <tt/Configure/ script). You don't need any of them to +run Apache, but some of them make the administrators job easier. + +<sect1>Configuring +<p> +Now you should have four files in your <tt/conf/ sub-directory (under +your server home directory). The <tt/httpd.conf/ sets up the server daemon (port +number, user, etc). The <tt/srm.conf/ sets the root document tree, special +handlers, etc. The <tt/access.conf/ sets the base case for access. Finally +<tt/mime.types/ tells the server what mime type to send to the browser for each +extension. + +The configuration files are pretty much self-documented (plenty of +comments), as long as you understand the lingo. You should read through +them thoroughly before putting your server to work. Each configuration +item is covered in the Apache documentation. + +The <tt/mime.types/ file is not really a configuration file. It is used by the +server to translate file extensions into mime-types to send to the browser. +Most of the common mime-types are already in the file. Most people should +not need to edit this file. As time goes on, more mime types will be added +to support new programs. The best thing to do is get a new mime-types file +(and maybe a new version of the server) at that time. + +Always remember when you change the configuration files you need to restart +Apache or send it the SIGHUP signal with <tt/kill/ for the changes to take +effect. Make sure you send the signal to the parent process and not any of +the child processes. The parent usually has the lowest process id number. The +process id of the parent is also in the <tt/httpd.pid/ file in the log +directory. If you accidently send it to one of the child processes the +child will die and the parent will restart it. + +I will not be walking you through the steps of configuring Apache. Instead +I will deal with specific issues, choices to be made, and special features. + +I highly recommend that all users read through the security tips in the +Apache documentation. It is also available from the Apache website at +<url url="http://www.apache.org/docs/mics/security_tips.html">. + +<sect1>Hosting virtual websites +<p> +Virtual Hosting is when one computer has more than one domain name. The old +way was to have each virtual host have its own IP address. The new way uses +only one IP address, but it doesn't work correctly with browsers that don't +support HTTP 1.1. + +My recommendation for businesses is to go with the IP based virtual +hosting until most people have browsers that support HTTP 1.1 (give it a year +or two). This also gives you a more complete illusion of virtual +hosting. While both methods can give you virtual mail capabilities (can +someone confirm this?), only IP +based virtual hosting can also give you virtual FTP as well. + +If it is for a club or personal page, you may want to consider +shared IP virtual hosting. +It should be cheaper than IP based hosting and you will be saving +precious IP addresses. + +You can also mix and match IP and shared IP virtual hosts on the same +server. For more information on virtual hosting visit Apacheweek at <url +url="http://www.apacheweek.com/features/vhost">. + +<sect2>IP based virtual hosting +<p> +In this method each virtual host has its own IP address. By determining the +IP address that the request was sent to, Apache and other programs can tell +what domain to serve. This is an incredible waste of IP space. Take for +example the servers where my virtual domain is kept. They have over 35,000 +virtual accounts, that means 35,000 IP addresses. Yet I believe at last +count they had less than 50 servers running. + +Setting this up is a two part process. The first is getting Linux setup +to accept more than one IP address. The second is setting up apache to serve +the virtual hosts. + +The first step in setting up Linux to accept multiple IP addresses is to +make a new kernel. This works best with a 2.0 series kernel (or higher). +You need to include IP networking and IP aliasing +support. If you need help with compiling the kernel see the +<url name="kernel howto" +url="http://sunsite.unc.edu/LDP/HOWTO/Kernel-HOWTO.html">. + +Next you need to setup each interface at boot. If you are using the Red Hat +Distribution then +this can be done from the control panel. Start X-windows as root, you +should see a control panel. Then double click on network configuration. +Next goto the interfaces panel and select your network card. Then click +alias at the bottom of the screen. Fill in the information and click done. +This will need to be done for each virtual host/IP address. + +If you are using other distributions you may have to do it manually. +You can just put the commands in the <tt/rc.local/ file in +<tt>/etc/rc.d</tt> (really they should go in with the networking +stuff). You need to have a <tt/ifconfig/ and <tt/route/ command for each device. The +aliased addresses are given a sub device of the main one. For example eth0 +would have aliases eth0:0, eth0:1, eth0:2, etc. Here is an example of +configuring a aliased device: +<tscreen><verb> +ifconfig eth0:0 192.168.1.57 +route add -host 192.168.1.57 dev eth0:0 +</verb></tscreen> +You can also add a broadcast address and a netmask to the ifconfig command. +If you have alot of aliases you may want to make a for loop to make it +easier. For more information see the +<url name="IP alias mini howto" url="http://sunsite.unc.edu/LDP/HOWTO/mini/IP-Alias.html">. + +Then you need to setup your domain name server (DNS) to serve these new +domains. And if you don't already own the domain names, you need to +contact the <url name="Internic" url="http://www.internic.net"> to register +the domain names. See the DNS-howto for information on setting up your DNS. + +Finally you need to setup Apache to server the virtual domain correctly. +This is in the <tt/httpd.conf/ configuration file near the end. They give you an +example to go by. All commands specific to that virtual host are put in +between the <tt/virtualhost/ directive tags. You can put almost any command in there. +Usually you set up a different document root, script directory, and log +files. You can have almost unlimited number of virtual hosts by adding +more <tt/virtualhost/ directive tags. + +In rare cases you may need to run separate servers if a directive is needed +for a virtual host, +but is not allowed in the virtual host tags. This is done using the +bindaddress directive. Each server will have a different name and setup +files. Each server only responds to one IP address, specified by the +bindaddress directive. This is an incredible waste of system resources. + +<sect2>Shared IP virtual hosting +<p> +This is a new way to do virtual hosting. It uses a single IP address, +thus conserving IP addresses for real machines (not virtual ones). In the +same example used above those 30,000 virtual hosts would only take 50 IP +addresses (one for each machine). +This is done by using the new HTTP 1.1 protocol. The browser tells the server which +site it wants when it sends the request. The problem is browsers that don't +support HTTP 1.1 will get the servers main page, which could be setup to +provide a menu of virtual hosts available. That +ruins the whole illusion of virtual hosting. The illusion that you have +your own server. + +The setup is much simpler than the IP based virtual hosting. You still need +to get your domain from the Internic and setup your DNS. This time the DNS +points to the same IP address as the original domain. Then Apache is setup +the same as before. Since you are using the same IP address in the +virtualhost tags, it knows you want Shared IP virtual hosting. + +There are several work arounds for older browsers. I'll explain the best +one. First you need to make your main pages a virtual host (either IP based +or shared IP). This +frees up the main page for a link list to all your virtual hosts. Next you +need to make a back door for the old browsers to get in. This is done using +the <tt/ServerPath/ directive for each virtual host inside the +<tt/virtualhost/ +directive. For example by adding <tt>ServerPath /mysite/</tt> to www.mysite.com old +browsers would be able to access the site by www.mysite.com/mysite/. Then +you put the default page on the main server that politely tells them to get +a new browser, and lists links to all the back doors of all the sites you +host on that machine. When an old browser accesses the site they will be +sent to the main page, and get a link to the correct page. New browsers +will never see the main page and will go directly to the virtual hosts. You +must remember to keep all of your links relative within the web sites, +because the pages will be accessed from two different URL's (www.mysite.com +and www.mysite.com/mysite/). + +I hope I didn't lose you there, but its not an easy workaround. Maybe you +should consider IP based hosting after all. A very similar workaround is +also explained on the apache website at +<url url="http://www.apache.org/manual/host.html">. + +If anyone has a great resource +for Shared IP hosting, I would like to know about it. It would be nice to +know what percent of browsers out there support HTTP 1.1, and to have a +list of which browsers and versions support HTTP 1.1. + +<sect1>CGI scripts +<p> +There are two different ways to give your users CGI script capability. The +first is make everything ending in <tt/.cgi/ a CGI script. The second is to make +script directories (usually named <tt/cgi-bin/). You +could also use both methods. For either method to work the scripts must be +world executable (<tt/chmod 711/). By giving your users script +access you are creating a big security risk. Be sure to do your homework to +minimize the security risk. + +I prefer the first method, especially for complex scripting. It allows you +to put scripts in any directory. I like to put my scripts with the web pages +they work with. For sites with allot of scripts it looks much better than +having a directory full +of scripts. This is simple to setup. First uncomment the <tt/.cgi/ handler +at the end of the <tt/srm.conf/ file. Then make sure all your directories have +the <tt/option ExecCGI/ or <tt/All/ in the <tt/access.conf/ file. + +Making script directories is considered more secure. +To make a script directory you use the ScriptAlias directive in the +<tt/srm.conf/ file. The first argument is the Alias the second is the actual +directory. For example <tt>ScriptAlias /cgi-bin/ /usr/httpd/cgi-bin/</tt> would make +<tt>/usr/httpd/cgi-bin</tt> able to execute scripts. That directory would be used +whenever someone asked for the directory <tt>/cgi-bin/</tt>. For security reasons +you should also change +the properties of the directory to <tt>Options none, AllowOveride none</tt> in the +<tt/access.conf/ (just uncomment the example that is there). Also do not make +your script directories subdirectories of your web page directories. +For example if you are serving pages from <tt>/home/httpd/html/</tt>, don't make the +script directory <tt>/home/httpd/html/cgi-bin</tt>; Instead make it +<tt>/home/httpd/cgi-bin</tt>. + +If you want your users to have there own script directories you can use +multiple <tt/ScriptAlias/ commands. Virtual hosts should have there +<tt/ScriptAlias/ command inside the <tt/virtualhost/ directive tags. +Does anyone know a simple way to allow +all users to have a cgi-bin directory without individual ScriptAlias +commands? + + +<sect1>Users Web Directories +<p> +There are two different ways to handle user web directories. The first is to +have a subdirectory under the users home directory (usually <tt/public_html/). +The second is to have an entirely different directory tree for web directories. +With both methods make sure set the access options for these directories +in the <tt/access.conf/ file. + +The first method is already setup in apache by default. Whenever a request +for <tt>/~bob/</tt> comes in it looks for the <tt/public_html/ directory in bob's +home directory. You can change the directory with the <tt/UserDir/ directive in +the <tt/srm.conf/ file. This directory must be world readable and executable. +This method creates a security risk because for Apache to +access the directory the users home directory must be world executable. + +The second method is easy to setup. You just need to change the +<tt>UserDir</tt> directive in the <tt>srm.conf</tt> file. It has many +different formats; you may want +to consult the Apache documentation for clarification. If you want each +user to have their own directory under <tt>/home/httpd/</tt>, you would use +<tt>UserDir /home/httpd</tt>. Then when the request <tt>/~bob/</tt> comes in it would translate to +<tt>/home/httpd/bob/</tt>. Or if you want to have a subdirectory under bob's +directory you would use <tt>UserDir /home/httpd/*/html</tt>. This would translate to +<tt>/home/httpd/bob/html/</tt> and would allow you to have a script directory +too (for example <tt>/home/httpd/bob/cgi-bin/</tt>). + +<sect1>Daemon mode vs. Inetd mode +<p> +There are two ways that apache can be run. One is as a daemon that is +always running (Apache calls this standalone). The second is from the +inetd super-server. + +Daemon mode is far superior to inetd mode. Apache is setup for daemon mode +by default. The only reason to use the inetd mode is for very +low use applications. Such as internal testing of scripts, +small company Intranet, etc. Inetd mode will save memory because apache +will be loaded as needed. Only the inetd daemon will remain in memory. + +If you don't use apache that often you may just want to keep it in daemon +mode and just start it when you need it. Then you can kill it when you are +done (be sure to kill the parent and not one of the child processes). + +To setup inetd mode you need to edit a few files. First in +<tt>/etc/services</tt> +see if http is already in there. If its not then add it: +<tscreen><verb> +http 80/tcp +</verb></tscreen> +Right after 79 (finger) would be a good place. Then you need to edit the +<tt>/etc/inetd.conf</tt> file and add the line for Apache: +<tscreen><verb> +http stream tcp nowait root /usr/sbin/httpd httpd +</verb></tscreen> +Be sure to change the path if you have Apache in a different location. And +the second httpd is not a typo; the inet daemon requires that. If you are +not currently using the inet daemon, you may want to comment out the rest of +the lines in the file so you don't activate other services as well (FTP, +finger, telnet, and many other things are usually run from this daemon). + +If you are already running the inet deamon (<tt/inetd/), then you only need to +send it the SIGHUP signal (via kill; see kill's man page for more info) or +reboot the computer for changes to take effect. If you are not running +<tt>inetd</tt> then you can start it manually. You should also add it to your +init files so it is loaded at boot (the <tt/rc.local/ file may be a good +choice). + +<sect1>Allowing put and delete commands +<p> +The newer web publishing tools support this new method of uploading web +pages by http (instead of FTP). Some of these products don't even support +FTP anymore! Apache does support this, but it is lacking a script to handle +the requests. This script could be a big security hole, be sure you know +what you are doing before attempting to write or install one. + +If anyone knows of a script that works let me know and I'll include the +address to it here. + +For more information goto Apacheweek's article at +<url url="http://www.apacheweek.com/features/put">. + +<sect1>User Authentication/Access Control +<p> +This is one of my favorite features. It allows you to password protect a +directory or a file without using CGI scripts. It also allows you to deny +or grant access based on the IP address or domain name of the client. That +is a great feature for keeping jerks out of your message boards and +guest books (you get the IP or domain name from the log files). + +To allow user authentication the directory must have <tt>AllowOverrides +AuthConfig</tt> set in the <tt/access.conf/ file. To allow access control (by domain +or IP address) AllowOverrides Limit must be set for that directory. + +Setting up the directory involves putting an <tt/.htaccess/ file in the +directory. For user authentication it is usually used with +an <tt/.htpasswd/ and optionally a <tt/.htgroup/ file. Those files can be shared among +multiple <tt/.htaccess/ files if you wish. + +For security reasons I recommend that everyone use these directives in there +access.conf file: + +<tscreen><verb> +<files ~ "/\.ht"> +order deny,allow +deny from all +</files> +</verb></tscreen> + +If you are not the administrator of the system you can also put it in your +.htaccess file if AllowOverride Limit is set for your directory. +This directive will prevent people from looking into your access control files + (.htaccess, .htpasswd, etc). + +There are many different options and file types that can be used with access +control. Therefore it is beyond the scope of this document to describe the +files. For information on how to setup User Authentication see the Apacheweek +feature at +<url url="http://www.apacheweek.com/features/userauth"> or the NCSA pages +at <url url="http://hoohoo.ncsa.uiuc.edu/docs-1.5/tutorials/user.html">. + +<sect1>su-exec +<p> +The su-exec feature runs CGI scripts as the user of the owner. Normally it +is run as the user of the web server (usually nobody). This allows users to +access there own files in CGI scripts without making them world +writable (a security hole). But if you are not careful you can create a +bigger security hole by using the su-exec code. The su-exec code does +security checks before executing the scripts, but if you set it up wrong you +will have a security hole. + +The su-exec code is not for amateurs. Don't use it if you don't know what +you are doing. You could end up with a gaping security hole where your +users can gain root access to your system. Do not modify the code for any +reason. Be sure to read all the documentation carefully. The su-exec code +is hard to setup on purpose, to keep the amateurs out (everything must be +done manually, no make file no install scripts). + +The su-exec code resides in the <tt/support/ directory of the source. First you +need to edit the <tt/suexec.h/ file for your system. Then you need to compile +the su-exec code with this command: +<tscreen><verb> +gcc suexec.c -o suexec +</verb></tscreen> +Then copy the suexec executable to the proper directory. The Apache default is +<tt>/usr/local/etc/httpd/sbin/</tt>. This can be changed by editing +<tt/httpd.h/ in the +Apache source and recompiling Apache. Apache will only look in this directory, +it will not search the path. Next the file needs to be changed to user root +(<tt/chown root suexec/) and the suid bit needs to be set +(<tt/chmod 4711 suexec/). +Finally restart Apache, it should display a message on the console that +su-exec is being used. + +CGI scripts should be set world executable like normal. They will +automaticaly be run as the owner of the CGI script. If you set the SUID (set user id) bit on the +CGI scripts they will not run. If the directory or file is world or group +writable the script will not run. Scripts owned by system users will not be +run (root, bin, etc.). For other security conditions that must +be met see the su-exec documentation. If you are having problems see the +su-exec log file named <tt/cgi.log/. + +Su-exec does not work if you are running Apache from inetd, it only +works in daemon mode. It will be fixed in the next version because there +will be no inetd mode. If you +like playing around in source code, you can edit the http_main.c. You want +to get rid of the line where Apache announces that it is using the su-exec +wrapper (It wrongly prints this in front of the output of everything). + +Be sure and read the Apache documentation on su-exec. It is included with +the source and is available on the Apache web site at +<url url="http://www.apache.org/docs/suexec.html"> + +<sect1>Imagemaps +<p> +Apache has the ability to handle server side imagemaps. Imagemaps are +images on webpages that take users to different locations depending on +where they click. To enable imagemaps first make sure the imagemap module +is installed (its one of the default modules). Next you need to uncomment +the <tt/.map/ handler at the end of the <tt/srm.conf/ file. Now all files ending in +<tt/.map/ will be imagemap files. Imagemap files map different areas on the +image to separate links. Apache uses map files in the standard NCSA +format. Here is an example of using a map file in a web page: +<tscreen><verb> +<a href="/map/mapfile.map"> +<img src="picture.gif" ISMAP> +</a> +</verb></tscreen> +In this example <tt/mapfile.map/ is the mapfile, and <tt/picture.gif/ is the image to +click on. + +There are many programs that can generate NCSA compatible map files or you +can create them yourself. For a more detailed discussion of imagemaps and +map files see the Apacheweek feature at +<url url="http://www.apacheweek.com/features/imagemaps">. + +<sect1>SSI/XSSI +<p> +Server Side Includes (SSI) adds dynamic content to otherwise static web +pages. The includes are embedded in the web page as comments. The web +server then parses these includes and passes the results to the web +server. SSI can add headers and footers to documents, add date the +document was last updated, execute a system command or a CGI script. With +the new eXtended Server Side Includes (XSSI) you can do a whole lot more. +XSSI adds variables and flow control statements (if, else, etc). +Its almost like having an programming language to work with. + +Parsing all HTML files for SSI commands would waste allot of system +resources. Therefore you need to distinguish normal HTML files from those +that contain SSI commands. This is usually done by changing the extension +of the SSI enhanced HTML files. Usually the <tt/.shtml/ extension is used. + +To enable SSI/XSSI first make sure that the includes module is installed. +Then edit <tt/srm.conf/ and uncomment the <tt/AddType/ and <tt/AddHandler/ directives for +<tt/.shtml/ files. Finally you must set <tt/Options Includes/ for all directories where +you want to run SSI/XSSI files. This is done in the <tt/access.conf/ file. Now +all files with the extension <tt/.shtml/ will be parsed for SSI/XSSI commands. + +Another way of enabling includes is to use the <tt/XBitHack/ directive. If you +turn this on it looks to see if the file is executable by user. If it is +and <tt/Options Includes/ is on for that directory, then +it is treated as an SSI file. This only works for files with the mime type +text/html (<tt/.html .htm/ files). This is not the preferred method. + +There is a security risk in allowing SSI to execute system commands and CGI +scripts. Therefore it is possible to lock that feature out with the +<tt/Option IncludesNOEXEC/ instead of Option Includes in the +<tt/access.conf/ file. All the +other SSI commands will still work. + +For more information see the Apache mod_includes documentation that comes +with the source. It is also available on the website at +<url url="http://www.apache.org/docs/mod/mod_include.html">. + +For a more detailed discussion of SSI/XSSI implementation see the Apacheweek +feature at <url url="http://www.apacheweek.com/features/ssi">. + +For more information on SSI commands see the NCSA documentation at +<url url="http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html">. + +For more information on XSSI commands goto +<url url="ftp://pageplus.com/pub/hsf/xssi/xssi-1.1.html">. + +<sect1>Module system +<p> +Apache can be extended to support almost anything with modules. +There are allot of modules already in existence. Only the general interest +modules are included with Apache. For links to existing modules goto the + +Apache Module Registry at +<url url="http://www.zyzzyva.com/module_registry/">. + +For module programming information goto +<url url="http://www.zyzzyva.com/module_registry/reference/"> + + + <!-- Web Server Add-ons ======================= --> + + +<sect>Web Server Add-ons +<p> +Sorry this section has not been written yet. + +Coming soon: mSQL, PHP/FI, cgiwrap, Fast-cgi, MS frontpage extentions, +and more. + + +<!-- WWW = FAQ == SECTION ======================================== --> + + +<sect>FAQ +<p> +There aren't any frequent asked questions - yet... + +<!-- For further reading SECTION ================================= --> + + +<sect>For further reading +<p> + +<sect1>O'Reilly & Associates Books +<p> +In my humble opinion O'Reilly & Associates make the best technical books +on the planet. They focus mainly on Internet, Unix and programming related +topics. They start off +slow with plenty of examples and when you finish the book your an expert. I +think you could get by if you only read half of the book. They also add +some humor to otherwise boring subjects. + +They have great books on HTML, PERL, CGI Programming, Java, JavaScript, +C/C++, Sendmail, Linux and +much much more. And the fast moving topics (like HTML) are updated +and revised about every 6 months or so. So visit the +<url url="http://www.ora.com/" name="O'Reilly & Associates"> +web site or stop by your local book store for more info. + +And remember if it doesn't say O'Reilly & Associates on the cover, +someone else probably wrote it. + +<sect1>Internet Request For Comments (RFC) +<p> +<itemize> +<item>RFC1866 written by T. Berners-Lee and D. Connolly, +"Hypertext Markup Language - 2.0", 11/03/1995 +<item>RFC1867 writtenm by E. Nebel and L. Masinter, +"Form-based File Upload in HTML", 11/07/1995 +<item>RFC1942 written by D. Raggett, +"HTML Tables", 05/15/1996 +<item>RFC1945 by T. Berners-Lee, R. Fielding, H. Nielsen, +"Hypertext Transfer Protocol -- HTTP/1.0", 05/17/1996. +<item>RFC1630 by T. Berners-Lee, +"Universal Resource Identifiers in WWW: A Unifying Syntax for the +Expression of Names and Addresses of Objects on the Network as used +in the World-Wide Web", 06/09/1994 +<item>RFC1959 by T. Howes, M. Smith, "An LDAP URL Format", 06/19/1996 +</itemize> + +</article> diff --git a/LDP/faq/docbook/WordPerfect-Linux-FAQ.sgml b/LDP/retired/WordPerfect-Linux-FAQ.sgml similarity index 100% rename from LDP/faq/docbook/WordPerfect-Linux-FAQ.sgml rename to LDP/retired/WordPerfect-Linux-FAQ.sgml