Linux kernel 2.4.1-2.4.7 PCMCIA IDE-disk problem fixation

Last updated 2001-07-31 11:01 am


Currently, there are serious conflictions between Linux kernel 2.4 (2.4.0 is ok, but 2.4.1-7 are not) and pcmcia-cs package. According to this probolem, you can't mount and manipulate flash cards (IDE interface compatible) on kernel 2.4.1-2.4.7. I resolved the situation by the following method.

linux-2.4.7/drivers/ide/ide-cs.c
     
static dev_info_t dev_info = "ide-cs";

Until kernel 2.4.0, dev_info was defined as "ide_cs" (UNDERSCORE) and pcmcia-cs package also used the same name in a configuration file. The definition was exchanged to "ide-cs" (MINUS) since kernel 2.4.1, but pcmcia-cs package is still using "ide_cs".

pcmcia-cs-3.1.27/etc/config
     
device "ide_cs" class "ide" module "ide_cs"

So, you would encounter a mysterious error message "get dev info on socket 0 failed: Resource temoporarily unavailable" in combination of the latest kernel 2.4.7 and pcmcia-cs-3.1.27. You can escape from the problem by replacing "ide_cs" with "ide-cs" in the pcmcia-cs configuration file.

     
# mv /etc/pcmcia/config /etc/pcmcia/config.orig # sed -e 's/ide_cs/ide-cs/g' /etc/pcmcia/config.orig > /etc/pcmcia/config
Currently, you need an user-space tool, cardmgr, for PCMCIA cards. cardmgr works in the background as a daemon, and automatically detects and resigsters a card when it is inserted into a socket. According to the configuration file (default /etc/pcmcia/config), cardmgr tries to load a corresponding driver from /lib/modules directory. Since kernel 2.4, /lib/modules directory becomes to be awfully complicated, and special directory pcmcia should contain links to appropriate drivers buried in the nested dir tree. Unfortunately, current kernel Makefile dismissed away a link to ide-cs.o, so you have to create him by your hand.
lib/modules/2.4.7/pcmcia
     
lrwxrwxrwx 1 root root 42 Jul 24 03:53 aha152x_cs.o -> ../kernel/drivers/scsi/pcmci a/aha152x_cs.o lrwxrwxrwx 1 root root 30 Jul 24 03:53 ide-cs.o -> ../kernel/drivers/ide/ide-cs.o

That's all. Enjoy!

BTW, I has been feeling PCMCIA usage on Linux kernel 2.4 is somthing ambiguous and confusing. I hope I can introduce a tiny HOWTO presenting some cases (getting your family's JPEG photo images from compact flash cards, connecting SCSI instruments using Adaptech slim SCSI).