Posted by: noorul | May 25, 2008

IBM ThinkPad R52 and linux

I upgraded my kernel from 2.6.21 to 2.6.22. But, somehow with the same .config from 2.6.21 didn’t work as I expected with 2.6.22. The model R52 comes with IDE CD-ROM drive. So I wanted to use the ide drivers with scsi emulation for CD-ROM. I compiled ide modules into the kernel so that it gets loaded first and detect my CD-ROM drive. But ide module probes for all IDE devices including my hard disk. I don’t want to use IDE driver for my hard disk instead I wanted to use ata drivers with scsi emulation. The option left is to pass module level parameters to ide asking not to probe for my hard disk. This can be achieved by passing hda=noprobe to ide. As per the following excerpt from Documentation/kernel-parameters.txt;

Module parameters for modules that are built into the kernel image
are specified on the kernel command line with the module name plus
‘.’ plus parameter name, with ‘=’ and value if appropriate, such as:


I can pass hda=noprobe to ide by appending ide.hda=noprobe to kernel command line. But this doesn’t work for me. I think that in drivers/ide/ide.c, the code for latest __setup() macro is incomplete. I read lots of code and tried to understand what exactly is happening, but I couldn’t find out how I can pass hda=noprobe to ide without doing the following changes to drivers/ide/ide.c. I added following piece of code in the function ide_init().

#ifndef MODULE /* I dont want the below code to be compiled if I later compile this as a module */
ide_setup("hdb=noprobe"); // I don't have second HDD, still I don't want it to probe.
#endif /* !MODULE */

The above code will ensure that, when the kernel loads ide drivers, it wont probe for my hard disk. And above piece of code helped me to achieve my goal. I still don’t know whether there is some way to pass hda=noprobe to ide without doing above code change. If someone know, how to do it, then let me know.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: