Linux on Sony PCG-FXA47 laptop

Linux on Sony PCG-FXA47 laptop

14 March 2002 I just bought a new Sony PCG-FXA47 and I'm going to set it up to dual boot Linux.

Repartition disk

First, install Partition Magic 7.0. OK, no problems.

Partition Magic says this is the machine's stock setup:

Partition Type Size MB Used MB Unused MB Status Pri/Log
C: NTFS 7,648.1 3,237.6 4,410.5 Active Primary
*. Extended 11,413.4 11,405.5 7.8 None Primary
D: NFTS 11.405.5 23.8 11,381.7 None Logical
*. Unallocated 7.8 0.0 0.0 None Logical
*. Unallocated 15.7 0.0 0.0 None Primary

My first instinct is to nuke the second extended partition, including the D: and two unallocated chunks. Then merge it with the third primary partition.

Delete partition D:, OK.
Resize partition 2 to use all remaining space, OK.

Now, because of the 2 gigabyte boot limit, we need to create a small root partition for Linux, at the low end of the disk space (but swap and user space can be higher). This in turn requires the NTFS partition to be moved up a bit, to make room for it.

Move the NTFS partition up by about 512M, OK.
Create Linux Ext2 partition in the 512M just created, OK.
Create Linus Swap partition, 512M, at beginning of unallocated space, OK.
Create Linux Ext2 partition, 10G, in remainder of space, OK.
Apply all changes ... takes a while, to do all that moving, but completes OK.
Reboot Windows to make sure the NTFS partition still works, OK.

Now here is the new disk layout:

Partition Type Size MB Used MB Unused MB Status Pri/Log
*. LinuxExt2 509.8 16.3 493.6 None Primary
C: NTFS 7,138.2 3,238.7 3,899.5 Active Primary
*. Extended 11,429.1 11,429.1 0.0 None Primary
*.SWAPSPACE LinuxSwap 509.8 0.0 509.8 None Logical
*. LinuxExt2 10,919.1 402.6 10,516.6 None Logical

Good. This looks ready for Linux installation.

Get device information

While I'm hunting down the Linux distribution that I want, I use the Windows control panel to gather information about the display, audio, and storage devices on this machine.

The display itself is listed only as a Sony LCD 1024x768 screen. Here is the video hardware information:
Video HW ATI RAGE MOBILITY-M1 AGP
Chip type ATI RAGE Mobility P/M AGP 2X (A21/2)
DAC type ATI Internal DAC
Memory size 8 MB
Adapter String 1002-4C4D-64-104D-80F6
BIOS info SDRAM BIOS 4.227aT(SONY-NE3)

Here is information on some of the other devices:
Keyboard Standard 101/102 Key or Microsoft Natural PS/2
Mouse Alps Electric pointing device
Audio VIA AC'97 Audio Controller (WDM)
DVD/CDRW Matshita UJDA720 DVD/CDRW
Ethernet Realtek RTL8139 Family PCI Fast Ethernet NIC

Install Slackware

19 March

Got the Slackware distribution (ordered from web site Friday afternoon, received it Monday, thanks guys!) Boot from CD-ROM and run fdisk. It detects all the partitions fine. the root partition will be hda3, swap hda5, usr hda6.

