Archive for July, 2005

Software Suspend 2, a success story

Wednesday, July 20th, 2005

Owning a laptop, you try to get the best out of it. you want it to be the strongest it can, you want it to be fast, reliable, useful, and cunning. My Fujitsu is cunning, I can say. Not a day passes without me hearing someone saying "Wow, it is so small". I didn’t get it for the audiance, though, I got it because traveling to end users and customer sites could be frustrating when you have no connectivity, and you cannot relay on the customers environment. I once, few years ago, had the paradox I call "The Ez paradox", where I got to a customer who just arranged a brand new ADSL line, had a network card with me, but I forgot the drivers. There was no way I could connect using her computer, nor did I have my laptop then. It consumed few extra hours just finding someone around who could allow me to use his computer to download the NIC drivers. Never again, I swore then, and I was proven to be right. There was one time with another customer, where I proved the screen to be the problem, and not the computer’s VGA card, using my laptop, and another where I could remove the blame from a poor and unjustly accused computer, because I could not connect to the internet using the same ADSL line from my own laptop, etc. It’s a usefull machine, and it saves my time.

One of the things one expects is to open his laptop’s cover, and "Whoosh!", get an up-and-running system right then. As we all know computers, this is not the case. Running Linux on the laptop, it was even worse. Up till a year ago, Software Suspend solution for a pooched ACPI enabled laptops, with no hardware suspend built-in, were, how to say, poor at best. I remember being able to suspend using some SWSUSP beta version, and it was able to suspend and resume about 2/3 of the times I tried to, took five minutes, and not always when it didn’t manage to suspend I was attentative enough to notice it. The poor laptop got to remain up and running (and when swsusp got hang, it consumed 100% CPU) inside my bag few times, until I discovered it half an hour or so later. Not good. Not only this, but this beta version worked sometimes, while its following release (or RC) version failed to suspend or resume or both completely. It was far from being perfect. However, I am full of respect to the people who made it, fighting uncommon hardware setups, which you can find only in laptops, and made a mature and working

Mature, becuase it works, not becuase it’s the most trivial thing to make it work.

I can clearly say that SWSUSP2, in version 2.1.9, for kernel is remarkebly fast, clear, and well working. Using the new UserUI (Nice splash screen with animation, showing during the suspend/resume operation), i can be the envy of my peers, if only they cared.

For anyone on the net asking about it, i can describe shortly how and what I did to make it work.

First, follow the instructions in Software Suspend web site. They know what they are saying, although their site is not always organized (it’s getting better, with the Wiki! Keep the good work!).

To Explain in short words what I have done:

  1. Get and untar/bzip2 kernel version (linux-
  2. Get software-suspend-2.1.9-for-2.6.11
  3. Patch the new kernel by using the new method swsusp2 supply (RTFM)
  4. Patch the new kernel with your newly downloaded fbsplash-0.9.2-2.6.11 patch
  5. Get, unzip and compile userui package (note – You will need to edit fbanim/userui_fbanim_core.c and change #include <linux/fb.h> into #include "linux/fb.h" else it won’t compile
  6. You would want to make your own kernel now. It’s going to take a while. You can borrow from my own config (config- file.
  7. Anything further can be found easilly in Software Suspend Wiki
  8. Make sure your initrd (if you use it) is set up correctly

It should work correctly at this point. You would like to pick a nice graphics, and I hope, with the help of my wife, to arrange myself some uniqe and eye catching image. Why? Because. It doesn’t cost my anything further, and it will sure attract attention to the system.

Orinoco Solution (so far)

Tuesday, July 19th, 2005

Well, my Orinoco 802.11b mini-pci card had this weird thing – sometimes it failed to start up after suspend. Why? I don’t know. I wasn’t able to understand the cause of it, and not being a coder, I had some hard time tracking kernel driver problems.

The error message was the following one:

orinoco_lock() called with hw_unavailable (dev=c1256800)

eth1: Error -110 setting multicast list.

Google is my friend. It can be yours as well.

I searched for Orinoco_pci modules, and was able to come up with this:

Ok, so I can understand my driver version is 0.13e, which comes with the Kernel, but this version didn’t seem to do the work quite right, so I had to test a newer version, way newer. I downloaded the external module pack from here (direct link to the tar.gz I’ve downloaded) and tried to compile it. I failed. Badly. I was not able to understand the cause of the failure. More experianced coder would have solved it by now, but I was not able to. I got this, in general:

orinoco_pci.c:330: error: too many arguments to function `pci_save_state’

orinoco_pci.c:347: error: too many arguments to function `pci_restore_state’

I persumed it was right – the function got one argument too many, so I tried to find another example of this function by running grep "pci_save_state" and "pci_restore_state" /usr/src/linux

I got few files, all using only one argument, So I had to change the file orinoco_pci.c in two places:

pci_save_state(pdev, card->pci_state); on line 330

pci_restore_state(pdev, card->pci_state); on line 347

Based on the examples seen in the kernel tree itself, I’ve changed these two lines to the following:



I was surprised it managed to compile correctly (tons of warnings, but no errors). I was able to manually load the module for testing, and after careful backup of the original modules, I replaced them with the newer ones.

Tested since yesterday, and so far It seems like my other wireless card, the PCMCIA card, has become a waste of money. I guess I can still use it to scan for networks…

Since there was no place in hell I was able to find this piece of information (me not being a coder), I am putting this online, for all who ever need it to watch and see.



Laptop Fujitsu P2120 Summary

Tuesday, July 19th, 2005

Well, I have a laptop for the last 2 years or so, which can be noted for its very light-weight and enhanced setup (it comes with full equipment – DVD-CDR combo, 802.11b, 1xPCMCIA, 2xUSB2.0, 1xFireWire, S-Video, VGA Out, Lan, Modem, etc), for only 3.2 lbs, or ~1.5Kg. However it has its disadvantages – the weak CPU (Transmeta 933MHz, which acts worse than P3 500MHz), the (very) slow HDD (40GB, but slow), and the very small VGA LCD – 10.2". Moreover, its Linux competability is not sky high, so I had to work hard to make things work correctly.

So far I have a working setup where the following list works:

1) ACPI Events*


3) Software Suspend 2 (Aka, Hibernation, or ACPI State 4)*

4) USB, and USB devices


