<!doctype linuxdoc system>

<!-- This document is written in linuxdoc-sgml format (like the Linux HOWTOs).
     Translate it to plain text using sgml2txt, to HTML using sgml2html, to
     LaTeX using sgml2latex, etc.
 -->

<article>

<!-- Title information -->

<title>Linux on the Toshiba Libretto 70
<author>George B. Moody, <htmlurl url="mailto:george@hstbme.mit.edu"
name="george@hstbme.mit.edu">
<date>v1.5a, 20 June 1998
<abstract>
The Toshiba Libretto, slightly larger than a VHS video cassette, is the
<em/second/-smallest computer I know of that can run Linux.  Here is
a description of how I installed Red Hat Linux 5.0 on a Libretto 70, with
details of setting up XFree86, PCMCIA services, networking, sound, and APM.
I bootstrapped the installation using a parallel-port Zip drive;  other
approaches are discussed.
</abstract>

<!-- Table of contents -->
<toc>

<!-- Begin the document -->

<sect>What's new?

<p> Many others who have installed Linux on their Librettos have generously
contributed suggestions and experiences.  Where I've been able to try out these
suggestions, I've incorporated them (with acknowledgement, of course) into the
main text of this mini-HOWTO.  In this section, I've summarized and quoted many
of the ideas that I have not had a chance to try personally yet (my apologies
if I've left anyone out inadvertently).  The contributors of each suggestion
are probably the best resources if you have questions.  Please send a copy of
your correspondence to me so that I can update the information here as
appropriate.

<p> <em>Paul Couderc</em>, <htmlurl url="mailto:Paul.Couderc@irisa.fr"
name="Paul.Couderc@irisa.fr">, successfully installed Linux via the parallel
port.  He writes: ``By compiling a kernel with NFS-Root and PLIP support, I
thought it would be possible to "loadlin" the kernel from the Win95 partition
and then to NFS-mount a root filesystem over PLIP from a desktop PC.

<p> ``Unfortunately, when I tried this idea the boot process ended up with a
"Root-NFS: unable to open at least one network interface" despite the
fact that PLIP was correctly initialized. The problem comes from
NFS-Root, which does not allow point-to-point IP interfaces to be used.

<p> `` To fix this (nfsroot v2.3), edit nfsroot.c (in /usr/src/linux/fs/nfs)
and change the following lines:

<tscreen><verb>
	/* First up the interface */
        old_flags = dev->flags;
		dev->flags = IFF_UP | IFF_BROADCAST | IFF_RUNNING;
</verb></tscreen>

To:

<tscreen><verb>
	/* First up the interface */
	old_flags = dev->flags;
	if (old_flags & IFF_POINTOPOINT)
		dev->flags = IFF_UP | IFF_POINTOPOINT | IFF_RUNNING | IFF_NOARP;
	else
		dev->flags = IFF_UP | IFF_BROADCAST | IFF_RUNNING;
</verb></tscreen>

And recompile the kernel. This fix is not very clean because no route
is added to the destination point-to-point address, but the subnet
route seems to work (I wrote a more complete patch with the the
correct route added but I don't know if it is very useful).

<p> ``The rest of the installation is quite standard: repartition the disk
with Windows's fdisk or FIPS to make room for Linux. Export a root
filesystem from the desktop PC (like the Slackware root floppy). Copy
the kernel image to the Lib's Win95 partition and boot it with
LOADLIN, and don't forget to use the no_squash_root parameter to be
able to mount the root read-write. Create Linux partitions with
Linux's fdisk, and install the system with your favorite method
(Personally I NFS-exported the CD-ROM distribution from my desktop PC
and mounted it on the Libretto, but FTP would work as well).

<p> ``I sent the patch to the NFS-Root author, but as it address a specific
problem I'm not sure that it will be included in future versions.''

<p> <em>David Bateman</em>, <htmlurl url="mailto:David.Bateman@tip.csiro.au"
name="David.Bateman@tip.csiro.au">, is writing a Linux driver for the Libretto's
PCMCIA diskette drive.  An alpha version of the driver, in binary format, is
available from David, who expects to be able to supply a source version once
the code is stable. (David explains that ``Due to the non-disclosure agreement
I signed with Y-E Data to get the  necessary programming documentation, during
the testing phase I can only give out binaries of the floppy driver. Eventually
there will be a source release, but the code will need to be shown to Y-E Data
first for Intellectual property reason. Therefore passing the source by the Y-E
Data legal department should be kept to a single pass. So I'd like to iron out
as many bugs as possible before moving to a full source code release.'')

<p> <em>Kevin Tomlinson</em>, <htmlurl url="mailto:tomlikp@cat.com"
name="tomlikp@cat.com">, has constructed a set of diskette images that can be
used to install Red Hat Linux 5.0 on a Libretto without requiring any other
hardware.  Read Kevin's instructions
(<url url="http://ecg.mit.edu/george/pcmcia-inst/libretto.html">)
for downloading and using these diskette images.  Thanks, Kevin!

<p> <em>Alex DeWolf</em>, <htmlurl url="mailto:dewa1@aerial1.com"
name="dewa1@aerial1.com">, reports success using PPP with a Viking 56K modem.
He also reports that the Xinside X server does not appear to recover from
hibernation properly, but that he was able to solve this problem by switching
to XFree86.

<p> <em>Delbert T. Walsh</em>, <htmlurl url="mailto:delwalsh@mindspring.com"
name="delwalsh@mindspring.com">, writes about his UMSDOS installation: ``The
reasons for a native partition are obvious but I installed Linux on a pc at
work using umsdos so I would not have to repartition a system that I do not
own.  Umsdos works and performs quite well.  No bench marks were run but I was
not after stellar performance on the Libretto, I just wanted Linux running
giving me a very portable workstation.  Using this approach I got the parallel
port BackPack cd-rom and copied the install files to the Libretto (using dos)
and installed it.  Quite simple and a cd-rom drive is an asset to the Libretto.
I now use loadlin exclusively on my desktop at home and my Libretto.  No more
lilo, loadlin is quick, easy and fool proof.  If you ever messed up a lilo
config and ended up reformatting your hard disk and all that entails you know
what I mean.  This approach is perfect if the Libretto is the only system one
has.

<p> ``An alternative is if you also own a desktop or other system with a
cd-rom.  For the price of the BackPack you can buy a pcmcia card, nic
card for the pc, a hub and cables.  With this setup you can use MS file
sharing to copy the distribution to the Libretto and continue from
there.  Once up and running you can network both systems using linux,
mount the cd-rom nfs and still have access to a cd-rom from the Libretto
and also have the fun of running a Linux network at home.  What a deal!
Of cource I thought of this after buying the BackPack but the portable
cd-rom drive is great for traveling.  At home I just network the two
systems and lay in bed with the Libretto and connect to work or the net
and have a lot of fun.''

<p> <em>David Luyer</em>, <htmlurl url="mailto:luyer@ucs.uwa.edu.au"
name="luyer@ucs.uwa.edu.au">, reports success in installing Debian Linux off
of a boot diskette after transferring the files to the Windows partition.
He writes, ``Debian Linux only needs the first disk in the actual floppy drive
and can then mount the second disk via a ramdisk to something to get the files
off it if it's found on the local hard disk or network.''

<p> <em>Thomas Tonino</em>, <htmlurl url="mailto:ttonino@bio.vu.nl"
name="ttonino@bio.vu.nl">, writes ``I installed both Red Hat 4.2 and Red Hat
5.0 on my Libretto 50 using only a second Linux machine and a laplink cable.
It worked perfectly. The installation works with the standard Red Hat boot
floppy.  Installation took about 1 hour from the 2 speed CD drive in my
desktop, so I suppose this could get a little but not much faster.  The trick
is to do an NFS install - this does not need the second boot floppy.''

<p> My thanks to everyone who has written!

<sect>Introduction

<p> The Libretto is a marvel of miniaturization.  It's a little too big
(210x114x35 mm) to be called a palmtop -- at least, it won't fit in the palm of
anyone who would also want to type on it!  Everything one needs in a real
computer is there, and there are surprisingly few compromises.  Naturally, the
first thing I wanted to do when I saw one was to get Linux running on it.  (Why
waste such an engineering gem on Windows 95?)

<sect1>Libretto links

<p> I've used Linux since 1.0.9, and UNIX since version 6, so I considered
myself reasonably experienced, having installed Linux around twenty times.
Getting Linux to run on the Libretto was one of the trickier installations I've
done.  It certainly helped to know that it was possible; for this reason, I
would like to thank the authors of the following web pages, found using an
AltaVista search for ``+libretto +linux'':

<descrip>
<tag/Install Linux to Libretto/
     <url url="http://www2s.biglobe.ne.jp/&tilde;t-f/e/libretto.html">

     This relates how to install Slackware 3.x on a Libretto 50 via NFS.

<tag/Linux on the Libretto/
     <url url="http://www.ucolick.org/&tilde;sutin/libretto.html">

     This describes how to install Red Hat Linux (but presumably any Linux) by
     removing the Libretto's hard drive, attaching it to the spare IDE
     connector of a ``real'' PC, doing the installation there, then
     reinstalling the drive in the Libretto.
</descrip>

<p> I had also read (well, looked at with interest and a renewed desire to
learn Japanese) the web pages and news posts of many Japanese Linuxers who have
been installing Linux on their Libretto 20s, 30s, etc., for some time now.

<p> I also searched Kenneth Harker's <em>Linux on Laptops</em> page, <url
url="http://www.cs.utexas.edu/users/kharker/linux-laptop/">, which is where
you should be looking if you haven't already made up your mind to try Linux on
a Libretto.  This page has pointers to dozens of documents like this one, each
of which describes how Linux can be installed and used on one or more types of
portable PCs.  One of those, <em>Alan's PC110 Page</em>, <url
url="http://toy.cabi.net/">, contains an inspiring account of Linux on what
has got to be the smallest full-featured PC on earth.  The Libretto is a close
second (about 20 mm longer, other dimensions about the same; it weighs about
150 g more than the PC110).

<p> Kenneth Harker also maintains the <em>Linux Laptop Volunteer Support
Database</em>, <url
url="http://www.cs.utexas.edu/users/kharker/linux-laptop/volunteer.html">, a
searchable list of folks who are willing to give advice to those seeking to
install Linux on portable computers.  On that list, I found Keith Packard,
<htmlurl url="mailto:keithp@ncd.com" name="keithp@ncd.com">, who offered
encouragement and an excellent suggestion which I ignored initially (more on
this below).

<p> For general information on the Libretto in English, visit Toshiba USA's
Libretto pages, <url
url="http://www.toshiba.com/tais/csd/products/portable/libretto/home.htm">.
The parent company maintains a larger Libretto Web site in Japanese,
<url url="http://www2.toshiba.co.jp/pc/libretto/">, with photos of a variety
of add-ons that apparently are not available outside of Japan so far.  A
good unofficial source of information on all Libretto models, including those
unavailable in the US, is <em>Adorable's Libretto Page</em>, <url
url="http://www.cerfnet.com/&tilde;adorable/libretto.html">, which also
includes information about do-it-yourself upgrades, a commented list of
world-wide mail-order suppliers of Librettos, and a short but useful list of
Libretto links.

<p> After I had finished the adventure recounted below, I tried another
AltaVista search, and found Grant Taylor's <em>Portable Computing with
Linux</em> pages, <url url="http://www.picante.com/&tilde;gtaylor/portable/">,
in which the author describes his own experiences installing Red Hat Linux on a
Libretto 30, using the method described in <em>Linux on the Libretto</em>, <url
url="http://www.ucolick.org/&tilde;sutin/libretto.html">.  Grant's pages
contain a great deal more of interest, including details of getting a wireless
Internet connection using a CDPD modem, and a pointer to Matt Cowles's Libretto
page, <url url="http://www.visi.com/&tilde;mdc/libretto.html">.  Matt's page
describes another installation using the same approach, with details of how to
remove the Libretto's internal drive and connect it to another PC.

<sect1>About this document

<p> The most recent HTML version of this document can be found at <url
url="http://ecg.mit.edu/george/libretto.html">.  <htmlurl
url="http://ecg.mit.edu/george/libretto.sgml" name="SGML">, <htmlurl
url="http://ecg.mit.edu/george/libretto.txt" name="Plain text">, <htmlurl
url="http://ecg.mit.edu/george/libretto.ps" name="PostScript">, and <htmlurl
url="http://ecg.mit.edu/george/libretto.tex" name="LaTeX"> versions are also
available; links to these may be found in the HTML version.

<p> If this document is useful to you, please send me a postcard from your part
of the world (my son collects stamps, and I would appreciate hearing about your
experiences with Linux on the Libretto).  My snailmail address is:
<verb>
    George Moody
    MIT Room E25-506A
    Cambridge, MA 02139 USA
</verb>

<sect>Hardware description

<p> There are three models of the Libretto currently available outside of
Japan.  The Libretto 50 (a.k.a. 50CT) has a 75 MHz Pentium and an 800 Mb disk;
this model is still widely available although its production has been
discontinued.  The Libretto 70 (70CT) has a 120 MHz Pentium MMX and a 1.6 Gb
disk.  Both weigh about 850 grams with their standard batteries, which provide
around two hours of use (an optional double-capacity battery, which adds about
100 grams and a 15 mm ``lip'' at the front of the keyboard, powers either model
for about four hours).  Shortly after I wrote the first version of this
document, Toshiba introduced the Libretto 100 (100CT), which has a 166 MHz
Pentium MMX and a 2.1 Gb disk; it's a bit larger (1 mm thicker, 17 mm more from
front to back) and 100 grams heavier than previous models, and is said to run
for 3 hours on its standard battery, or 5 hours with an optional high-capacity
battery.

<p> The Libretto 50 and 70 are sold with 16 Mb of EDO RAM (you can and should
add another 16 Mb -- currently available at around US&dollar;90).  The side-lit
active matrix screen is about 120x95 mm (the specification is ``6.1 inches
diagonally''), with a resolution of 640x480 pixels.  The video chip set is a
C&amp;T 65550 with 1 Mb of video RAM; using either the port replicator that
comes with the Libretto, or the separately available dock, you can drive an
external monitor at 1024x768 in 8-bit (256) color mode, or at 800x600 in 16-bit
color mode.  These Librettos, and earlier models that were distributed only in
Japan, come with a single type II PCMCIA slot; the optional dock includes a
type III PCMCIA slot that can accommodate a second type I, II, or III card
(it's not possible to load the type III slot with 2 type II cards, however).
The 16-bit PCMCIA interface does not support CardBus cards.  The port
replicator and the dock both supply a standard DB-25 parallel port and a DB-9
serial port as well as an HD-15 video port; the dock adds connectors for a PS/2
keyboard and mouse.  Librettos have an IrDA 1.0 compliant serial infrared port
usable with or without the port replicator or dock.  These machines also have
built-in 8-bit Sound Blaster Pro-compatible and 16-bit Microsoft Sound
System-compatible audio, an internal (monaural) speaker and an odd little
stereo headphone jack (an adapter for a standard stereo mini-jack is supplied).
There is no sound input, although the necessary pins are accessible on the
sound chip if you are willing to void your warranty.

<p> The Libretto 100 comes with 32 Mb of EDO RAM, to which an additional 32 Mb
may be added, and an 800x480 active matrix screen driven by a NeoMagic NM-2160
video chip set with 2 Mb of video RAM.  The Libretto 100 can accommodate one
type III or two type I or II PCMCIA cards internally, and it supports CardBus
cards.  The optional Libretto 100 dock provides an additional type III slot and
an additional type I or II slot, as well as a USB port.  I don't have any
information about the sound support in the Libretto 100, but it is apparently
different from that in earlier models.

<p> The pointing device is a nice bit of engineering, IMHO.  It's basically the
same pointing-stick device Toshiba has used in its laptops, but mounted on the
right side of the screen, with the buttons (two of them) mounted behind the
pointer (i.e., on the outside of the case).  The pointing stick is covered with
a felted rubber bumper about 1 cm in diameter, and you operate it with your
right thumb while the other fingers of your right hand fall naturally on the
buttons.  (It took me only a game of Windows solitaire on a demo model to
get used to it, and I'm left-handed -- so no whining, OK?  We all hate these
things, but the alternatives are worse.)  I noticed that the well-used bumper
on the demo unit showed signs of wear; Toshiba enclosed six spares with my
Libretto, and I imagine that I'll be using them if I don't lose them first.

<p> The external floppy drive (included with US and European models, but
reportedly an extra-cost option in Japan) is a proprietary design with a
permanently attached PCMCIA card.  This turns out to be problematic for
installing Linux (more on this subject later).  The drive itself is admirably
small, but the captive cable makes it a bit awkward to pack up.  The floppy
drive is <em>not</em> currently accessible from Linux (but see <em>What's
new?</em> above for information about an alpha version of a Linux driver).
Spare or replacement floppy drives are available for around US&dollar;140.

<p> The forerunners of the current models (the 20, which had a 75 MHz AMD 486
CPU, up to 20 Mb of RAM, and a 270 Mb hard drive; and the 30, which had a 100
MHz AMD 5x86 (486-class) CPU, up to 20 Mb of RAM, and a 500 Mb hard drive), and
an intermediate model (the 60, which is a 50 with a 100 MHz Pentium) were
available only in Japan.  These models have apparently been discontinued,
although it may still be possible to purchase one via mail order.

<p> A significant advantage of models 60, 70, and 100 over the earlier models
is that it is possible to charge the batteries while the computer is in use.
Toshiba supplies a very compact universal (100-240V, 50-60Hz) AC
adapter/charger.  A less compact but still reasonably small auto
adapter/charger, also usable in airplanes equipped with Empower in-seat power
supplies, is available from Xtend Micro Products, <url
url="http://www.xmpi.com/">; for the Libretto 50 or 70, get model E407 (15 V, 2
A).  Toshiba has recently introduced a similar product (model PWCF302).
Libretto 100 owners should check compatibility with both vendors.

<p> At introduction in the US, the 50 sold for about US&dollar;2000 (rather
expensive compared to other notebooks of similar capabilities); it is now
available for less than US&dollar;650.  The 70 was also introduced at about
US&dollar;2000, and has dropped to less than US&dollar;1600 since the advent
of the 100 (currently about US&dollar 2200).  For about US&dollar;2550, the
Libretto 100CT/NT comes with Windows NT preinstalled;  it is otherwise
identical to the 100.  All other models of the Libretto come with Windows 95
preinstalled.

<p> After reviewing my choices, I took a deep breath, pulled out my charge
card, and ordered my Libretto on the web.  At the same time, I ordered a Sony
PRD-650WN CD-ROM drive, which is packaged by Sony with an Adaptec SlimSCSI
PCMCIA adapter.  They arrived via FedEx about 18 hours later (really! -- but
YMMV).  I unpacked the Libretto, set up its AC adapter, started charging its
battery, turned it on, answered the few questions needed to finish the Windows
95 setup, and played solitaire.  (I lost.  I wish Windows 95 came with reversi,
like 3.0 did -- now <em>that</em> was a reason to run Windows.  Can anyone
think of any other reasons?)

<p> I chose the 70 because I expected to keep a Windows 95 partition on my
Libretto, and the 810 Mb disk available on the 50 seemed unlikely to be big
enough.  As it turns out, it's not particularly difficult to replace the disk
drive (see, for example, <em>Adorable's Libretto Page</em>, <url
url="http://www.cerfnet.com/&tilde;adorable/libretto.html">, for information
about replacement drives with capacities up to 3.2 Gb).

<p> The choice is now a bit less clear.  The Libretto 50 is an amazing bargain
at current prices.  Even after replacing the original disk with a 3.2 Gb drive
for about another US&dollar;240, the total cost is less than half of what it
was a few months ago, and for many applications, the speed difference would not
be noticeable.  At the other end of the lineup, the larger screen and longer
battery life of the 100 are attractive features (the speed difference and the
support for 64 Mb of RAM are also minor advantages), which IMHO are offset by
the greater size and weight of the 100 (OK, there's not much difference, but
the Libretto is attractive in the first place because of its size).

<p> These notes about installing Linux on the Libretto 70 should be applicable
to the Libretto 50, except for the details about partition sizes.  Much of this
material should also apply to the Libretto 100, but the details of setting up
the X server will be different because the NeoMagic chip set is not supported
by XFree86 (but see <em>NeoMagic X Server for Linux on Laptops</em>, <url
url="http://www.mnsinc.com/js/Neomagic.html">, for a free but unaccelerated
X server that has been reported to work on the 100).  Sound support on the 100
may also require different settings.

<sect>Installing Red Hat Linux 5.0

<p> The tricky part of the installation, based on my reading, was expected to
be at the beginning.  The Libretto comes with an external PCMCIA floppy drive,
which is bootable, but Red Hat Linux (RHL) needs to read a second floppy after
booting if the installation requires PCMCIA services, and <em>this</em> isn't
possible (because the kernel on the boot floppy can't read another floppy).

<sect1>Installation strategies

<p> So, you say, why not copy the files needed from the CD-ROM to the Windows
partition (while still running Windows, that is), defragment and repartition
the drive, and then do a hard-drive installation?  This sounds plausible, and I
was ready to try it, until I noticed that I would still need the second floppy
in order to do a hard-drive installation.

<p> At this point I seriously considered building a Linux boot floppy with
MSDOS file system support so that I could continue with this approach.  It
might have worked -- and I would be pleased to hear from anyone who does this
successfully.  It's the only reasonable way I can think of to bootstrap Linux
on the Libretto without the use of a second PC (except to compile the kernel
for the boot floppy -- but if a suitable kernel were available for downloading,
it would be possible to transfer it to a floppy using the <tt>rawrite</tt>
utility under DOS or Windows).

<p> I might have been tempted to remove the Libretto's hard drive, install it
in another PC, and do the installation there, using the method described in
<em>Linux on the Libretto</em>, <url
url="http://www.ucolick.org/&tilde;sutin/libretto.html">, except that the
necessary 2.5-inch to 3.5-inch adapters are extraordinarily hard to find.
(Grant Taylor notes that these are available from Dexis Computer in
Minneapolis, +1 612 944 7670.)  The downside of this approach, even given the
adapter and an attitude of reckless abandon towards Toshiba's warranty, is that
upgrades may be equally difficult.  On the other hand, if you've decided to
replace your drive with a larger one -- why not?

<p> Keith Packard's advice -- to build a minimal root partition using a
parallel-port Zip drive attached to another PC -- seemed much the better
course.  I didn't have a Zip drive, so I bought a Zip Plus (this is the new
model, with both parallel and SCSI interfaces) at the local computer
megaoutlet.  An hour later, I realized this was a mistake: the Zip Plus is not
compatible with the original Zip, which is the only one supported by the Linux
<tt>ppa</tt> module.  (This may be changing: if you are considering buying a
Zip drive, you may want to take a look at David Campbell's PPA page, <url
url="http://www.torque.net/&tilde;campbell/">, for more recent information.
As of June 1998, an alpha release of a Zip Plus driver is available for
testing.)  Fortunately, exchanging drives was no problem.

<p> After writing this HOWTO, I received several suggestions for other
installation strategies.  Jay Soffian, <htmlurl url="mailto:jay@cimedia.com"
name="jay@cimedia.com"> wrote that he had successfully used a Backpack
(parallel-port) CD-ROM drive to install RHL 5.0, first defragmenting and
repartitioning using FIPS (see below), then running <tt>autoboot.bat</tt>
(on the RHL CD-ROM) from DOS mode.  If you have one of these CD-ROM drives,
this sounds like a significantly easier approach than what I describe below.

<p> Another possibility I haven't had a chance to try yet is to make a custom
<tt>initrd.gz</tt>, as Victor Gvirtsman has done (see <url
url="http://www.geocities.com/SiliconValley/Haven/5112/">).  Victor's idea is
to copy <tt>loadlin.exe</tt> and <tt>vmlinuz</tt> from the RHL CD, and Victor's
<tt>initrd.gz</tt>, to the DOS/Windows partition of the Libretto, and then to
use <tt>loadlin</tt> to bootstrap Linux for an installation using a PCMCIA
CD-ROM, hard drive, or network card.  This didn't work for me; the problem I
encountered was that at least one shared library appears to be missing, so that
<tt>cardmgr</tt> (the PCMCIA card services daemon) could not be started.  This
looks like a problem that should be fairly easy to fix.  The process of
creating a custom RHL boot floppy, which doesn't appear to be documented by Red
Hat anywhere, is described clearly and in detail by Rod Smith (see <url
url="http://www.users.fast.net/&tilde;rodsmith/rhjol-technical.html">).

<sect1>Preparation using another Linux PC

<p> If you decide to take this route, as I did, you will need not only a
parallel-port Zip drive, but also root (superuser) access to another PC that is
running Linux.  I refer to this as ``the desktop PC'' below.

<p> In outline, we will:

<itemize>
<item> download or compile two versions of the Linux kernel and modules
<item>
on the desktop PC, create two boot diskettes and a small but usable Linux
installation on a Zip disk
<item>
repartition the Libretto's internal disk
<item>
move the Zip drive to the Libretto, and boot Linux using the first diskette
and the Zip disk
<item>
transfer Linux from the Zip disk to the Libretto's internal disk
<item>
boot Linux using the second diskette and the internal disk
<item>
(optionally) install LILO so that we can boot Linux or Windows 95 without
needing a boot diskette
<item>
install additional Linux packages to complete the installation, either via
a CD-ROM drive connected via a PCMCIA SCSI controller, or from Zip disks.
</itemize>

<sect2>Begin collecting files

<p> Make a directory for miscellaneous files to be transferred to the Libretto,
and make several subdirectories within it:

<tscreen><verb>
mkdir /tmp/libretto
cd /tmp/libretto
mkdir -p boot lib/modules stage2/boot stage2/lib/modules usr/src
</verb></tscreen>

<p> Obtain the latest kernel source RPM from Red Hat's FTP server (in <url
url="ftp://ftp.redhat.com/pub/redhat/redhat-5.0/SRPMS/">) or one of its mirrors if possible.  Otherwise, you can use the copy
from the SRPMS directory on RHL 5.0 CD-ROM 2.  The file you need has a name of
the form <tt>kernel-</tt><em>version</em><tt>.src.rpm</tt>; do not confuse this
with <tt>kernel-source-</tt><em>version</em><tt>.i386.rpm</tt>, which does not
contain the <tt>pcmcia-cs</tt> sources.  Save a copy of this file in the
<tt>/tmp/libretto/usr/src</tt> directory if you would like to be able to build
new kernels on the Libretto itself later on.

<p> Next, we need kernel and module binaries.  You can download the necessary
binaries from my web site, or you may create them from the Linux sources.

<sect2> Using kernel and module binaries

<p> If you wish to use the precompiled binaries:

<enum>

<item> Download the <htmlurl url="llbin.tar.gz" name="Libretto Linux binary
archive"> and save it as <tt>/tmp/llbin.tar.gz</tt> (the HTML version
of this document, <url url="http://ecg.mit.edu/george/libretto.html">, contains
a link to the archive here).

