Tuesday, 14 December 2010

ACPI related reference material

I've collected up some nuggets of information which may be useful to help debug various ACPI issues:
  1. ACPI debugging tricks and tips
  2. ACPI and Windows Management Instrumentation - mainly about WMI enabled hotkeys
  3. Battery and ACPI Methods
  4. How S3 suspend/resume works and tricks for debugging
  5. S4 tricks for debugging
These Wiki pages are "work-in-progress", so I welcome any corrections on factual inaccuracies. A lot of the information has been pieced together either information found on the internet, or from the Linux kernel source, or disassembling many ACPI tables and also from a little bit of reverse engineering.

Friday, 10 December 2010

Maintainable code.

Writing maintainable code requires considerable effort and there are numerous resources available in the form of books and websites to teach this creative art. One can also glean wisdom from learning from mistakes, and with this mind, I found it instructive to read a tongue-in-cheek article by Roedy Green about how to write unmaintainable code. The article has been around since 1997, but I think it wears well.

Don't misunderstand me, by recommending this article I'm not advocating writing unmaintainable code at all. I just think it can be very useful to see some ingenious ways to make code totally confusing and bamboozling so that one can avoid these at all cost.

Tuesday, 7 December 2010

Lost Circuits article on HDD data transfer rates.

Lost Circuits has written an in-depth article on hard disk media, covering aspects of HDD performance, such as transfer rates depending on the zone position (inner to outer diameters), discrepancies between internal transfer rates and benchmarked rates as well as the impact of track slew.

Some of the internal mechanical magic is also described, which helps explain how manufacturers configure their hardware and sector layouts to maximise performance. All very informative.

The website is slow, so be patient!

Monday, 6 December 2010

cowsay and cowthink fun

Time for me to lighten up a little. I stumbled upon the cowsay and cowthink commands today while reading the Wikipedia entry about Tux. Cowsay prints an ASCII art picture of a cow and a speach bubble around some provided text, and cowthink puts the text in a think bubble.

cowsay "Well this is all very amusing."
< Well this is all very amusing. >
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

The -f flag allows one to specify different picture, for example -f tux draws Tux instead of a cow.

cowthink -f tux "Why is my kernel building so slowly today?"
( Why is my kernel building so slowly )
( today? )
|o_o |
|:_/ |
// \ \
(| | )
/'\_ _/`\

There are over 50 pictures to chose from, use cowsay -l to list them all.

To install, use: sudo apt-get install cowsay