6) Floppy (as a USB Storage device)

7) VGA, and X finally stopped crashing by itself.

8) LAN – RTL8139 based, using ifplugd for detection of links, and using DHCP to obtain IP address then

9) Wireless Card, Orinoco_pci module*

The devices marked with (*) are those which I have problem with. Outside of this list, I have my FireWire untested, and I cannot activate my Modem (LT, if I’m not mistaken).

Current problems:

ACPId fails to show in the logs (/var/log/acpid) the transfer phase from AC to battery mode, and vice versa. When on AC, It says nothing. When on Bat, it prints once around every 10 minutes or so a notice about using battery mode, or that the battery is being discharged. However, on /proc/acpi/battery/CMB*/state I can see when the battery is being charged and discharged. Weird.

Software Suspend 2 has just been patched on a kernel (I was not able to boot the at the moment, but I will devote time for it in the near future), and is being tested as we speak. So far, it has worked remarkably well, joined with the Fbsplash, it shows a nice animation during boot time. One thing, though, which is related to Orinoco_pci module – If the Orinoco driver has no wireless network accessible, it will hang during the power-restore session, fill my logs with the comment "hermes @ MEM 0xcfc74000: Error -16 issuing command." and will not be able to function, on most cases until I hibernate/resume the computer. Even then, not always will it work. It drove me nuts, as it both abused my CPU and thus battery during battery usage, and it required I find some alternate solution. Finally I have a method of adding PCMCIA wireless card, using NDISwrapper to activate it, and removing the orinoco related modules.

Linux – Debian which was based on Knoppix, and was vastly tweaked since. Unstable, and up-to-date. My own custom kernel, and up until now, using vanilla kernel with the swsusp2 patch. Nothing fancy.

First message

Tuesday, July 19th, 2005

Well, It’s been a while since I’ve considered playing with a blog of my own. I’ve never quite found the convicting reason which will pull me out of my chair, and not-a-single-thing-doing-for-a-whole-afternoon-while-browsing-the-net into the active part of installing my own blog.

Well, I did just ten minutes ago.

Why? Because during my tech adventures (as much as they might seem adventurues to anyone), I get to complete tasks, or do things which I have nowhere to add or update, and thus I don’t get to keep, neither to myself for later refferance, nor for others who might bump into the same problems I have.

Who am I?

Keeping this blog blogish enough, there is no point in mentioning my name. You can call me Ez-Aton, or Ez, for short, if you feel like calling me at all. It’s not that I hide, but there is a point in a person’s life where he wants to use the little anonymity the web offers. The little of it which still exists nowdays, anyhow.

Well, I act as a Unix SysAdmin, linux hobbist and SysAdmin, Windows SysAdmin, some experiance with mac, etc. I manage few dozens of *nix machines @ work, namely Linux, Solaris, HP-UX, AIX, and somewhat Windows on a more complex environment. I don’t claim to be an expert on it, oh now, but I claim to know some on everything. And Google being my friend, I can manage my way around the more common obstacles. I learn fast, I almost never do the same mistake twice (unless it’s on purpose, to gain something), so I manage to get, uneducated (no degree, no official courses), a very complex set of systems up and running. not perfect, but how many people you know who can make such things (as you might find in my blog at other times) up and running?

Oh, and I live in Israel, which is a small country, but one can get used to it.

So I hope you find info you need here, or at least enjoy wasting few more minutes of your life, where time flies in front of the computer, browsing and searching, and doing only little. Yep, techie’s life.