<item> Unpack the archive by

<tscreen><verb>
cd /tmp
tar xfvz llbin.tar.gz
</verb></tscreen>

(The contents of the archive will be unpacked into <tt>/tmp/libretto</tt> and
its subdirectories.  Once you have unpacked the archive, you can delete
<tt>/tmp/llbin.tar.gz</tt>.)
</enum>

<sect2> Creating kernel and module binaries from sources (optional)

<p> If you wish to create the binaries from sources:

<enum>

<item> If you have previously created a custom kernel for your desktop PC,
make a backup copy of your kernel configuration file
(<tt>/usr/src/linux/.config</tt>) in another directory.

<item> If you have not already done so, install the sources from the SRPM by

<tscreen><verb>
rpm -i /tmp/libretto/usr/src/kernel-2.0.32-2.src.rpm
</verb></tscreen>

(Your SRPM may have a later version number.)  The sources will be unpacked
into directories named <tt>/usr/src/linux-</tt><em>linuxversion</em> and
<tt>/usr/src/pcmcia-cs-</tt><em>pcmciaversion</em>.  Make symbolic links to
these directories, named <tt>/usr/src/linux</tt> and
<tt>/usr/src/pcmcia-cs</tt> respectively.

<item> Download the <htmlurl url="stage1-config" name="stage 1 kernel
configuration file"> (see the HTML version of this file for a link), and
install it as <tt>/usr/src/linux/.config</tt>.  If you make changes in
<tt>.config</tt>, be sure to include support for kernel modules (since PCMCIA
support is available only as modules).  Since the stage 1 kernel will be using
the Zip drive for the root file system, include <tt>ppa</tt> support directly
in the kernel (not as a module).  Note that it is not possible to include
parallel printer or <tt>plip</tt> support in the stage 1 kernel, since either
would interfere with use of the root file system in this case.

<item> Build the stage 1 kernel by:

<tscreen><verb>
make clean
make dep
make zImage
cp /usr/src/linux/arch/i386/boot/zImage /tmp/libretto/boot/vmlinuz
cp /usr/src/linux/System.map /tmp/libretto/boot/System.map
rdev /tmp/libretto/boot/vmlinuz /dev/sda1
rdev -s /tmp/libretto/boot/vmlinuz /dev/sda2
</verb></tscreen>

Depending on the speed of your desktop PC, the <tt>make</tt> commands may take
anywhere from a few minutes to an hour or more.  The <tt>rdev</tt> commands
set the root and swap partitions to be used by the stage 1 kernel;  these
correspond to the partitions on the Zip drive.

<item> Make a set of modules (excluding the PCMCIA modules), and install them
in <tt>/tmp/libretto</tt>:

<tscreen><verb>
make modules
make PREFIX=/tmp/libretto modules_install
</verb></tscreen>

<item> (Optional) You may wish to obtain the XForms library, so that you can
compile <tt>cardinfo</tt> (an X11-based utility that displays information about
whatever is in the PCMCIA slot of the Libretto (and of its port replicator, if
connected).  This utility is compiled automatically while building the PCMCIA
kernel modules, provided that the XForms library has been installed.  This
library is available from Red Hat's FTP server and its mirrors, but (because of
distribution restrictions) is not included on the RHL CD-ROMs.  If you want it,
download and install <url
url="ftp://ftp.redhat.com/pub/redhat/non-free/xforms-080-1.i386.rpm">.