Run setup, tell it to set hda5 as the swap partition. OK
Set hda3 as the root partition. OK
Set hda6 as /usr seems to work, took a couple of tries.
Set hda1 as /win OK
Go to install and select full install (assuming it won't try to put all 2GB of stuff on the 0.5GB root partition). Away we go ...

Kernel is 2.2.19 OK

Error: Target partition full! Oy what a drag. Looking around, I see that /mnt has /usr under it, which is all full of the stuff that I wanted to go to the hda6 partition. I think I didn't correctly set hda6 as /usr the first time. Try it again. Reformat hda3 and hda6 in the process, to make sure they are clean.

Nope, same thing happens again. /mnt and /var are the directories that are huge, but /usr and /mnt/usr are _not_ the same, /mnt//usr is the big partition, which is almost empty. /mnt and /var/log/mount are both 100% full. Crud.

20 March

Try putting the 10GB partition as /var and see if that gives it the necessary space. Nope, the error(s) different now, but it's still crapping out, and it's fairly clear that it's running out of space.

Use PartitionMagic to move the NTFS partition up, give the root partition about 1.5 GB of space, see if that's enough. Have to fiddle around with shrinking each of the higher paritions first, OK. New partition configuration looks like this:
Partition Type Size MB Used MB Unused MB Status Pri/Log
*. LinuxExt2 1,506.1 48.7 1,457.3 None Primary
C: NTFS 6,142.0 4,551.0 1,591.0 Active Primary
*. Extended 11,429.1 11,429.1 0.0 None Primary
*.SWAPSPACE LinuxSwap 509.8 0.0 509.8 None Logical
*. LinuxExt2 10,919.1 402.6 10,516.6 None Logical

Try a full installation (which their documentation says takes about 2GB). Okay, that looks like it works fine. Create LILO bootdisk as prompted, OK. Do not create /dev/modem, there's a builtin modem on this machine that I don't think is on a serial port.

Use expert LILO intallation to put LILO in the superblock of the root Linux config, which seems like the right thing to do, OK. Select default mouse, no network, standard SMTP for sendmail, KDE for X window manager, all seem to work OK.

Reboot. The machine boots Windows with no LILO evident.

Reboot from LILO floppy, the only option is "mount" and it does boot the system okay, which is good. The two Linux disk partitions are there (but not the Windows partition).

X windowing

Try "startx" and it craps out with "Fatal server error: no screens found" which is not good. Look in the log file at /var/log/XFree86.0.log and see the first warning message is "(WW) Cannot open APM" followed by a whole bunch of informational messages, and finally the error message "(EE) No devices detected."

Run SuperProbe to examine the video setup.

First video: Super-VGA
Chipset: ATI Rage Mobility (Port Probed)
Memory: 8192 Kbytes
RAMDAC: ATI Mach64 integrated 15/16/24/32-bit DAC w/clock
(with 6-bit wide lookup tables (or in 6-bit mode))
(programmable for 6/8-bit wide lookup tables)
Attached graphics coprocessor:
Chipset: ATI Mach64
Memory: 8192 Kbytes

Run xf86config. Choose mouse protocol 1. hsync - choose 6 SVGA 1024x768 @ 60 Hz OK. vsync - choose 1 50-70 Hz OK. chipset - choose 36 for ATI Rage OK. vRAM - enter 8192 manually.

Try startx, the warning is the same but the error is different now.
(EE) ATI(0): No Display subsection in Screen section "Screen 1" for depth/fbbpp1/1
(EE) Screen(s) found, but none have a usable configuration.

22 March

Spec sheet says: Graphics chipset is ATI 3D RAGE Mobility M1. I've got XFree86 Version 4.1.0 (according to the man page) Their website says 4.2.0 is the latest.

Their driver status document says "4.2.0: Accelerated support is provided for Mach64, Rage, Rage 128 and Radeon chips by the "ati" driver, as is unaccelerated support for all of the others except the Mach8 and some early Mach32 chips.

They don't say anything specific about RAGE Mobility chips, and they don't say if 4.1.0 supports those chips. Think it's worth while downloading 4.2.0? I will need to get the laptop's network going, or dump it on a CDR (probably easier).

Neither cdrom nor floppy disk exists as mountable right now. Need to either build these things and make them work, or get network operational and download directly from the FTP server. Let's try the network first.

Now what device have I got here? Don't have rc.netdevice in /etc/rc.d/ but using Windows, I saw a Realtek RTL8139 so try that. Uncomment the corresponding modprobe line in /etc/rc.d/rc.modules (which is line 368 if anyone cares), and run rc.modules. It says "Module dependencies up to date (no new kernel modules found)." I hope that's good.

Now run ifconfig alone, shows the local loopback, good.

ifconfig 192.168.1.102 broadcast 192.168.1.255 netmask 255.255.255.0

route shows the typical entry, looks okay. Run netconfig, tell it to use otolith.com as name and DHCP to get IP address. Okay, now it pings the IP address of my other local machine fine. Still don't have access to the gateway or to the larger Net.

route add default gw 192.168.1.1 OK. Then edit /etc/resolv.conf and add AT&T's nameservers, OK. Now I can ping outside machines, looks fine!

Now return to the X stuff, and try to download the stuff. First get Xinstall.sh which probes my system, OK. It says Linux-ix86-glibc22 is the binary distribution I need.

Move /usr/X11R6 to /usr/X11R6_orig so as to keep the original separate. Then download the twelve mandatory files as described in their Install document. (It's nice to have the cable modem!) Also got the X print server and the virtual framebuffer modules, figuring they'll come in useful.

To install XF86 4.2.0, run the install script, and install everything except for the virtual framebuffer package (keep it in reserve for now). OK. Run xf86config and choose hsync 6, vsync 1, card 37 (ATI Mach64 (264GT) aka 3D RAGE). Done, now X does start, but the resolution is clearly way too low, I'm only seeing a corner of the screen in very coarse rendering. Run xf86config again, this time select video modes 432 for 24-bit, and choose 24 bit default. That fixes the resolution problem.

The mouse is not working right, the slightest touch slams it into the top left corner. Run xf86 again, selecting PS/2 mouse, that fixes the mouse problem.

I notice intermittent hesitation and slowness in some of the display operations, particularly the web browser and Java, which freezes for up to 30 seconds, this is not good. With a gigahertz CPU and separate video accelerator, this shouldn't be happening. How to figure out what to do?

Next topic: Looks like the current window manager is KDE, which I don't care for very much. See if we can use fvwm instead.

Window manager

25 March

Go to http://fvwm.math.uh.edu/ and download fvwm 2.4.6 and unpack it, OK. Following instructions in README and INSTALL, run the configure script. It says it can't find X, which is kinda weird. (?!) Looks to me like /usr/X11/include and /usr/X11/lib are both there, and they appear to be the first place the configure script looks (around lines 1450-1550). Seems rather odd. Run the configure script with --x-include /usr/X11/include and --x-libraries /usr/X11/lib and now it runs to completion.

Try "make" and it barfs on X11/Xlib.h and X11/Xutil.h not found. Humph. The locate utility says these exist in the old (4.1.0) X include directory, but not in the new (4.2.0) X. It's starting to look like my installation of 4.2.0 was incomplete and I need to get some of the optional packages.

Nuke the fvwm directory and go back to X, get the sources at least. Go to ftp.xfree86.org and get Xprog.tgz (nothing else for now). OK. Run Xinstall.sh again (tell it not to overwrite configuration files) and have it install Xprog (programmer support) and Xprt (print server) but not virtual framebuffer for now, OK. Now get the fvwm 2.4.6 tarball again (deleted the old one by mistake), and try installing it.

Configure script now runs fine without command line arguments, good. (It does report no Rplay support "can't find working librplay" and no Stroke support "Can't find working libstroke" but I'll deal later.) Do "make" and it now runs nicely, good! Lots of stuff gets built. Do "make check" just to be sure, no problems. Finally do "make install" and it runs nicely too.

Now, make X use fvwm. Let's try xwmconfig as in the old 4.1.0 distribution, no good, it bails if it's not in the xinit directory. I thought I should put "exec fvwm" in xinitrc, but it seems the executable is called "fvwm2" so try that. No go ... we get the X startup screen with cursor in the middle, but it never gets to a window manager or desktop. Error log seems to imply that it needs a startup file from somewhere (and cannot function without one, despite what their documentation says, grr).

Find their suggested startup files in the sample.fvwm2rc directory, and try several different ones. They do work, which is good! Now it's just a matter of getting it set up the way I like. Probably the easiest thing to do is go to one of my old machines and clone its setup file.

Ah, but in order to do that, I need to have a floppy drive that I can mount on the Linux filesystem. This is easy enough, add lines to /etc/fstab and create the mount points. OK. Copy the startup file from Speech and try it, it barfs, doesn't like PixmapPath or IconPath stuff. Rewrite them for ImagePath, and have it fall back to the 4.1.0 paths if it can't find stuff in the 4.2.0 directories, OK.

Dual boot using LILO

27 March

To install LILO boot loader, run liloconfig, use expert mode, make new boot record with 1024x768 framebuffer console, install to MBR, add Linux partition /dev/hda3 as "linux", add /dev/hda1 as "dos", it accepts all that OK. Reboot. It displays "LILO 21.7-5" and then boots Linux, without giving me any options. Humph. I suspect the problem is that this is an NTFS partition (not DOS FAT) and there's something weird you have to do to boot it.

Just by the way, the 1024x768 framebuffer display is very nice, it gives you a lot more elbow room!

Compare my /etc/lilo.conf to a known working reference, and see that the reference includes a "prompt" line. Add it -- and be sure to reinstall this lilo.conf with liloconfig! Now I get a nice choice, and it boots both OSs fine! Cool. (It's worth noting that the documentation states that you cannot boot an NTFS partition using LILO. So much for authoritative documentation.)

SmartMedia PCMCIA adapter

28 March

SmartMedia PCMCIA adapter hardware is readily available from Antec Looks like cardmgr(8) will do it if its database is correct. Look in /var/lib/pcmcia/stab and see that it does identify a "ATA/IDE Fixed Disk" when I insert the SmartMedia card (it does nothing with an empty adapter). That's good. Now how do I access the thing?

The stab file includes a reference to hde, so I think that's where the card appears. Do "fdisk /dev/hde" and give it command "p" to print the partition table for the card. Hey, it looks like a FAT12, plain old MSDOS! So put an entry into /etc/fstab to mount it as type msdos, and make a mountpoint for it. Hey, it works! Woo hoo! I'm using a digital camera (Olympus D-460 Zoom), which formats the card as FAT and puts the pictures in [card]/dcim/100olymp/ as JPEGs, and I can view them just fine. Very nice!

Boy that was pretty painless! I wish everything worked that well.

Audio

How about audio? /dev/audio and /dev/dsp exist, but sound gadgets in Java do not make audible sound, and a simple play command fails with "sox: Can't open output file '/dev/dsp': No such device" so I guess I need a driver for the sound hardware (AD1881A). Look at http://www.alsa-project.org/~goemon/ which says either intel8x0 or via686a driver will work.

Burning CDRs using gcombust

haven't tried yet

Mounting the NTFS partition

haven't tried yet

ACPI power control

haven't tried yet

Kernel hacking

15 April

Kernel How-To After way too much fiddling around and false starts, we figured out today that this kernel (Linux 2.2 kernel, get this using "uname -r") doesn't have support for ACPI power management, so I need to upgrade to the 2.4 kernel. In the process, I will try to include NTFS file system and audio modules as well.

Got the 2.4.5 kernel sources already. Set /usr/src/linux to point to linux-2.4.5, OK. In /usr/src/linux do "make menuconfig" to make selections. Under Filesystems, NTFS was a module, make it builtin instead, OK. Under General, turn on ACPI and turn off APM, OK. In sound, look around but don't see anything AC97 compatible, poo.

Try making it with these settings ...
make clean [to get rid of old and outdated stuff]
make dep [to get the dependencies] make bzImage [the kernel proper, a "big Zip image"]
cp /usr/src/linux/arch/i386/boot/bzImage /vmlinuxtest
Edit lilo.conf to allow boot from this image
Run lilo to install the new lilo.conf

Try booting it ... it gets as far as parport0 stuff and then hangs. Ug. Edit /etc/rc.d/rc.inet1 to turn off DHCP for now, since we'll be rebooting a lot and I don't have a net connection here, this will speed up the boot process. OK. Using menuconfig, turn off the parallel port and see if that helps. (Remember to go through all steps again, must clean to get rid of parallel port stuff! Also remember to recopy and rerun lilo to install it!) No dice, it still gets to parport0 (?) and it still hangs there.

Looks like we need to build the modules too. First, move /lib/modules/2.4.5 to an "_old" location so as not to clobber the old modules, in case we need them. Then, in /usr/src/linux/ do

make modules
make modules_install

One problem, "unresolved symbol proc_get_inode in .../wan/comx.o" which we solve by using menuconfig to take out WAN support, just turn it off. Do the makes again, and this time it works. Now we can boot the new kernel just fine. Let's see if we have the new services we wanted ...

NTFS works fine (once I change the entry in /etc/fstab from hpfs to ntfs, oops!!), how nice! Looks like it's all set.

ACPI is definitely there (though I don't yet have an ACPI client), however it's not working correctly. On power down, message appears saying "Could not enter S5" (which is the power-off state). Look at the ACPI HowTo or ACPI4Linux and see if I can get more information about what to do. Have already checked /proc/sys/acpi/ and seen stuff there (but no information, not yet) and look at /proc/interrupts to see that it's on IRQ 9 which should be okay.

Sound is still not working. Check modules with lsmod and see that there's no sound module loaded. Do modprobe ac97 to load the AC97 module, OK but still no sound. Look in /lib/modules/2.4.5/modules.dep to see which other modules depend on AC97, thinking maybe we need a lower level driver. There are half a dozen or so chip-level drivers that depend on AC97, but none of them seem to look anything like the Analog Devices AD1881A which this machine has. Try each one individually ... most fail, but via82cxxx_audio works! And now the play command works, it can play .wav files, but the sound is very quiet. Find a mixer program that will let me adjust the card's mixer settings.

Also, don't forget to turn DHCP back on and see if the network works, and put the parallel port back in (in case I ever need to print or something). Uh oh, DHCP is back on but I still can't access the gateway!? We must not have turned on the right things while building the 2.4 kernel.

Do the following manually to get it working:
modprobe 8139too [this is the hardware driver module]
ifconfig eth0 192.168.1.105 netmask 255.255.0.0

Now it's working fine and I have Internet access ... but the module and config should either be put in a startup script, or built into the kernel.

USB hacking

31 Dec 2002

Refer to the Linux USB Howto at http://www.linux-usb.org/ for directions on this process. First, go to /usr/src/linux/ and configure the kernel for USB using "make menuconfig". Turn on mouse support in Input Core selections, as well as turning on USB HID mouse stuff. This is a VIA motherboard, so use UHCI. OK.

Rebuild kernel and install. Seems OK. Try mounting the USB device filesystem [mount -t usbdevfs none /proc/bus/usb] and see what's expected: two numbered directories (this laptop has two USB ports) and the links for devices and drivers. OK.

Is the mouse being sensed? cat /proc/bus/usb/devices and see three extra lines show up when I plug the mouse in. That's a good sign. However, dmesg shows lines that look like errors: timeout followed by "USB device not accepting new address..." and it's unclear if these are show-stoppers or not. There are two such events every time I plug in the USB mouse, same behavior on either USB port.

/dev/input/mice already exists. Cat this, but it doesn't show anything if I diddle the mouse (either the USB mouse or the built in trackpad). Humph. Looks like those error messages are for real.

Wireless LAN and SmartMedia card repairs

31 July 2003

While trying to get the wireless LAN card working, I downloaded and installed new versions of the wvlan_cs and prism2_cs modules (sources are in /usr/local/bin). This didn't get the wireless card working, but it did wreck my ability to mount the SmartMedia card in its adapter. Apparently I stepped on the PCMCIA drivers somewhere.

/var/lib/pcmcia/stab does identify the "ATA/IDE Fixed Disk" when I insert the SmartMedia card, so cardmgr is basically working, but "fdisk /dev/hde" fails. cardmgr takes its cues from /etc/pcmcia/config, where the relevant entry is this:

card "ATA/IDE Fixed Disk"
function fixed_disk
bind "ide-cs"

Look in /lib/modules/2.2.19/pcmcia/ and see that there is a module ide_cs available (unlike /lib/modules/2.4.5/pcmcia which has a module ide-cs which is not the same).

Under 2.2.19, insmod ide_cs does appear to work, but the card is bound to ide-cs not ide_cs. Is that significant? Boot 2.4.5 and try it. First have to manually set up the 2.4.5 ethernet connection.

modprobe 8139too
ifconfig eth0 192.168.1.40 broadcast 255.255.255.255 netmask 255.255.255.0
route add default gw 192.168.1.1 netmask 0.0.0.0

Now insmod ide-cs works OK
fdisk /dev/hde with command p shows the card's FAT filesystem, OK
mounting the card and reading from it works, OK
Apparently, somewhere in the installing of the new modules, I changed something about the ide_cs so that it no longer works?

This page maintained by Wil Howitt
Last updated 31 July 2003