Linux on a Sony VAIO® PCG-R505TL


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 to find that one brave soul had put Linux on the earlier model PCG-R505TS. His page is at 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.

Why I bought this laptop


Power Management

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 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/ so it would be executable. Then I added a line to inittab at the bottom:

# PowerWatch watches our battery
.. 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.


The following is from the little sheet included with the laptop manuals. (my comments in red)
Notebook Hardware Specifications
ProcessorMobile Intel® Celeron&tm; processor 650MHz
L2 Cache Memory128 MB (on Die)
Hard Disk Drive C/D Partition15GB (Approximately 40% and 60%)
Standard RAM128MB SDRAM (64 MB on board + 64 MB SO-DIMM expandable to 192MB)
LCD Screen12.1" XGA TFT
GraphicsIntel® 815EM Integrated Graphic
Display Cache4MB
  • Windows® sound system compatible, 3D surround
  • Analog devices AD1881A
Sound Capabilities16-bit CD-quality stereo sound
ModemV.90/K56flex data/fax compatible modem
Telecommunication CapabilitiesData/fax send/receive
Expansion CapabilitiesOne type II card with CardBus support
Built-in Capabilities
  • Stereo Speakers
  • Touchpad
  • Center Jog Dial
Connection Capabilities
  • i.Link® (IEEE1394) S400 connector
  • Ethernet (10Base-T/100Base-TX) Network Connector (RJ-45)
  • 2 USB connectors
  • VGA monitor connector
  • Docking connector
  • Modem (RJ-11) jack
  • Microphone jack
  • DC-IN connector
  • Headphone jack
  • Memory Stick® media slot
  • NO Infrared (IrDA)!
Supplied Accessories
  • Rechargeable battery
  • AC adapter and power cord
Power Source19.5V DC/AC 100-240V
Power Management
  • Energy Star compliant
  • Advanced Configuration and Power Interface (ACPI)
    This is a replacement for APM (Advanced Power Management) and not completely supported by linux. See Journal Day 3 above.
BatteryLithium Ion
Weight3.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.

Contact Me

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.

Updates Since Initial Writing

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:

 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 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.


--- Suspend + ACPI support ---


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 (
2. acpi-20020918-2.4.19.diff.gz (
3. patch-acpi-acpi20020918-swsusp15.gz (
4. (
5. jouston_config
6. pcmcia-cs-3.2.1.tar.gz (

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 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

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 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

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

        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:

It's pretty good!

You'll also need applications like this:

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:

--- HSF Linmodem ---

under construction... ;)

Best regards,