<p> If you skip this step, you can always compile <tt>cardinfo</tt> later if
you want it -- see the PCMCIA HOWTO for details.

<item>
Configure the <tt>pcmcia-cs</tt> package:

<tscreen><verb>
cd /usr/src/pcmcia-cs
make config
</verb></tscreen>

The configuration process is interactive.  Accept the default responses, except
that you should specify <tt>/tmp/libretto</tt> as the alternate target install
directory, and you should enter <tt>2</tt> (read from the Linux source tree)
when asked to set kernel-specific options.  Here is a sample of the output of
<tt>make config</tt>, including my responses to prompts:

<tscreen><verb>
Linux PCMCIA Configuration Script

The default responses for each question are correct for most users.
Consult the PCMCIA-HOWTO for additional info about each option.

Linux source directory [/usr/src/linux]: 
Alternate target install directory []: /tmp/libretto
C compiler name [gcc]: 
Linker name [ld]: 
Compiler flags for debugging []: 
Build 'trusting' versions of card utilities (y/n) [n]: 

The PCMCIA drivers need to be compiled to match the kernel they
will be used with, or some or all of the modules may fail to load.
If you are not sure what to do, please consult the PCMCIA-HOWTO.

How would you like to set kernel-specific options?
    1 - Read from the currently running kernel
    2 - Read from the Linux source tree
    3 - Set each option by hand (experts only!)
Enter option (1-3) [1]: 2

Kernel configuration options:
    Symmetric multiprocessing support is disabled.
    PCI BIOS support is disabled.
    Advanced Power Management (APM) support is enabled.
    SCSI support is enabled.
    Networking support is enabled.
     IPv6 support is disabled.
     Radio network interface support is disabled.
     Token Ring device support is disabled.
    Module version checking is enabled.
    PCMCIA IDE device support is enabled.
    DEC Alpha UDB target platform is disabled.

The kernel source tree is version 2.0.32.
The current kernel build date is Fri Feb 13 06:56:32 EST 1998.
WARNING: the source tree has a build date of Wed Feb 18 17:45:16 EST 1998.
   Did you forget to install your new kernel?!?

Your module utilities are version 2.1.55.

It looks like you have a System V init file setup.

X Windows include files found.
/usr/X11/lib/libforms.a found.
</verb></tscreen>

<item>
Now compile the PCMCIA modules and install them in <tt>/tmp/libretto</tt>:

<tscreen><verb>
make all
make install
</verb></tscreen>

</enum>

<p> This completes the compilation of the stage 1 kernel and modules.  The
stage 2 kernel and modules are compiled using a similar procedure:

<enum>
<item> Download the <htmlurl url="stage2-config" name="stage 2 kernel
configuration file"> (see the HTML version of this file for a link), and
install it as <tt>/usr/src/linux/.config</tt>.  Once again, if you make changes
in <tt>.config</tt>, be sure to include support for kernel modules (since
PCMCIA support is available only as modules).  Since the stage 2 kernel will be
using the internal drive for the root file system, <tt>ppa</tt> support may be
included as a module rather than being compiled directly into the kernel.  By
selecting modular <tt>ppa</tt>, <tt>plip</tt>, and parallel printer support, as
is the default for the stage 2 kernel, the parallel port can be shared between
these devices, which is not possible if any of them is compiled as part of the
kernel itself.

<item> Save a copy of the stage 2 kernel configuration file in
<tt>/tmp/libretto/stage2/config</tt>.  (This will eventually be installed
in <tt>/usr/src/linux/.config</tt> on the Libretto, so that you can use it
as a base for building a new kernel there if you need to do so in the future.)

<item> Build the stage 2 kernel by:

<tscreen><verb>
make clean
make dep
make zImage
cp /usr/src/linux/arch/i386/boot/zImage /tmp/libretto/stage2/boot/vmlinuz
cp /usr/src/linux/System.map /tmp/libretto/stage2/boot/System.map
rdev /tmp/libretto/stage2/boot/vmlinuz /dev/hda2
rdev -s /tmp/libretto/stage2/boot/vmlinuz /dev/hda3
</verb></tscreen>

Again, the <tt>make</tt> commands may take anywhere from a few minutes to an
hour or more.  The <tt>rdev</tt> commands set the root and swap partitions to
be used by the stage 2 kernel;  these correspond to the Linux partitions to be
created on the Libretto's internal drive.  (If your desktop PC does not have
any IDE drives, these <tt>rdev</tt> commands will fail unless you first
create <tt>/dev/hda2</tt> and <tt>/dev/hda3</tt>; use <tt>/dev/MAKEDEV</tt>
to do so if necessary.)

<item> Make a set of modules (excluding the PCMCIA modules), and install them
in <tt>/tmp/libretto/stage2</tt>:

<tscreen><verb>
make modules
make PREFIX=/tmp/libretto/stage2 modules_install
</verb></tscreen>

<item> Configure the <tt>pcmcia-cs</tt> package:

<tscreen><verb>
cd /usr/src/pcmcia-cs
make config
</verb></tscreen>

This time, specify <tt>/tmp/libretto/stage2</tt> as the alternate target
install directory;  the other questions should be answered as for stage 1.

<item> Now compile the PCMCIA modules and install them in
<tt>/tmp/libretto/stage2</tt>:

<tscreen><verb>
make all
make install
</verb></tscreen>
</enum>

<sect2>Creating boot diskettes

<p> Insert a blank diskette in your desktop PC's diskette drive, and type:

<tscreen><verb>
cp /tmp/libretto/boot/vmlinuz /dev/fd0
</verb></tscreen>

Label this diskette ``Libretto stage 1 boot''.

<p> Insert a second blank floppy in your diskette drive, and type:

<tscreen><verb>
cp /tmp/libretto/stage2/boot/vmlinuz /dev/fd0
</verb></tscreen>

Label this diskette ``Libretto stage 2 boot''.

<sect2>Creating a root Zip disk

<p> The Zip drive should be installed on your desktop PC for this step.  If the
kernel running on your desktop PC doesn't include <tt>ppa</tt> support, you may
need to make a new kernel for your desktop PC as well.  In this case,
<tt>ppa</tt> support can be added as a module (since you won't need to use the
Zip drive to mount the root partition there).  If you use a parallel printer or
PLIP on your desktop PC, support for these should be disabled or compiled as
modules, since either will otherwise interfere with access to the Zip drive.

<p> My desktop PC has a regular SCSI disk (<tt>sda</tt>) and a SCSI Jaz drive
(<tt>sdb</tt>), so the Zip drive is recognized as <tt>sdc</tt>.  Note the
name that your Linux kernel associates with your Zip drive when your desktop
PC is rebooting.

<p> Prepare the Zip disk by creating root and swap partitions using
<tt>fdisk</tt>:

<tscreen><verb>
fdisk /dev/sdc
</verb></tscreen>

(replacing <tt>/dev/sdc</tt> with the device name for the Zip drive on your
system) to obtain the following partition table:

<tscreen><verb>
Disk /dev/sdc: 64 heads, 32 sectors, 96 cylinders
Units = cylinders of 2048 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/sdc1            1        1       81    82928   83  Linux native
/dev/sdc2           82       82       96    15360   82  Linux swap
</verb></tscreen>

<p> Be very careful to partition the Zip disk and not your system disk!  Check
the partition table carefully (using <tt>fdisk</tt>'s <tt>p</tt> command)
before writing it to the disk and exiting.  Next, format these partitions:

<tscreen><verb>
mke2fs -c /dev/sdc1
mkswap -c /dev/sdc2 15360
</verb></tscreen>

<p> The <tt>mke2fs</tt> shows its progress as it runs, taking about half an
hour on my system (this might be significantly faster on a machine that
supports one of the faster <tt>ppa</tt> modes, but my desktop PC's parallel
port was restricted to 4-bit mode).  The <tt>mkswap</tt> command took around 10
minutes, I think, and gave no evidence of activity until it finished.  Be
patient!

<p> Next, make a mount point for the Zip disk's root partition and mount it:

<tscreen><verb>
mkdir /zip
mount /dev/sdc1 /zip -t ext2
</verb></tscreen>

<p> John Wiggins, <htmlurl url="mailto:jwiggins@comp.uark.edu"
name="jwiggins@comp.uark.edu">, has written an excellent guide for the next
steps, <em>Installing Linux on ZIP disk using ppa ZIP Drive Mini-Howto</em>,
<url url="http://comp.uark.edu/&tilde;jwiggins/linuxZIP">.  I wrote a script,
<url url="install-to-zip">, that automates much of the task of building a Linux
root partition on a Zip disk.  The script installs the RHL ``base'' set of RPMs
on the Zip disk, creates an initial <tt>etc/ld.so.cache</tt> and an initial
<tt>etc/fstab</tt>, copies the files in <tt>/tmp/libretto</tt> (created above)
into the appropriate places in the Zip disk's file system, creates a PCMCIA
configuration file (<tt>etc/sysconfig/pcmcia</tt>), and makes a link for the
Libretto's pointing device from <tt>dev/psaux</tt> to <tt>dev/mouse</tt>.

<p> Mount the first CD-ROM from the Red Hat Linux 5.0 set, and go
into its <tt>RedHat/RPMS</tt> directory (or make a directory
on your hard drive and fill it with the RPMs from Red Hat's FTP site).  Run
<tt>install-to-zip</tt> from within this directory.  On my desktop PC,
<tt>install-to-zip</tt> takes about 45 minutes to run, because the Zip drive is
slo-o-o-o-ow, at least in nibble mode.  While waiting for this to finish on
the desktop PC, you can go ahead to the next step on the Libretto.

<sect1>Partitioning the Libretto's hard drive

<p> Although it is possible (indeed, if you use this approach, necessary)
to run Linux from an external Zip disk attached to the Libretto, this is
only a preparatory step on the way to running Linux from the Libretto's
internal disk.  As in most Linux installations, we will need to create
partitions on this disk for Linux.

<p> An important point to remember is that the Libretto uses the last few
cylinders of its hard drive to store its state when it goes into
``hibernation'' (suspend) mode.  On the Libretto 50 and 70, with a maximum of
32 Mb of RAM, this region covers the last 18 cylinders.  (The Libretto 20 and
30 can have at most 20 Mb RAM, and their hibernation region is reported to be
proportionately smaller; presumably the 100CT, with a maximum of 64 Mb RAM,
will have a larger suspend area.)  The BIOS of the Libretto 50 and 70 (and
presumably later models) hides these from software such as <tt>fdisk</tt>, and
reports only the number of cylinders available for file systems.  (Thus
<tt>fdisk</tt> on the Libretto 70 reports that the total disk space is 1516
Mb.)  If your Libretto is a different model, it would be a good idea to use
DOS/Windows <tt>fdisk</tt> to check the partition size before changing
anything, and then to avoid using any cylinders other than those already
allocated.  If you move your hard drive to another machine to install Linux, be
aware that these ``hidden'' cylinders will appear, but <em>they must not be
used</em>.  It's also important to be sure that LBA (logical block addressing)
is enabled on your second machine (as on the Libretto) if you use this
approach.

<p> The IBM DDLA-21620 disk used in the Libretto 70 has 3152 cylinders, 16
heads, and 63 sectors.  LBA remaps each set of 4 physical cylinders into 1
logical cylinder, so that (if removed and installed in another machine with
LBA enabled) the disk appears to have 788 cylinders, 64 heads, and 63 sectors.
Within the Libretto 70, the BIOS hides the last 18 logical cylinders, so that
the disk appears to have 770 cylinders, 64 heads, and 63 sectors.

<sect2>Shrinking the Windows partition

<p> Before you do anything to your Libretto's hard drive, you should prepare a
Windows 95 emergency boot diskette in case of problems, and back up the system
software and any of your own files.  There is very little chance that you will
need these diskettes as a result of installing Linux on your Libretto, but
(paraphrasing Jerry Pournelle) if you ever do need them, you will need them
badly.

<p> To repartition the Libretto's disk, you can use either FIPS (a DOS utility
included with RHL, or available by FTP from any of the Linux archive sites), or
a commercial application such as Partition Magic.  Of course, if you don't
need to play reversi occasionally, you can simply delete the Windows partition
:-).  (In fact, it is probably a good idea to retain a small Windows partition
so that you can read and write floppy disks, and tune up the power-saving
features of the Libretto to your liking.)

<p> The disk of the Libretto 70 is large enough that the notorious Windows
FAT32 file system might be an issue.  Mine was delivered with a FAT16 file
system, which FIPS can handle without difficulty.  If you have succumbed to the
temptation to convert yours to FAT32 format (a possibility offered to you by
Windows <tt>fdisk</tt>), you will probably need to use Partition Magic rather
than FIPS (but look at <em>Linux FAT32 Support</em>, <url
url="http://bmrc.berkeley.edu/people/chaffee/fat32.html">, for the latest news
on a revised FIPS and on adding FAT32 support to the Linux kernel).

<p> Read the documentation for your chosen repartitioning utility and follow
its instructions to the letter.  I squeezed my Windows 95 FAT16 partition down
to an even 500 Mb.  (This should leave enough room to install reversi from my
old Windows 3.0 disks ....)

<sect1>Booting Linux on the Libretto

<p> Once <tt>install-to-zip</tt> has finished on the desktop PC, we're ready to
boot Linux on the Libretto for the first time.  Shut down the desktop PC and
the Libretto.  Move the Zip drive, with the disk created by
<tt>install-to-zip</tt>, from the desktop PC to the Libretto's port replicator,
attach the port replicator and the floppy drive to the Libretto, load the
``Libretto stage 1 boot'' diskette you made earlier, and turn on the Libretto.

<p> If all goes as it should, the Libretto should boot Linux from the diskette,
and continue running from the Zip drive.  If Linux boots, but stops with a
kernel panic when attempting to mount the root partition, this is probably the
result of not properly setting the root device on the diskette using
<tt>rdev</tt> (see above).  Other error messages while booting may be ignored
for now.

<p> Once you see the <tt>localhost login:</tt> prompt, you are ready to
proceed.  Log in as <tt>root</tt> (at this point, there is no password).

<sect1>Creating partitions for Linux

<p>
Now we can create Linux root and swap partitions on the Libretto's hard drive.
Type:

<tscreen><verb>
fdisk /dev/hda
</verb></tscreen>

<p>
On my Libretto, after having reduced the size of the Windows partition,
<tt>fdisk</tt> reported that the partition table looked like this:

<tscreen><verb>
Disk /dev/hda: 64 heads, 63 sectors, 770 cylinders
Units = cylinders of 4032 * 512 bytes

   Device Boot   Begin    Start     End   Blocks   Id  System
/dev/hda1   *        1        1     254   512032+   6  DOS 16-bit >=32M
</verb></tscreen>

<p>
I created a single large partition for Linux, and a (slightly under) 32 Mb
Linux swap partition:

<tscreen><verb>
/dev/hda2	   255	    255	    754  1008000   83  Linux native
/dev/hda3	   755	    755	    770	   32256   82  Linux swap
</verb></tscreen>

<p>
You may wish to make a smaller root partition, and then create additional
partitions for <tt>/home</tt>, <tt>/tmp</tt>, and possibly others as well.
This strategy has definite advantages, particularly for a multi-user machine;
the drawback is that you must know at the outset how much space each partition
will require, and this is not always easy to estimate.

<p>
Check your partition table carefully using <tt>fdisk</tt>'s <tt>p</tt> command
before committing it to disk and exiting from <tt>fdisk</tt>.  Now format the
partitions you have created.  In my case, I did this:

<tscreen><verb>
mke2fs -c /dev/hda2
mkswap -c /dev/hda3 32256
</verb></tscreen>

<p> (The number at the end of the <tt>mkswap</tt> command should match the size
of the swap partition you have created, as reported by <tt>fdisk</tt>.  If you
created additional partitions, format them using <tt>mke2fs</tt> as above.)

<sect1>Installing Linux on the hard drive

<p> Now we are ready to begin the main installation process.  At this point
it should be possible to mount the newly created ext2fs file system:

<tscreen><verb>
mount /linux
</verb></tscreen>

(Read <tt>/etc/fstab</tt> to see why this works.)

<sect2>Transferring the Zip disk contents to the hard drive

<p> The <tt>install-to-zip</tt> script created a small
<tt>install-from-zip</tt> script that will replicate the contents of the Zip
disk on the Libretto's hard drive, so this step is easy:

<tscreen><verb>
sh /tmp/install-from-zip
</verb></tscreen>

<p> This script will take about 20 minutes or so to complete;  when it does,
log out.

<sect2>Booting from the stage 2 diskette

<p> At this point, it should be possible to boot from the ``Libretto stage 2
boot'' diskette.  Use the <tt>halt</tt> command to shut down Linux gracefully.
If your BIOS is suitably configured, this command will power down the Libretto
after halting;  otherwise, power it down manually.

<p> Unload the Zip disk, insert the ``Libretto stage 2 boot'' diskette, and
reboot.  If this doesn't work, the <tt>rdev</tt> commands may not have been
correct; you can run the correct commands on your desktop PC if necessary.  It
is also possible that the <tt>install-from-zip</tt> script may not have
completed successfully.  <em>In any case, do not continue until you are able to
boot successfully from the stage 2 diskette</em>.

<sect2>Installing LILO (optional)

<p> If all has gone well so far, you may install LILO so that it will be
possible to boot directly from the hard drive without needing a boot diskette.
First, examine <tt>/etc/lilo.conf</tt>, which should look like this:

<tscreen><verb>
boot=/dev/hda2
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
image=/boot/vmlinuz
	label=linux
	root=/dev/hda2
	read-only
other=/dev/hda1
	label=win95
	loader=/boot/chain.b
	table=/dev/hda
</verb></tscreen>

This configuration will cause LILO to boot Linux by default (i.e., if you
do not type ``win95'' within 5 seconds after the <tt>LILO boot:</tt> prompt
appears).  If you prefer to boot Windows 95 by default, for whatever reason,
edit <tt>/etc/lilo.conf</tt>, rearranging the stanzas like this:

<tscreen><verb>
boot=/dev/hda2
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
other=/dev/hda1
	label=win95
	loader=/boot/chain.b
	table=/dev/hda
image=/boot/vmlinuz
	label=linux
	root=/dev/hda2
	read-only
</verb></tscreen>

<p> If any of this is unfamiliar, review the LILO documentation before
continuing, or skip the rest of this section and continue booting using the
stage 2 diskette for now.

<p> If you are satisfied with <tt>/etc/lilo.conf</tt> and wish to install
LILO, type:

<tscreen><verb>
/sbin/lilo
</verb></tscreen>

This command installs LILO at the beginning of the Linux partition (it does
not modify the master boot record, so if you have second thoughts, you should
still be able to boot Windows 95 by removing the Linux boot diskette and
rebooting in the usual way).

<p> To allow LILO to control the boot process, use <tt>fdisk</tt>'s <tt>a</tt>
command to make <tt>/dev/hda2</tt> (the Linux root partition) bootable, and
mark <tt>/dev/hda1</tt> (the Windows 95 partition) as non-bootable.  My
partition table looks like this, viewed using <tt>fdisk</tt>'s <tt>p</tt>
command:

<tscreen><verb>
Disk /dev/hda: 64 heads, 63 sectors, 770 cylinders
Units = cylinders of 4032 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1            1        1      254   512032+   6  DOS 16-bit >=32M
/dev/hda2   *      255      255      754  1008000   83  Linux native
/dev/hda3          755      755      770    32256   82  Linux swap
</verb></tscreen>

<sect2>Uninstalling LILO

<p> If for any reason you wish to return to the status quo ante (booting
Windows 95 unless a Linux boot floppy is loaded), boot Linux and use
<tt>fdisk</tt> to mark the Windows 95 partition as bootable once again.

<sect1>Access to other file systems under Linux

<sect2>The Windows partition

<p> The <tt>install-from-zip</tt> script makes the Windows partition accessible
in the <tt>/dos</tt> directory.  Windows 95 long filenames appear correctly.
All users can read files in the <tt>/dos</tt> directory; root permissions are
needed in order to create, modify, or delete files there.

<sect2>Diskettes

<p> It does not appear to be possible to read diskettes under Linux, since
Linux does not use the BIOS to access diskettes and the only access appears to
be via the BIOS (Toshiba has not released information about the interface).  Of
course, you can always copy files between the diskette drive and the Windows
partition while running Windows, and read or write files on the Windows
partition while running Linux, as noted above.  I have not yet investigated the
possibility of access to diskettes via <tt>dosemu</tt> under Linux.

<sect2>Zip disks

<p> If you have formatted partition 1 of a Zip disk as a Linux ext2 file
system, you may mount it using the command

<tscreen><verb>
mount /zip
</verb></tscreen>

<p> If you have a DOS- or Windows-formatted Zip disk, you can mount it
using the command

<tscreen><verb>
mount /dev/sda4 /zip -t vfat
</verb></tscreen>

(Root permissions are required in this case.)

<p> Always unmount a Zip disk using

<tscreen><verb>
umount /zip
</verb></tscreen>

before removing it from the drive or turning the drive off.

<p> All users can mount and unmount Zip disks, and read files in the
<tt>/zip</tt> directory; root permissions are needed to create, modify, or
delete files in the <tt>/zip</tt> directory.

<sect2>CD-ROMs

<p> If you have a supported PCMCIA SCSI adapter and a compatible CD-ROM drive,
it is easy to read CD-ROMs under Linux.  Attach the CD-ROM drive to the
adapter, turn on the drive, and load a CD-ROM into the drive.  Boot Linux and
log in as <tt>root</tt>, then insert the SCSI adapter into the PCMCIA slot of
the Libretto.

<p> You should hear two beeps at the same pitch (the first signals that a
PCMCIA device has been inserted, and the second indicates that it has been
successfully configured).  If the second beep is at a lower pitch than the
first, the device was not configured successfully.  If you have logged into the
first virtual console, you will also see detailed status messages; on my
Libretto, this report appears when I plug in my Adaptec SCSI adapter and
Sony PRD-650 CD-ROM drive:

<tscreen><verb>
aha152x: processing commandline: ok
aha152x: BIOS test: passed, detected 1 controller(s)
aha152x0: vital data: PORTBASE=0x340, IRQ=9, SCSI ID=7, reconnect=enabled,
 parity=enabled, synchronous=disabled, delay=100, extended translation=disabled
aha152x: trying software interrupt, ok.
scsi1 : Adaptec 152x SCSI driver; $Revision: 1.18 $
scsi : 2 hosts.
  Vendor: SONY      Model: Discman PRD-650  Rev: 1.00
  Type:   CD-ROM			    ANSI SCSI revision: 02
