Installing RedHat Linux on a Sony PCG-838 Notebook

Update (21Nov00): Upgrading the disk to 18 Gb

I managed to install Redhat 5.2 Linux on a Sony PCG-838 notebook computer with amazingly little trouble. These are the things I learned. (NOTE: Please excuse the stream of consciousness style here. I wrote myself notes as I installed Linux on my laptop, and I think that they might be helpful to others like myself who are not very knowledgeable about Linux, Windows, and notebook computers. Likewise, excuse the minimal htmlization -- I found the most helpful thing for me was to get a complete paper listing that I could spill coffee on rather than having a fancy, tree-structure HTML document with blinking icons.)

I purchased a Sony VAIO PCG-838 ($2870 from Microwarehouse) on March 25, 1999

    Pentium II 366 MHz CPU
    6.4 Gb disk
    128 Mb memory (upgraded from 64 Mb for $120)
    DVD/Floppy/56k modem
    13.3" TFT XGA (1024x768) screen

I also purchased an extra battery ($104 after rebate), an extra AC adaptor ($89), a 3COM 10baseT 589ET PCMCIA ethernet card ($126, but probably should have gone for the XJACK version), and an Adaptec APA-1460B SCSI PCMCIA card ($165) .

There are two bad pixels which are fairly bright but not overwhelming. Have to keep an eye on this display... (Apr 7: now 3; Apr 8: back to 2).

Sound quality was initally *very* quiet. Calling Sony about it didn't help -- the guys there were nice but didn't really know anything. I eventually learned about two things: The Win98 control panel for volume has different sliders for WAV and overall volume. The WAV slider usually is found near 1/2 and it's the thing which controls most of the Win98 sounds (and DVD playback). Then I discovered that the BIOS "audio" control had sound set to "1" which is darn quiet, much better when I set to "8". I think, actually, that this only affects the sound when booting up and it doesn't seem to help the overall sound volume when Windows or Linux is up, but it made me feel better. I would have expected Sony to do better on the sound!

The very first thing I did was to hook up a printer and print out the system/device information found by right-clicking on "My Computer" and asking for properties. I've never used the information, but it's the sort of thing that you wish you had when things go wrong.

The Windows stuff seems to work OK. I played back a DVD movie and it was quite respectable. You definitely want to use headphones, it is mighty tight for more than one person to watch, and it got a little jerky in places (possibly my fault for running the media bar at the same time), but all in all it was a lot better than what you usually get on an airplane. The sound quality on headphones was good and the volume was OK, but only when set all the way up. In a noisy environment it might not be loud enough.

It is very interesting to visit the BIOS and see what the options are. It is accessed by holding down "F2" during those moments after power up when the SONY appears on the screen.

Time to start on Linux!

I found the following web pages *incredibly* useful. THANKS! The Linux on Laptops is simply essential, and Chris McDonough and Gary Foster had extremely useful writeups of their experiences with Linux on a PCG-808 which is apparently very similar to this PCG-838. A lot of what I write here is simply a rehash of what they already wrote. In fact, you should definitely read what they wrote first because I'm not reiterating some of the things they explain in detail. I'm sure there are confusing things which I don't mention here because I was following their instructions.

  Linux on Laptops = www.cs.utexas.edu/users/kharker/linux-laptop
  Chris McDonough = sharon.iqgroup.com/vaiopcg808.html
  Gary Foster = home.earthlink.net/~fosterg/laptop/install_vaio.html

First I had to reduce the size of the C: partition (initially the entire disk) to 2 Gb. I started by defragmenting the disk under Win98. Probably not necessary since this disk was practically unused. (Select C: and properties gets you into the defragmentation utility.) I got FIPS2.0 (THANKS, Arno Schaefer!) off of the web ( www.igd.fhg.de/~aschaefe/fips/) and used it to repartition the disk by splitting the Windows 98 C: partition. I'm told that "Partition Magic" is also good for this, but FIPS is free.

I copied fips2.0 onto a floppy and then onto the Win98 disk and unzipped. Reading and following the instructions, I created a bootable floppy in drive A: by inserting a blank floppy, formatting, going to DOS mode and typing "format a:/s". I also copied the files RESTORRB.EXE, FIPS.EXE, and ERRORS.TXT to the floppy at this time. I verified that I could boot off of the floppy by leaving it in the drive and cycling the power. (Just for yuks after typing "exit" in DOS and getting the SONY screen, I hit "F2" to see the BIOS and verified that the BIOS looks at the floppy before the hard disk when booting up.)

Next step in FIPS is to boot off of the new floppy, and then type "fips". I found things pretty much followed the fips documentation. I actually made a mistake the first time around, allocating only 1.5 Gb for Win98 (which left no room for games or Microsoft Office), and fixed my mistake by undoing the fips partition with RESTORRB and starting over. (I guess the fact that Windows uses twice the disk space of a really loaded up Linux system means that it's twice as good.) This is what fips saw when it first looked at my disk:

            --- start ----        ---- end -----  start
Part. boot? Head Cyl. Sect System Head Cyl. Sect.   Sect.     #sect  MB
1      yes    1   0     1    0bh   239 810   63         63 12262257 5987
4       no    0 811     1    a0h   239 837   63   12262320   408240  199
Here is what fips chose as a starting split point between my C: and new D: partition and what I altered it to using the arrow keys to give me 2/4 Gb for C/D:
   Old: 1122.2   Cyl: 152   New: 4865.3    <= original C:, split, and D:
   Old: 1986.0   Cyl: 269   New: 4001.5    <= after fips

And that was that. When I answered "Y" that this was OK, fips apparently exited with a crash, but it seems to have done the right thing anyway.

On to Linux. I booted off of a Redhat 5.2 Linux floppy, and then put the CD Rom in when the system was up.

Start answering questions. Here's the non-obvious branch points:

Select "Workstation" and I cannot proceed because of "not enough disk space" Go back to "Custom" and I'm asked to partition the disk with "Disk Druid".

I found hda1 as the Win95 FAT32 (1985 M), hda2 as Win95 FAT32 (4001M), and hda4 as 0xa0 (199M). Apparently hda4 is used for hibernation and is not to be messed with. So I didn't.

Delete the hda2 partition and create the following ones:

Mount   Size    Growable      Type        Allowable drive   Becomes
(win)  1985M       No     Win95 FAT32          hda           hda1    
(hiber) 199M       No     0xa0                 hda           hda4
/       100M       No     Linux native         hda           hda5
/usr   1100M       No     Linux native         hda           hda6
swap    100M       No     Linux swap           hda           hda7
swap    100M       No     Linux swap           hda           hda8
swap    100M       No     Linux swap           hda           hda9
/home  2000M      Yes     Linux native         hda           hda10

Then it wants to reboot because I modified an extended partition.

Now I can select "Workstation". Say OK to having all the new partitions erased. Of course, now I wonder if it's going to wipe out my hda1 partition...

Off it goes doing its thing, loading all sorts of stuff. Resumes asking questions.

Mouse type:    ALPS GlidePoint (PS/2) and [*] Emulate 3 Buttons.

Supposedly this is all worthless and I will load the appropriate X later, so these are somewhat nominal.

Xconfigurator: NeoMagic (laptop/notebook)
Monitor:       custom
Sync rate:     Super VGA 1024x768 @ 87 Hz.
Vertical rate: 50-70
Screen:        Don't Probe
Video Memory:  2 M
Clockchip:     No clockchip setting
Probe now:     Skip
Video modes:   8-bit and 16-bit @ 1024x768

Network conf:  skip

Timezone:      Hardware clock in GMT, Hawaii time zone

Printer:       Select a generic postscript printer

Root password: xxxxxxxxxx

Create a floppy bootdisk (must have been preformatted!)

Reboot, and all seems well. Lilo gives me linux and dos as choices, Windows boots OK (when I select dos) By the way, after Linux changed the partition to Linux Native instead of FAT32 it is no longer seen by Win98. This was a relief because when Windows detected the D: partition, it would ask if I wanted to format it. (No thanks, Bill!)

Linux boots OK. However, the damn Disk Druid has given me the following partition:

/dev/hda6  3901432   362753   Size/used   /
/dev/hda5    21927      596   Size/used   /boot

Nuts. I don't see any way around this rather than a complete reinstall of Linux. I don't know how to undo this monster partition the "Workstation" selection made for me! I think probably the "Workstation" choice was a bad one -- it appears to have mashed my partition choices.

Yup. Going back through the "Custom" installation and disk druid shows that my partitioning got trashed. Oh well. Life is long...

Do it all over again, changing things very slightly...

Mount   Size Actual Growable      Type        Allowable drive   Becomes
(win)  1985M 1985      No     Win95 FAT32          hda           hda1    
(hiber) 199M  199      No     0xa0                 hda           hda4
/       100M  103      No     Linux native         hda           hda5
/usr   1100M 1100      No     Linux native         hda           hda6
swap     95M   95      No     Linux swap           hda           hda7
swap     95M   95      No     Linux swap           hda           hda8
swap     95M   95      No     Linux swap           hda           hda9
/home  2000M 2510     Yes     Linux native         hda           hda10

This time (via "Custom") Linux is asking me which partitions I want to use for swap and whether I should check them for bad blocks during formatting (yes). I guess that FAT32 which I turned into Linux Native and then caused the reboot only got things started. The subsequent install as a "Workstation" wiped out all my partitioning.

Continue on... Respond "yes" to reformatting of all the Linux Native partitions: /, /usr, and /home. Check for bad blocks (yes).

Agree to the components to install, adding Printer Support. Tells me to look for /tmp/install.log for a log of the installation.

Goes off and makes ext2 filesystems on /dev/hda5, /dev/hda6, and /dev/hda10. Then starts dumping everything from the CD onto the disk.

Mouse type:     ALPS GlidePoint (PS/2) and [*] Emulate 3 Buttons.

Supposedly this is all worthless and I will load the appropriate X server later, so these are somewhat nominal. On the other hand, that NeoMagic option looks like it might work, but I didn't bother to find out.

Xconfigurator:  NeoMagic (laptop/notebook)
Monitor:        Generic
Probe now:      Probe (what the heck, screen blinks a few times)  
		gives me 8bpp, 640x480.  Worthless, go back...
Probe now:      Don't Probe
Video Memory:	2 M
Clockchip:	No clockchip setting
Probe now:	Skip
Video modes:	8-bit and 16-bit @ 1024x768

Network conf:	skip

Timezone:	Hardware clock in GMT, Hawaii time zone

Services:	OK to all defaults suggested

Printer:	Select a generic postscript printer

Root password:	xxxxxxxxxx
Create a floppy bootdisk (must be preformatted!)
Lilo:		/dev/hda (Master Boot Record), no boot options
Bootable part.:	Change name of label for /dev/hda1 to "win98"

OK, Lilo shows me a choice of linux and win98 now, and win98 still seems to boot OK. Whew. Run the disk check (control panel -> C: -> properties); all seems OK.

Reboot again and let Linux come up. Ah, df shows what I wanted to see! Edit /etc/fstab again to add ",user" to the flags on /dev/fd0 and /dev/cdrom, and add a line to allow us to see the Win98 partition:

/dev/hda1      /mnt/win98      vfat    defaults        1 2

Unfortunately it looks like only 180-odd Mbyte of stuff was loaded up and there are tons of packages missing (e.g. emacs!).

Now, let's see what we can do with X.

Get the XFCom-neomagic package:

  at ftp://ftp.redhat.com/pub/WFCom/XFCom-neomagic-glibc-2.0.0-1.i386.rpm
  or http://www.precisioninsight.com

follow the instructions in README, essentially:

  rpm -ivh XFCom-neomagic-glibc-2.0.0-1.i386.rpm
  ln -sf /usr/X11R6/bin/XFCom_NeoMagic /etc/X11/X
  mv /etc/X11/XF86Config /etc/X11/XF86Config.old
  cp /etc/X11/XF86Config.neomagic /etc/X11/XF86Config

Type "startx" and by god it works! Amazing. That was *easy*. I can either start up the server in 8 bit mode (default) if I need to run software which wants PseudoColor, or I can start up in 16 bit TrueColor mode using "startx -- -bpp 16"

Set the time and reboot. Note that the Time Machine (from the control-panel) wants to be set in GMT (assuming that's what was selected prior for system time), not local time zone.

Lots of packages to find and install! Get them off of the RedHat CD, checking an RPM on /mnt/cdrom versus an RPM on existing packages. Pretty tedious, especially when you need to know things like Applications/graphics/xfig needs to have transfig which is found in X11/applications/graphics. Probably the package manager has a search function, but I couldn't find it. Boy, this really is bad. There's all sorts of obvious things that aren't there, like the X libs (XFree86), the stdio library (!), gcc, etc, etc. Takes lots of looking. I suspect that a lot of them were loaded automatically if I had selected the "Workstation" option, or there may have been a good moment during the "Custom" installation (which I missed) when I could have specified a reasonable set of packages to install.

Basically most things are pretty good. I want to run twm for the time being, but might switch back to FWM2 since I'm probably going to be forced out of TrueColor anyway? The two things which I *HAVE* to do are to edit /etc/inittab so that Ctrl-Alt-Delete halts instead of rebooting (I want a real shutdown instead of having to watch for the BIOS to reboot and hit the power key at the right time):

  ca::ctrlaltdel:/sbin/shutdown -t3 -h now

Also, I *HAVE* to remap that stinking CapsLock to Control. First of all, create a file "us_sane.map" which is the same is "us.map" found in /usr/lib/kbd/keymaps/i386/qwerty, except that

   keycode  29 = Caps_Lock
   keycode  58 = Control

instead of vice-versa. Gzip the new file, then go to /etc/sysconfig/keyboard, and change the entry to "us_sane". Reboot. Unfortunately this doesn't actually appear to map Caps_Lock onto the "Ctrl" key and both keys act at Control, but that's OK by me.

I disabled the IR port by getting into the BIOS (F2 during SONY display at bootup) and disabling it. This I expect will allow me to use IRQs 10 and 11 for the two PCMCIA cards.

I used /usr/sbin/sndconfig to configure my sound card. It didn't find anything from probing, so I added the following stuff (from Gary Foster's PCG-808 page).

Soundblaster card
IO base = 220
IRQ = 5 (because 3 conflicts with the internal modem)
DMA = 1

It warns me that it's going to rename /etc/conf.modules to /etc/conf.modules.bak and overwrite... The test sound sample was a sentence narrated by Linus telling me how to pronouce Linux. (Short "i".)

Serial ports. There are two, and again according to Gary, the modem is on /dev/cua1, and he suggests "ln -s /dev/cua1 /dev/modem", which I did. When I watch carefully during boot up I see that /dev/cua0 is IRQ 4 and /dev/cua1 is IRQ 3.

Apparently the PCMCIA cards will conflict with IRQ 3 (modem) unless told not to, so I found the line in /etc/sysconfig/pcmcia which lists PCIC_OPTS and altered it to look like

	PCIC_OPTS="irq_list=11,10"

I retrieved the latest pcmcia stuff (3.0.9) from hyper.stanford.edu/HyperNews/get/pcmcia/home.html compiled it and installed it. I had to also get the XForms stuff separately while snarfling Xbatstat

   www.flatout.org/~daisuke/Linux/xbatstat/bxfrm-081.tgz

and install it before I could compile the GUI cardinfo. All the cardmgr and cardinfo stuff lives in /sbin. I manually did a setuid root on cardinfo so the general unwashed can use it -- it looks quite useful.

Now I set about rebuilding the kernel in order to turn on APM. I went to /usr/src/linux and followed the README. Using "make xconfig", I basically left all the defaults alone, except that I chose:

   General setup/
   Processor type: PPro   (appropriate for Pentium II)

According to the latest PCMCIA stuff (3.0.9) I can delete all Linux network card drivers (I didn't bother), and I'm supposed to turn this off if I want to use a PCMCIA ethernet card (necessary? who knows?):

   Network device support/
   Pocket and portable adaptors: (N)

I made sure that VFAT and ISO9660 support was "Y" (not "M" just as a module) because I always want to be able to mount CDs and my win98 partition:

   Filesystems/
   ISO9660 cdrom filesystem support: (Y)
   VFAT (Windows 95) fs support: (Y)

and I turned on APM according to Chris McDonough:

   Character Devices kernel options/
   Advanced Power Management BIOS support: (Y)
   Enable PM at boot time: (Y)
   Power off at shutdown: (Y)

I wrote both the usual ".config" from which things are compiled as well as a visible version "mykernel.config". Then "make dep" and "make zImage". Of course I was missing "as86" which I presume is the assembler. It was in development/languages/bin86. Obviously I'm going to need the RedHat CD for a long time before I get all the packages I need onto disk. Clearly if I had opted for the "Workstation" option during the install I could have short-circuited a lot of this pain!

Because I'm chicken about this, I copied zImage to /boot and edited /etc/lilo.conf to offer a third boot option, with this one called "newlinux". I need to run /sbin/lilo to get it to look at this altered configuration file, though.

This seems to work OK, now and actually shuts down the power after a shutdown. I've therefore edited /etc/lilo.conf again to put this new kernel as "linux" and the default, and the original as "origlinux".

The SCSI seems really weird, and causes the system to come with a whining sound and complaining about "free block isn't really free", scaring the hell out of me. So let's just look at the ethernet for the nonce. dmesg seems to show an ethernet card, so maybe it's OK.

I brought up control-panel and set up the networking with appropriate IP addresses, connected up a telephone line, and hoped that ppp would just work. No such luck. When I try my usual "dialout" script ("/etc/sysconfig/network-scripts/ifup ppp0") it says that the system lacks kernel support for PPP. This is true, since I left it as a loadable module, but I don't understand why it isn't loading. So I go back to /usr/src/linux and type "make modules". This starts compiling everything under the sun! I don't know if it literally compiles everything, or whether it's restricted to all the stinking devices which I didn't remove from my kernel configuration, but it's pretty bad. I shudder at the thought of a "make modules_install". The modules.txt file in Documentation says it's easy to remove things, but I sure don't want to do it! Oh well, press on...

Prior to doing this ppp.o was found only in the 2.0.36-0.7/net subdirectory of /lib/modules; now it's in the 2.0.36/net directory as well. Progress? Also, perhaps all I need is a good, relaxing reboot... So let's do it.

Well, I'll be darned. PPP appears to work now. I can dial out, run telnet and ftp, netscape, all the goodies! I can't really test the ethernet until tomorrow, and I'm sure the SCSI will turn out to be more challenging, so I'm not going to sweat it now.

Indeed, when I connect up the ethernet cable from the card to a hub it appears to work just fine. I think it might autodetect and turn on if it were connected at bootup. Failing that, if I plug in the card and connect the cable after bootup I need to either go to the control-panel and set eth0 to active or else go to /etc/rc.d/init.d and execute "network start". No, no autodetect. This will take a bit more fiddling, and in the meantime doing the control-panel thing isn't too strenuous.

I immediately went to the 3com web page and purchased a spare ethernet cable ($25 including shipping) as insurance. Apparently these cables are vendor specific so you can't get them at CompUSA, and I can imagine that they don't last too long (both from a ruggedness standpoint and from the standpoint of the vendor changing format).

I finally got around to plugging in the SCSI and it seems to work fine. The earlier problem was a crufty old CDrom drive which is probably defective. I shut down all the power, connected up a slightly less ancient CDrom drive, and rebooted. Linux saw the card and the device OK, and cardinfo told me what device it had assigned it to (/dev/scd0) (which is always a mystery to me -- I like this cardinfo!). Anyway I was able to mount it on /mnt/cdrom and look at the contents of the disk in the drive, so I suppose this is just fine.

I tried exercising the hard disk hibernation function with a "Fn F12", and it brought up a screen which told me it was writing to disk (extended memory taking about 30 seconds). Upon completion it shut the machine right down. I then momentarily pushed the on-off switch to on, and it gave me a screen telling me that it was doing a "Resume from disk", and again it took about 30 seconds to read back the extended memory. Back came X, working as always, and it resumed ethernet traffic through the PCMCIA card without a hitch. The memory hibernation "Fn Esc" also appears to work.

I was delighted to see that somebody else (Rob Nation) had realized that xbiff is really stupid and should be part of xclock. Then I found that Booker Bense had hacked up Rob Nation's rclock to show a little pie chart of battery charge. Just want I needed! I grabbed a copy (following the links from Linux on Laptops), compiled it, and found that it hung my machine in a serious way. The reason was because my /proc/apm (Linux 2.0.36) returns something quite different from Booker's, and his code was sitting in an infinite loop reading from /proc/apm over and over. All that time in kernel mode wouldn't even allow the X server to move the sprite! Oh dear. Nevertheless, it was quite easy to fix the code and I took the opportunity to add a few more color options.

Then I discovered that the *latest* rclock (version 2.20, available as part of rxvt) has a lot more fancy features for reminders. Since I don't care to use the reminder stuff, I decided not to bother merging Booker's power monitoring stuff into rclock 2.20 and left it as is. The current program is simple and gives me just what I want: a power meter, clock, and xbiff. If you'd like a copy of my hacked up version of rclock (no guarantees!), you may download rclock-990428.tar.gz. It looks like these batteries are indeed good for close to 3 hours apiece as long as you're not running the disk or DVD continuously, although I'm not sure whether there's a downside if you discharge them to zero.

Performance of DVD drive in reading CDroms appears to be about 2.9 Mbyte/sec (70 sec for a 200 Mb file). I had heard rumors that DVD drives would not read CDR media (or would even destroy them!) but I have had no problems with commercial CDs or CDR.

I'm intrigued by the suggestion that there might be a good directory tree maintainer which would keep a notebook up to date with a primary workstation. I suppose cvs could do this or rdist,but my problem is that the two get out of sync and only *I* know which files are the current ones, so it's hard to declare one machine to be the "master" and the other one the "slave". However, there is this thing called "xfiles" (http://www.idiom.com/~zilla/xfiles.html) mentioned in Linux on Laptops which I'm curious to try out. (Un)fortunately it needs Java, so I'm off to find Java. Apparently what I want is JDK1.2, but it's not 100% ready to go. Nevertheless, here's what I turned up:

  linux and java:   http://w3com.com/paulcho/javalinux/
   download java:   ftp://xfer.nitric.com/pub/java-linux/JDK-1.2/i386/pre-v1/

When I get a chance I'll have to see if I can compile this stuff...

I'll try to update this page as I learn more things, but right now I'm delighted with this little notebook and how well Linux runs on it.


John Tonry, jt at ifa dot hawaii dot edu, last updated April 28, 1999.

This web-page has had  LOTS of visitors since Apr 99.