All good things have to come to an end. My old Sony VAIO PCG-505TR (on right) had sticky keys on the left side from a soda accident, then the battery refused to charge, and then (while plugged in at a hotel one night) a power surge rendered the monitor mostly useless. So it is being relegated to maintain the inventory of the refrigerator with the aid of a barcode scanner, and it has been replaced by my shiny, new, PCG-R505TL (on left).
Before buying the new VAIO, I checked out http://www.linux-laptop.net to find that one brave soul had put Linux on the earlier model PCG-R505TS. His page is at http://www.returntonature.com/linux/laptop but hasn't been responding recently, so the copy cached by the fine folks at google is the one I've been using.
Now, before you run off and buy a laptop from Sony and then spend the next week and a half getting it to work, take a look at the web site for Emperor Linux who will ship you a Sony VAIO (many models available) or another name brand laptop, pre-loaded with Linux, and will then support it for a year.
Unfortunately I discovered their site a week too late, so I've been putting together the pieces myself.
Laptop is bright and shiny and has everything you'd want. Two USB ports, a VGA port right on the side, a PCMCIA slot, onboard modem & ethernet, audio, crisp 12" screen, stereo speakers, touchpad and . . wait a minute. Where is the Infrared port? Yes, folks. No IrDA port to be found on the machine. How dare Sony leave that off? I just assumed that every laptop came with IrDA these days. So much for getting on the Internet over the cell phone connected by infrared.
Patch installed, I reboot, get into a good 'ol DOS prompt, run loadlin and I'm off. RedHat 7.1 installs without a hitch from the ISOs on my dos partition. The empty D: partition has been turned into Linux, with a 2 gigabyte root (/) partition, a 4 gigabyte home (/home) partition, a ~2.1 gigabyte extra (/extra) partition and two 128-megabyte Linux Swap partitions. The Windows C: partition is accessable as /dos under Linux and was left untouched (for now).
I picked the packages I wanted, turned on high security settings for
xinetd, and for X-Windows I followed the instructions from
Select the Monitor as Generic LCD
Select Video Memory as 16M
Use defaults for everything else.
Laptop reboots, I see LiLo, and after five seconds it boots into Linux. Much nicer.
Another heartbreaker, my new Sony uses Advanced Configuration and Power Interface (ACPI) instead of the old Advanced Power Management (APM) Interface. APM is supported by Linux, but ACPI is only in bleeding edge, kids don't try this at home, we warned you in advanced, run fsck manually after your computer haults, development kernel only support. Yeah, I tried it out. Compiled a kernel with the ACPI support and after looking through /proc/acpi and finding that it didn't support my battery, my computer locked up.
So, off to do some more research. I found that Andrew Tridgell (the same guy who wrote Samba, the nifty program that allows you to interface Linux with Windows networking so that my mom can print to the laser printer attached to my server) had written a bunch of tools for the Sony VAIO® Picture Book®, including tools to change the brightness of the screen and get the battery charge status that worked on my VAIO as well. I downloaded and compiled them and then a few hours later found that the folks at Emperor Linux have made an RPM that includes the vaiobat and setbrightness programs. Now, as root, I can run vaiobat and get something like:
Battery 3848/3848 100.00% AC BAT1.. which is all the info that I needed. But how to put it to use? So I wrote a PERL script called powerwatch.pl. This nifty program runs the vaiobat program every 15 seconds and does two things. First, it writes the current status to /var/log/vaiobat, since the vaiobat program is really a hack and you can't have two copies probing the PCI bus at the same time. It also monitors the power levels, and if you are running on battery will dim the monitor using setbrightness and will estimate how much time you've got left based upon the current drain rate and the current battery charge. Very useful. It creates a log file at /var/log/powerwatch that you can watch with tail -f /var/log/powerwatch while it is running to see the current status.
To install I logged in as root and copied it into /usr/sbin/local and did chmod 755 /usr/sbin/local/powerwatch.pl so it would be executable. Then I added a line to inittab at the bottom:
# PowerWatch watches our battery pw:2345:respawn:/usr/sbin/local/powerwatch.pl.. to automatically run the powerwatch service when we are in the appropriate runlevels (2-5). Now I know how much power I have left, and when I am not on AC it will dim the monitor to save juice and estimate my time remainig.
But I really don't want to keep a window open with tail running all the tim just to see the power usage. So I went to Freshmeat and found an applet for Gnome's toolbar called Battstat that is available under the GNU Public License (GPL). So I downloaded, made a few modifications, recompiled and installed. Now it reads from my /var/log/vaiobat file that powerwatch creates instead of asking the old APM daemon. This gives me a little applet at the bottom that tells me if I'm on AC or DC, and the current battery charge (%). My hacked version is here. Just untar, run ./configure, then make and make install and you're all set.
I still can't do a suspend to disk or memory until the ACPI stuff settles, so I will have to hope that the ACPI4Linux project makes good progress. But in the mean time I can at least see my battery status and my powerwatch will shut down the computer nicely in case I run off and the battery drains to the bottom.
Here are some of the useful toys that I've bought for the laptop.
Xtend Micro makes the PowerXtender that plugs into the 13.8V DC "cigarette lighter" adapter of a car, or the little jacks in business or first class on airplanes. You need model E612X, or if you have a PowerXtender already, just get the new cable (E037) (Thanks David Poggi for helping me find htis). Both are sold by Teleadapt all over the world. Then you can throw the laptop in the car or take it on those long overseas flights for music or to get a few more hours of work in.
D-Link makes PCMCIA wireless ethernet cards, as well as a nifty firewall/router/wireless access point/ 3-port 10/100 switch that sell for about $95 and $280 respectively at buy.com. So with the two I can roam around the office or home wirelessly. The D-Link PCMCIA card (DWL-650) works fine under the latest PCMCIA CardBus software that comes with RedHat 7.1, just pop it in and go. If you set up DHCP on the hub, you'll be online in a few seconds.
I've had a FujiFilm MX-2700 camera for a few years now and I bought
Fuji's PCMCIA/SmartCard adapter since my camera takes a SmartMedia
SmartCard® and not the Sony Memory Stick®. If you have a Sony
product that takes the Memory Stick®, you can just use the built-in
port (see Journal Day 3 above).
My SmartMedia/PCMCIA adapter just shows up as another block device, /dev/hde1. So if you add the following to /etc/fstab:
/dev/hde1 /mnt/smart msdos defaults,user,gid=200,umask=002,noexec,nosuid 0 0.. you can pop in the PCMCIA card, put the smart card into that, and then type mount /mnt/smart (after making the /mnt/smart directory of course). Just make sure to umount /mnt/smart before taking the card out. Then you can copy files on and off the Smart Card at moch speed.
Jansport as well as making quality backpacks, used to make a computer sleeve. I can't seem to find it anymore, but the place I bought it from, Eastern Mountain Sports sells a similar computer sleeve for $25 by Eagle Creek, as well as a host of backpacks that have special computer areas. I bought the computer sleeve which olds the VAIO and all my accesssories and then I tuck that into my backpack or carry-on luggage. Much less conspicuous than hauling a laptop bag around, and less likely to get stolen.
I purchased a GSM-Only PCMCIA card from Option International. After going back and forth a few times to get the right cable for my Ericsson A1018s cell phone, I had a working solution for wireless Internet in Europe. Pop the card in and it shows up just like a modem. Dial your favorite ISP and log in, then start ppp and you're on the 'net from wherever you can get GSM coverage. They also make a complete PCMCIA solution that doesn't require a phone. Check with your GSM provider before you try that one out, though.
The following is from the little sheet included with the laptop manuals. (my comments in red)
|Notebook Hardware Specifications|
|Processor||Mobile Intel® Celeron&tm; processor 650MHz|
|L2 Cache Memory||128 MB (on Die)|
|Hard Disk Drive C/D Partition||15GB (Approximately 40% and 60%)|
|Standard RAM||128MB SDRAM (64 MB on board + 64 MB SO-DIMM expandable to 192MB)|
|LCD Screen||12.1" XGA TFT|
|Graphics||Intel® 815EM Integrated Graphic|
|Sound Capabilities||16-bit CD-quality stereo sound|
|Modem||V.90/K56flex data/fax compatible modem|
|Telecommunication Capabilities||Data/fax send/receive|
|Expansion Capabilities||One type II card with CardBus support|
|Power Source||19.5V DC/AC 100-240V|
|Weight||3.75 lbs (1.7kg) (with supplied battery)|
All of the information in this web page is accurate to the best of my knowledge, but by using it you agree to indemnify me (hold me not liable) for anything that happens to your computer. If you don't agree with this, please close your web browser and manually remove this web page from your local cache. ;) With that said, good luck and Godspeed.
If you found this page useful, or have a question, you can e-mail me at ryan at catalina dot org. Or send me a post card at PO Box 3672 in the city of Santa Barbara in the beautiful state of California in the United States of America. The ZIP code is 93130.
I've gotten e-mails from a number of people writing in with questions, suggestions, tips, etc. I'll try and post some of the relevant ones here as they appear:
Hi I got a Sony R505 few days ago. I read your article about R505, and there are some things have been changed since you wrote it. Sony Jog has been supported by sjog at sjog.sourceforge.net. The internal modem can use hsflinmodem to drive. And the docking station is also working, ;-) with the DVD/CD-RW, it's using ieee1394 in fact. In the side of power management, lastest 2.4.19-rc2 has a good support for ACPI. battstat is work with R505 without any modification. MS Gate work as a USB storage. So I also let everything work with Debian Woody. Yu Guanghui
Hi Ryan, I am Jouston, I own a R505TL also. I would like to say thank you for your article, which helps a lot while I purchase my laptop in Fry's. After almost half-year, I finally got my laptop have suspend function enabled. I beg you put this material on your webpage so that somebody else could get more complete help. ###start### --- Suspend + ACPI support --- Dependency: First of all, I suggest you using my combination: 0. Red Hat 7.2 (CLE extend 1.1) / or Red Hat whatever version... 1. 2.4.19 vanilla kernel -- linux-2.4.19.tar.gz (www.kernel.org) 2. acpi-20020918-2.4.19.diff.gz (acpi.sf.net) 3. patch-acpi-acpi20020918-swsusp15.gz (swsusp.sf.net) 4. suspend.sh (swsusp.sf.net) 5. jouston_config 6. pcmcia-cs-3.2.1.tar.gz (pcmcia-cs.sf.net) !!!Notice!!! your swap patition should be 30% larger than your physical memory. I have 320MB RAM, so I have 512MB SWAP. It's 1.6 times to my physical memory. Why these dependency? Why I suggest this combination? I test all the posibilities inclusive of 2.5.41-ac2 kernel. They are all fail in some way. I don't know, I just try to tell you guys a good path to reach my way. Plus, I got a wireless card from PCi (Planex/Geowave), GW-NS11S. It's using Intersil chip which need latest pcmcia support to have a description on it. My configuration file compile R505TL related function into the kernel like: i810 DRM, EEPRO100 ethernet...etc. If you are using other laptop and want to have a success experience on suspend function, I suggest you re-configure my configuration file by "make menuconfig" The suspend.sh shell script helps a lot, it could install the scripts which I need to make my machine running with suspend function well. After you got these files, start your engine! Chaptor One - patch all you need to patch! 1a. uncompress your kernel First of all, untar linux-2.4.19.tar.gz into /usr/src/ with command "tar zxvf linux-2.4.19.tar.gz -C /usr/src/". You'll got a directory "/usr/src/linux-2.4.19/" 1b. patch acpi-20020918-2.4.19.diff.gz onto kernel copy "linux-2.4.19" into "linux-2.4.19orig". (we need a backup...) With command "cp -rf linux-2.4.19 linux-2.4.19orig" Then put your patch acpi-20020918-2.4.19.diff.gz in /usr/src/. gunzip it: "gunzip /usr/src/acpi-20020918-2.4.19.diff.gz" You'll got "acpi-20020918-2.4.19.diff" in your /usr/src/ directory. patch with it: "patch -p0 < acpi-20020918-2.4.19.diff" 1c. patch patch-acpi-acpi20020918-swsusp15.gz onto kernel rename your "linux-2.4.19orig" into "linux-src" with command "mv linux-2.4.19orig linux-src" put patch-acpi-acpi20020918-swsusp15.gz in /usr/src/ then unzip it: "cp patch-acpi-acpi20020918-swsusp15.gz /usr/src/ ; gunzip /usr/src/patch-acpi-acpi20020918-swsusp15.gz" After you uncompress it, patch it! "patch -p0 < patch-acpi-acpi20020918-swsusp15" !!!Notice!!! While you patching files into kernel, you shouldn't see any reject or some interactive questions. If so, download vanilla kernel from www.kernel.org and other patch files again. 1d. config kernel copy my configuration file "jouston_config" into /usr/src/linux-src/ then run command "make menuconfig" I suggest you load this config file and then just save and exit. Don't do something stupid if you don't know what you are doing... 1e. compile your kernel running this command: (it cost pretty long time. Waste your time in front of TV or something more healthy...) "make dep modules modules_install bzImage install" 1f. check boot loader I'm using grub, if you are using it. Check your /etc/grub.conf, I think you will find your new compiled kernel already configured. If not, go ahead, do it by yourself. This is my one: (you could use it if you have exactly the same configuration of swap and root patition. Remember the "resume=/dev/hda6" means your swap patition.) title Red Hat Linux (2.4.19) root (hd0,4) kernel /boot/vmlinuz-2.4.19 ro root=/dev/hda5 resume=/dev/hda6 If you are using lilo, I think you need to make it by yourself. Add some lines from your original kernel configuration and fix it by your hand. for your reference: image=/boot/vmlinuz-2.4.19 label=2.4.19 read-only root=/dev/hda5 append="resume=/dev/hda6 ide2=0x180,0x386" 1f. Compile PCMCIA for yourself. (optional, if you choose using original kernel tree. Skip this but remember reconfig your kernel by yourself. You could tell the story by yourself.) untar it: "tar zxvf pcmcia-cs-3.2.1.tar.gz -C /usr/src/" compile it: "make all install" then it will ask you some questions, typically situation, you just press "Enter" key times and pass the compile. Notice what you are doing and remove the "kernel-pcmcia-cs" first. Also you'll need to remove the files by your hand "rm -rf /etc/pcmcia", "rm /etc/sysconfig/pcmcia" before recompile and install pcmcia-cs package. 1g. reboot your machine, check all accessories is supported by your new kernel. If so, congruations!!! Do a suspend like that "echo -n 4 > /proc/bus/acpi/sleep" by root. You will see a blank screen shows a bar eating your memory. :) !!!Notice!!! After your suspend machine, don't try to use another kernel to boot up your machine! It's very very dangerous. I'll need to re-format your swap patition to recover your stupid act. (I have did it several times... ><" ) --- jogdiald --- jogdiald is pretty looks like Sony's original one. Download it here: http://perso.wanadoo.fr/pascal.brisset/vaio/vaio.html It's pretty good! You'll also need applications like this: http://www.emperorlinux.com/picbook.html Thanks Emperor Linux --- wmacpi --- Due to we don't have much choice, this simply and functional one is my batery monitoring choice. Check this URL for surprise: http://open.iliad.fr/~clecourt/wmacpi/ --- HSF Linmodem --- under construction... ;) Best regards, Jouston