Detected scsi CD-ROM sr0 at scsi1, channel 0, id 3, lun 0
Disc change detected.
</verb></tscreen>

<p> Once the hardware has been recognized, type

<tscreen><verb>
mount /cdrom
</verb></tscreen>

and the CD-ROM contents should be readable within the <tt>/cdrom</tt>
directory.  Before changing CD-ROMs, type

<tscreen><verb>
umount /cdrom
</verb></tscreen>

Always unmount the CD-ROM in this way before removing the SCSI adapter or
turning the CD-ROM drive off.

<sect1>Completing the RHL 5.0 installation

<p> At this point, you should have a Libretto that runs either Linux or Windows
95 from its internal disk (possibly requiring a Linux boot floppy to run Linux,
if you skipped the last section above).  We have only a bare-bones Linux
installation so far, however.

<p> Unfortunately, Red Hat does not support any easy way to bootstrap a more
complete Linux installation on a running (minimal) Linux PC.  (The usual way
requires booting from a floppy, which, as we have seen, doesn't work for the
Libretto.)  There is, however, an easy way to install nearly everything in RHL
5.0 on a Libretto 70 with very little effort, provided that you have a
supported PCMCIA SCSI adapter with an attached CD-ROM drive as described above:
simply mount the RHL 5.0 CD-ROM 1 on <tt>/cdrom</tt> as above, then type:

<tscreen><verb>
cd /cdrom/RedHat/RPMS
rpm -i -h -v --nodeps *
</verb></tscreen>

<p> Depending on the speed of your CD-ROM drive, this command will require
between 20 minutes and an hour to complete.  When it is finished, update the
RPM dependency database using the command:

<tscreen><verb>
rpm --rebuilddb
</verb></tscreen>

<p> On a Libretto 50, you will need to be selective in determining which RPMs
to install, since there will not be enough room for all of them unless you
have reduced the size of the Windows 95 partition severely.

<sect2>If you don't have a PCMCIA CD-ROM drive

<p> There are many alternatives to the procedure described above.  A simple
(though somewhat time-consuming) solution is to copy the RPMs from the RHL
CD-ROM to Zip disks and then to install them using the same procedure as above.
Use your desktop PC to repartition and reformat additional Zip disks as needed
(you do not need to create a swap partition as we did for the root disk, but
you should format partition 1 as an ext2 file system before using a new Zip
disk).  Copy up to 100 Mb of RPMs onto each Zip disk, and use ``<tt>mount
/zip</tt>'' on the Libretto to make a Zip disk accessible.

<sect>Installing updates and other packages

<p> A few packages from the RHL 5.0 CD-ROM 1 do not get installed properly
using the methods described above.  These packages, which include
<tt>manpages</tt>, <tt>moontool</tt>, <tt>zsh</tt>, and <tt>Xmetro</tt>, can be
identified using the package management tool available as part of the
<tt>control_panel</tt> X application, which can be used to install these if
desired.  Read about the package management tool in the RHL 5.0 manual.

<p> Red Hat's web site, <url url="http://www.redhat.com/">, offers a large and
growing collection of security-related and other updated RPMs.  It is a
good idea to collect these on a Zip disk, and then to install them on the
Libretto as for the RPMs on the CD-ROM.

<sect>X11R6 on the Libretto

<p> Once you have installed the RPMs, setting up the X Window System is easy.
Don't bother with <tt>Xmetro</tt> -- it won't work.  Run
<tt>Xconfigurator</tt>, specifying the video card as a Chips &amp; Technologies
65550, with 1 Mb of video RAM, and a ``custom'' monitor, with 640x480
resolution @ 60 Hz (the first choice on the menu).  The mouse is a PS/2 mouse,
and you should enable 3-button emulation.  The XF86_SVGA server runs flawlessly
in either 8-bit (256-color), 16-bit (64K color), or 24-bit (16M color) mode.
(<tt>Xconfigurator</tt> does not configure the 24-bit mode; you must do this
manually.)  See my <url url="XF86Config">; install it in <tt>/etc/X11</tt> and
use the <tt>startx</tt> command to try it out.

<p> Fujiwara Teruyoshi, <htmlurl url="mailto:fjwr@mtj.biglobe.ne.jp"
name="fjwr@mtj.biglobe.ne.jp">, points out that the Libretto's LCD displays
at most 4096 colors, so that there may be little use for 24-bit mode unless
you are using an external monitor.  

<sect1>Open Windows and XView

<p> Now a brief digression: I did most of my work on Sun workstations for about
10 years, until I started using Linux heavily around 1994.  One of the special
attractions of Linux for me was its support of Sun's freely available (but
unfortunately not widely used) XView toolkit, because this offered the chance
to tell all of my colleagues that, yes, they could run my software on their
PCs, if only they got a <em>real</em> operating system (Linux, of course).
Since then, I've continued to develop my XView-based software under Linux.
Sadly, XView has been left out of Red Hat 5.0, so I went back to my RHL 4.2
CD-ROM and installed xview (and 3 related packages: xview-clients, xview-devel,
and xview-devel-examples) using the package manager.  (These packages are also
still available from Red Hat's FTP server, in <url
url="ftp://ftp.redhat.com/pub/redhat/redhat-4.2/i386/RedHat/RPMS">.)  These
work without problems, provided that the <tt>ld.so</tt> update available from
Red Hat's FTP site has been installed.

<p> To use <tt>olvwm</tt>, the Open Look Virtual Window Manager, be sure that
<tt>/usr/openwin/bin</tt> is in your PATH, then start X and <tt>olvwm</tt>
using the <tt>openwin</tt> command.

<sect>User accounts and passwords

<p> After completing the Linux installation, set a password for <tt>root</tt>
using the <tt>passwd</tt> command.  Even if you are the only user, make a
separate account for yourself (using the User/Group tool included in the
<tt>control_panel</tt> application; see the RHL 5.0 manual for information
about setting up accounts).

<sect>Networking

<p> Before you even consider attaching your Libretto to a network, install all
of Red Hat's security-related updates, protect all accounts with good
passwords, turn on shadow passwords (run <tt>/usr/sbin/pwconv</tt> to do this),
and deny access to your Libretto from outside by editing
<tt>/etc/hosts.deny</tt> so that it contains the single line

<tscreen><verb>
ALL: ALL
</verb></tscreen>

You can then allow local access by editing <tt>/etc/hosts.access</tt> so
that it contains the single line

<tscreen><verb>
ALL: LOCAL
</verb></tscreen>

<p> With files set up in this way, your Libretto should be reasonably secure
while you decide what security policies you may wish to adopt in the long run.

<p> TCP/IP networking using a PCMCIA Ethernet card is straightforward.  Insert
your Ethernet card, physically connect it to your network, then use Red Hat's
X11-based <tt>netcfg</tt> utility (also available from the
<tt>control-panel</tt> application) to set up networking.  If you prefer not to
use <tt>netcfg</tt>, see the NET-3-HOWTO for details on setting up your
configuration files.

<sect1>Netscape

<p> You can download Netscape's Navigator web browser (or the entire Netscape
Communicator suite) for Linux from Red Hat's or Netscape's web sites.  Netscape
4.04 installs and runs well under RHL 5.0, although you should avoid
transferring Netscape configuration files from another system, since doing so
may make it difficult to configure Netscape properly for the Libretto's 640x480
screen.

<sect1>SSH

<p> If you use your Libretto for remote access to other computers, <tt>ssh</tt>
is a much better choice than the traditional <tt>telnet</tt>, for security
reasons.  Visit the <em>Ssh (Secure Shell) Home Page</em>, <url
url="http://www.cs.hut.fi/ssh/">, for information and links to sites from which
<tt>ssh</tt> may be downloaded freely.  The current version,
<tt>ssh-1.2.25</tt>, compiles and works without problems on the Libretto.

<sect>Advanced Power Management (APM)

<p> The Libretto 70 has BIOS support for APM 1.1, but you must enable it in
the BIOS setup (accessible by pressing and holding the Esc key while booting,
then pressing F1 when prompted to do so), or within Toshiba's Power Saver
application (accessible from the Windows 95 Control Panel).

<p> APM support is included in the kernel if you have followed the instructions
above.  The relevant settings in <tt>/usr/src/linux/.config</tt> are:

<tscreen><verb>
CONFIG_APM=y
# CONFIG_APM_IGNORE_USER_SUSPEND is not set
CONFIG_APM_DO_ENABLE=y
CONFIG_APM_CPU_IDLE=y
# CONFIG_APM_DISPLAY_BLANK is not set
CONFIG_APM_POWER_OFF=y
</verb></tscreen>

<p> The Libretto has a particularly nice feature referred to by Toshiba as
``hibernation mode'', which (if properly configured) allows you to suspend the
Libretto simply by folding the display panel down over the keyboard.  I used
Toshiba's Power Saver application to set my Libretto to suspend when the panel
is closed, and to shut off after 10 minutes in hibernation if the system is
running on battery power.  When the Libretto enters hibernation mode, it saves
its state (the contents of RAM) in the hidden portion of its internal disk, and
then shuts off the disk drive.  If the display is reopened within 10 minutes,
the contents of RAM are unchanged and the system can be used immediately.
After 10 minutes, or if the battery has been changed, the contents of RAM are
restored from disk, an operation that takes about 20 seconds.

<p> When resuming operation after the Libretto has been suspended while an X
session is in progress, I have occasionally found that the mouse pointer will
be frozen for as much as 30 seconds.  This seems to occur only if I attempt to
move the mouse pointer while RAM is being restored from disk, or within a
second or two afterwards.  It appears that this problem can be completely
avoided simply by not touching the mouse for a few seconds after resuming
operation.  Another harmless effect occurs when running X in 24-bit color mode:
the mouse pointer becomes black (not invisible, just black) after return from
hibernation.

<p> The state of the battery can be determined by examining <tt>/proc/apm</tt>,
for example, like this:

<tscreen><verb>
cat /proc/apm
1.2 1.1 0x02 0x00 0x01 0x02 47% -1 ?
</verb></tscreen>

(In this case, the output, shown on the second line above, indicates that the
battery charge is at 47% of capacity.)  The estimated time remaining, available
from some APM implementations, is apparently not provided by the Libretto.
The flag bits indicate if the Libretto is running on battery or external power
(experiment to see how this works).

<p> The kernel is configured to attempt to reduce power consumption while idle,
and it also supports turning off the Libretto upon a system halt.  It is thus
possible to use the command

<tscreen><verb>
shutdown -h now
</verb></tscreen>

to shut down Linux cleanly and turn the system power off.  In combination with
wakeup mode (accessible from the Windows 95 Power Saver application, or from
the BIOS setup), the Libretto can thus be made to turn itself on at a scheduled
time, perform some task, and then turn itself off again.  (To access the BIOS
setup, hold down Esc while the Libretto is booting, then press F1 when prompted
to do so.)

<p> You may wish to obtain the Linux APM utilities, <url
url="ftp://ftp.cs.unc.edu/pub/users/faith/linux/apmd-2.4.tar.gz">; these
include <tt>xapm</tt>, a tiny X11-based application that displays a battery
status indicator in an X-window.  Also check out the <em>Battery Powered Linux
Mini-HOWTO</em>, <url
url="http://sunsite.unc.edu/LDP/HOWTO/mini/Battery-Powered.html">.

<sect>Sound support

<p> Sound support is also included in the kernel if you have followed the
instructions above.  The relevant settings in <tt>/usr/src/linux/.config</tt>
are:

<tscreen><verb>
CONFIG_SOUND=y
CONFIG_AUDIO=y
CONFIG_MIDI=y
CONFIG_YM3812=y
# CONFIG_PAS is not set
CONFIG_SB=y
CONFIG_ADLIB=y
# CONFIG_GUS is not set
# CONFIG_PSS is not set
# CONFIG_MPU401 is not set
# CONFIG_UART6850 is not set
CONFIG_UART401=y
CONFIG_MSS=y
# CONFIG_SSCAPE is not set
# CONFIG_TRIX is not set
# CONFIG_MAD16 is not set
# CONFIG_MAUI is not set
SBC_BASE=220
SBC_IRQ=5
SBC_DMA=0
SB_DMA2=1
SB_MPU_BASE=330
SB_MPU_IRQ=5
MSS_BASE=530
MSS_IRQ=5
MSS_DMA=1
DSP_BUFFSIZE=65536
</verb></tscreen>

<p> The Libretto is not capable of accepting sound input,
and the output through the tiny speaker next to the display panel is fair
at best.  Using the stereo output jack to drive headphones or external
speakers, however, much better sound can be obtained.

<p> To test the sound driver, try

<tscreen><verb>
cp "/dos/windows/media/The Microsoft Sound.wav" /tmp/tms.wav
play /tmp/tms.wav
</verb></tscreen>

<p> If you have a MIDI file, such as the ``<tt>canyon.mid</tt>''
demonstration included with most Windows distributions (though not on
the Libretto), try playing it using <tt>playmidi</tt> (or, under X,
<tt>xplaymidi</tt>).

<p> Use an application such as <tt>xmixer</tt> to adjust output volume and
balance.

<p> Fujiwara Teruyoshi, <htmlurl url="mailto:fjwr@mtj.biglobe.ne.jp"
name="fjwr@mtj.biglobe.ne.jp">, reports that the Libretto's audio output may be
corrupted after resuming from hibernation, and that this can be fixed either by
playing a very short audio file, or by compiling the sound driver as a module
and loading it via <tt>kerneld</tt>.  This problem may be specific to the
Libretto 50;  I haven't encountered it on the 70.

<sect>Wish list

<p> A few things I haven't yet done:

<itemize>

<item>
As noted earlier, I haven't set up <tt>dosemu</tt> yet, but I would like to
find out if this might offer a way to use the diskette drive indirectly while
Linux is running.

<item>
I haven't figured out how to get the IrDA port working under Linux yet.  The
only other IrDA-equipped device I have is an HP Laserjet 5MP, which seems
totally uninterested in whatever the Libretto might be transmitting from the
IrDA port.  As an aside, getting this to work under Windows 95 is not
documented and is fairly tricky.  Following Toshiba technical support's
recommendation, I moved the IrDa port from (COM2, IRQ3) to (COM3, IRQ4),
changing the other serial port from (COM1, IRQ4) to (COM2, IRQ3) to avoid a
conflict.  Using the Windows Add New Hardware wizard with automatic searching
turned off, I added support for a generic IR device, which (under Windows) is
implemented as a pair of virtual ports (COM4 and LPT3).  Having done this, I
installed my printer driver, specifying that the printer is attached to LPT3.
This works, but interferes with hibernation mode under Windows 95 for unknown
reasons (although hibernation mode under Linux continues to work properly).

<p> The Linux/IR Project is working on an IrDA-compliant protocol stack for
Linux, which when completed will support networking between IrDA-equipped
computers as well as printing.  Visit their web site, <url
url="http://www.cs.uit.no/&tilde;dagb/irda/irda.html">, for further
information.

<item> Modems and PPP or SLIP networking on the Libretto remain unexplored so
far.  Both the stage 1 and the stage 2 kernels support PPP and SLIP (via
modules), so it should be possible to configure either service in the same way
as on any other Linux PC if you have the hardware.  Under Windows 95, the
Libretto can be configured to turn off a PCMCIA modem when it is not in use,
which is highly desirable if you usually leave a modem in the PCMCIA slot.
These cards typically drain the battery rapidly and may cause overheating if
powered on for long periods.  (The Libretto protects itself from damage with a
thermal sensor that shuts it down if it gets too hot.)  For another alternative
to Ethernet networking, see Grant Taylor's <em>Portable Computing with
Linux</em> pages, <url url="http://www.picante.com/&tilde;gtaylor/portable/">.

</itemize>

<sect>Top ten reasons to run Linux on a Libretto

<p>
<descrip>

<tag>10.</tag> Impress your friends.

<tag>9.</tag> Develop and maintain your fine motor skills.

<tag>8.</tag> Your CPU has only a finite number of cycles before it becomes
senile.  Don't waste them running Windows 95.

<tag>7.</tag> Librettos are the environmentally conscious choice for running
X11 -- they conserve endangered pixels.

<tag>6.</tag> Unlike other notebooks, a Libretto will fit in your pocket -- if
you have large enough pockets.  (Joking aside, mine gets a lot of use because
it goes everywhere; unlike other laptops, there isn't a major ``threshold of
need'' that must be exceeded to outweigh the inconvenience of dragging it
along.)

<tag>5.</tag> With <tt>xephem</tt> (see <url
url="http://iraf.noao.edu/&tilde;ecdowney/xephem.html">), a Libretto running
Linux is smaller and more useful than a set of star charts for amateur
astronomers.  If you aren't an amateur astronomer yet, get <tt>xephem</tt> and
look up at the sky tonight.

<tag>4.</tag> Do anything your workstation could do two years ago, anywhere.

<tag>3.</tag> Compile new kernels while commuting.  (Demonstration performed
on closed roads by professional drivers.  Always use safety belts.  Kids,
don't try this.)

<tag>2.</tag> If the One True Editor was meant to run under Windows, it would
have a menu bar instead of key bindings like Esc+Meta+Alt+Ctrl+Shift.  (What's
that?  It has a menu bar, too?  Never mind, then....)

<tag>1.</tag> Who needs floppy disks anyway?

</descrip>

<sect>Disclaimer

<p> I hope that the information contained in this document helps you to do
something useful.  If it's incorrect or misleading, please <htmlurl
url="mailto:george@hstbme.mit.edu" name="tell me"> so I can fix it!  Anything
you do with a computer has the potential to cause RSI, financial hardship,
plagues of locusts, and other unanticipated consequences.  This is no
exception, so please take responsibility to be informed about what you are
doing.

</article>
