Monday, November 27, 2006
Sunday, November 26, 2006
Linux on the Thinkpad T60p
Linux on the Thinkpad T60p
After three years with an IBM Thinkpad T40, I bought this summer a new Lenovo laptop, a T60p, model 2007, 83G. This model presents to the user the same form factor than its predecessor, with its 14 inches LCD screen at resolution of 1400x1050 pixels. Inside the box, the hardware naturally evolved: the CPU is an Intel Duo Core (not core 2 duo), running between 1GHz and 2.16 GHz depending on the power management settings, the graphic card is an ATI FireGL V5200, the network card is an Intel 82573L, the sound chipset is an Intel HDA, the modem is a Conexant winmodem, and the hard drive is a Seagate Momentus 100GB SATA 7200 RPM.
Initial installation and partitionning
The machines comes with a big FAT32 partition containing Windows XP, and a Diagnostics partition visible at the end of the disk. Without user intervention, the OS will convert its underlying partition to NTFS the first time the system is launched. So I suggest to reduce the partition size before starting Windows for the first time, while the filesystem is still in VFAT. I typically use a bootdisk running FIPS. The SATA controller must be configured in "compability mode" for this operation.
The minimum size you can reach for the Windows XP partition will be around 11 GB, which is huge compared to the 5GB of the T40. Adding to this space the Diagnostics and recovery partition size, the maximum remaining free space you can gather from your 100GB disk is only 80GB. If you intend to keep the Windows XP partition solely for BIOS upgrades purpose, you may think twice before doing that, because :
- Lenovo BIOSes are now also provided as standalone bootable CD-ROM. For example, latest version 1.09 is available as a bootable disk.
- Upgrading from DOS (using a floppy or a CD-ROM support) is more secure, than from Windows, because there're less risks for the machine to randomly freeze during the flashing procedure...
After grub is installed on the MBR, the Diagnostics partition is no longer accessible with the "Thinkvantage" blue button, but an entry for this partition can be added in the grub.conf menu, see the excerpt below. Currently, I can boot on it, but I cannot start the PC-Doctor program from it.
title Diagnostics
rootnoverify (hd0,1)
chainloader +1
makeactive
Supported and unsupported hardware
I run Fedora Core 5 on this machine, without much trouble in my daily work.
What works out of box:
- Duo core is handled by the linux smp kernel.
- HDD monitoring with smartd (use the
-d ata
flag) - LCD brightness, ThinkLight, and sound volume control with the tpb program (same setup than the T40).
- tp_smapi interface to set the battery start and stop charge thresholds.
- suspend to ram.
What works with a proprietary driver:
- The graphic card is handled with the ATI proprietary driver only (RPM packages from the LIVNA repository under the name
kmod-fglrx*rpm
). - The fingerprint reader, with the BIOapi framework (custom RPM packages on http://fr2.rpmfind.net/linux/local/, and a small modification to
/etc/pam.d/system-auth
needed) - The wireless card with the ipw3945 driver, its proprietary firmware blob, and a new regulatory deamon running in userland (RPM packages from the Freshrpms repository).
What doesn't work:
- The internal modem. Lenovo provides an OEM RPM package of the linuxant proprietary driver -- search for "T60p linux capable" in the thinkpad drivers matrix web page on the IBM site-- but this package doesn't detect my modem. Lenovo provide version 7.47.00 of the linuxant driver. The non-OEM driver from linuxant.com is currently at version 7.47.00.03, it recognizes the modem, but it also replaces the snd-hda-intel ALSA module, and this modification causes
start_udev
to freeze at reboot. - Suspend to disk (in kernel infrastructure, not swsuspend2). Systematic reboot after resuming. Patches are expected to show up in kernel-2.6.18 for this issue (AHCI suspend/resume problem ?).
- SATA HDD Acoustic settings. The right side of the palm rest, just above the disk becomes rather hot, even without significant disk activity.
- The ATI proprietary driver (version 8.28.8) appears to be very unstable, when running OpenGL games. It crashed several times, with errors about mmap memory locking issues (
[fglrx:firegl_rmmap] *ERROR* map 0xf684d3d0 still in use (map_count=1)
). I reported this bug to the ATI support site, without much hope to receive an answer anytime soon...
Untested:
Power consumption
Clearly, the T60p consumes MUCH more power than the T40 in the same power saving mode, consisting of:
- removing USB external peripherals, and
rmmod
'ing the*-hcd
usb modules. - shutting down the network card and the wireless card :
ifconfig [...] down
, andrmmod e1000
,rmmod ipwxxxx
- stopping the IrDA services and
rmmod
'ing the related kernel modules. - ditto for bluetooth
- dimming the LCD
- running the graphic chipset in the powersaving mode (DynamicClock enabled for the radeon 9000 of my T40, and
aticontrol --set-powerstate=1
for the proprietary ATI driver for the FireGL of my T60p) - running the CPU at its lowest speed (600MHz for the T40, 1GHz for the T60p) with the cpuspeed driver.
With this setup, the T60p consumes 18W, while the T40 only comsumes 10W. The batteries capacity didn't evolve much on the other side. A brand new 9 cells battery has a maximum capacity of 80Wh, so your T60p will have an autonomy of 4 hours, when the T40 has an autonomy of 8 hours.
These values must be tampered, if we consider a more expensive power utilization. The T40 consumes around 13W, and the T60p is around 24W, that converts to an autonomy of 3h20 and 5h30. Also keep in mind that the battery capacity will drasticaly erode itself quite rapidly, for example 60% of the factory capacity remaing after one year.
The consequence is that the temperatures inside the box are also much hotter, than with the T40, the typical values collected from the acpi /proc
interfaces are :
- CPU temperature around 55 deg (centigrade) when idle, up to 90 deg when busy (
cpuspeed
control disabled) - GPU around 67 deg if a lower powerstate is activated, 75 deg else. Can reach 95 deg.
On the T40, these temperatures were lower for the CPU (40 deg idle, 75 busy).
Hints and Tips
- remember to disable the "
-s
" option in cpuspeed, so this program can handle both CPUs.
Benchmark
This benchmark is not a very scientific one, but it gives a rapid performance comparison. It's a full kernel compilation (make allmodconfig
). Note that both machines have a 7200 RPM HDD. The T40 has a PATA one, and the T60p a SATA one.
- T40 : 56min05
- T60p : using a single CPU, 34min36
- T60p : two compilations, in parallel, but in two separate work directories : 46min40 / 46min53
- T60p : a parallel compilation with
make -j2
: 21min20
So yes, there's a big power boost with the T60p compared to the T40, and no, the dual core is not that impressive in my opinion.
3D
I tested few stuff. Flightgear runs fine at a very decent frame rate. GoogleEarth is fluid without flickering. I also tried a game demo (Cold War) that crashed the ATI proprietary driver. nexuiz cannot complete in benchmark mode (nexuiz-sdl -game benchmark -benchmark demos/demo1)
, because the ATI driver miserably fails. Despite this bug, the beginning of the demo runs at 26 fps avg using the game default config.
Troubles
The machine has already been serviced, after 15 days of utilization. The battery could no longer be charged after it's first full discharge. The problem appeared to be located on the motherboard, that got replaced.
Conclusion
As usual when buying a new laptop, with up-to-date hardware inside the box, for use with linux, there's a period of several months before all the hardware, that can be handled by free drivers, is correctly supported. With some more luck, the 2D and 3D specifications of the high-end ATI cards will be disclosed to the Xorg developpers. A reverse engineered driver for the fingerprint hardware is on the way. The support for the internal winmodem remains uncertain. As an alternate solution, it is still possible a resurrect an old 3Com/Megahertz modem pcmcia card, and to use it when this bug will be resolved.
(link to note)Wednesday, November 15, 2006
- ASCII CODES (acentos)
Alt + 0201/144 → É
Alt + 0205 → Í
Alt + 0211 → Ó
Alt + 0218 → Ú
Alt + 0220/154 → Ü
Alt + 0209/165 → Ñ
Alt + 0225/ 160 → á
Alt + 0233/130 → é
Alt + 0237/161 → í
Alt + 0243/162 → ó
Alt + 0250/163 → ú
Alt + 0252/129 → ü
Alt + 0241/164 → ñ
Alt + 0191/168 → ¿
Alt + 0161/173 → ¡
Alt + 0128 → €
Alt + 126 → ~
Monday, November 06, 2006
Commands and Shortcuts
Nice: runs programs/commands at a lower system priority
Nohup: runs nice programs even when you’re logged off the system
By using the two commands simultaneously, your large processes can continue to run, even when you have logged off the system and are relaxing.
Ex: nice nohup c program.c .
This command will allow the c compiler to compile program.c even when you have logged off the system
Resume the transfer to the terminal. Try if your terminal mysteriously stops responding.
Send the current process to the background.
cat /proc/cpuinfo
Cpu info--it show the content of the file cpuinfo. Note that the files in the /proc directory are not real files--they are hooks to look at information available to the kernel.
cat /proc/interrupts
List the interrupts in use.
cat /proc/version
Linux version and other info
cat /proc/filesystems
Show the types of filesystems currently in use.
cat /etc/printcap
Show the setup of printers.
apropos topic
Give me the list of the commands that have something to to do with my topic.
mcopy source destination
Copy a file from/to a DOS filesystem (no mounting necessary). E.g., mcopy a:\autoexec.bat ~/junk . See man mtools for related commands: mdir, mcd, mren, mmove, mdel, mmd, mrd, mformat ....
cat filename | more
View the content of a text file called "filename", one page a time. The "|" is the "pipe" symbol (on many American keyboards it shares the key with "\") The pipe makes the output stop after each screenful. For long files, it is sometimes convenient to use the commands head and tail that display just the beginning and the end of the file. If you happened to use "cat" a binary file and your terminal displays funny characters afterwards, you can restore it with the command "reset".
less filename
Scroll through a content of a text file. Press q when done. "Less" is roughly equivalent to "more" , the command you know from DOS, although very often "less" is more convenient than "more".
touch filename
Change the date/time stamp of the file filename to the current time. Create an empty file if the file does not exist.
xinit
Start a barebone X-windows server (without a windows manager).
startx
Start an X-windows server and the default windows manager. Works like typing "win" under DOS with Win3.1
startx -- :1
Start another X-windows session on the display 1 (the default is opened on display 0). You can have several GUI terminals running concurrently. Switch between them using
xterm
(in X terminal) Run a simple X-windows terminal. Typing exit will close it. There are other, more advanced "virtual" terminals for X-windows. I like the popular ones: konsole and kvt (both come with kde) and gnome-terminal (comes with gnome). If you need something really fancy-looking, try Eterm.
xboing
(in X terminal). Very nice, old-fashioned game. Many small games/programs are probably installed on your system. I also like xboard (chess).
pine
A good text-mode mail reader. Another good and standard one is elm. Your Netscape mail will read the mail from your Internet account. pine will let you read the "local" mail, e.g. the mail your son or a cron process sends to you from a computer on your home network. The command mail could also be used for reading/composing mail, but it would be inconvenient--it is meant to be used in scripts for automation.
elm
A good tex-mode mail reader. See the previous command.
mutt
A really basic but extremally useful and fast mail reader.
mail
A basic operating system tool for e-mail. Look at the previous commands for a better e-mail reader. mail is good if you wanted to send an e-mail from a shell script.
licq
(in X term) An icq "instant messaging" client. Another good one is kxicq. Older distributions don't have an icq client installed, you have to do download one and install it.
talk username1
Talk to another user currently logged on your machine (or use "talk username1@machinename" to talk to a user on a different computer) . To accept the invitation to the conversation, type the command "talk username2". If somebody is trying to talk to you and it disrupts your work, your may use the command "mesg n" to refuse accepting messages. You may want to use "who" or "rwho" to determine the users who are currently logged-in.
mc
Launch the "Midnight Commander" file manager (looks like "Norton Commander" for Linux).
unarj e filename.arj
Extract the content of an *.arj archive.
uudecode -o outputfile filename
Decode a file encoded with uuencode. uu-encoded files are typically used for transfer of non-text files in e-mail (uuencode transforms any file into an ASCII file).
Process control
ps(=print status) Display the list of currently running processes with their process IDs (PID) numbers. Use ps axu to see all processes currently running on your system (also those of other users or without a controlling terminal), each with the name of the owner. Use "top" to keep listing the processes currently running.
fg PID
Bring a background or stopped process to the foreground.
bg PID
Send the process to the background. Opposite to fg. The same can be accomplished with
any_command&
Run any command in the background (the symbol "&" means "run the proceeding command in the background").
batch any_command
Run any command (usually one that is going to take more time) when the system load is low. I can logout, and the process will keep running.
at 17:00
Execute a command at a specified time. You will be prompted for the command(s) to run, until you press
kill PID
Force a process shutdown. First determine the PID of the process to kill using ps.
killall program_name
Kill program(s) by name.
xkill
(in an xwindow terminal) Kill a GUI-based program with mouse. (Point with your mouse cursor at the window of the process you want to kill and click.)
lpc
(as root) Check and control the printer(s). Type "?" to see the list of available commands.
lpq
Show the content of the printer queue. Under KDE (X-Windows), you may use GUI-based "Printer Queue" available from "K"menu-Utilities.
lprm job_number
Remove a printing job "job_number" from the queue.
nice program_name
Run program_name adjusting its priority. Since the priority is not specified in this example, it will be adjusted by 10 (the process will run slower), from the default value (usually 0). The lower the number (of "niceness" to other users on the system), the higher the priority. The priority value may be in the range -20 to 19. Only root may specify negative values. Use "top" to display the priorities of the running processes.
renice -1 PID
(as root) Change the priority of a running process to -1. Normal users can only adjust processes they own, and only up from the current value (make them run slower).