PCMCIA configuration file-PCMCIA card reader

Source: Internet
Author: User
Article title: PCMCIA configuration file-PCMCIA card reader. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Background

I went out to play with a few colleagues and tried to collect photos from my laptop on the plane. I found many problems were encountered in the root mode, such as MOUNT and copy.

The two most prominent problems are.

· When some cards are inserted, cardmgr will die and CPU usage will change to 100%

· Some will always report device is busy when umount is completed after the copy is completed

So I spent two days on Tianji to solve these problems, and now I will share my experience with you.

There are three internal documents.

· PCMCIA configuration --- pcmcia card reader

· A simple method of disk Mount-a convenient mount method is introduced.

· Udev and Hotplug use udev rules to make specific devices use fixed device names.

PCMCIA configuration

My environment debian sarge pcmcia-cs 3.2.5-10

Card readers are basically all ide-cs devices, that is, all the hardware for ide to pcmcia. I actually use two card readers,

I had a very old Card reader Sony Memory Stick/PC Card Adaptor MSAC-PC2. Only memory stick is supported.

This clip is older, and it is what makes me sad on the plane. now let's analyze the cause of the problem.

Before analyzing the cause, we will introduce the main debugging methods of pcmcia.

Cardctl is the most important debugging and control tool for pcmcia. You can view the recognition information, status information, and configuration information of a card,

Cardctl on the cardinfo graphical interface

Dump_cis, dump PCMCIA configuration information

Cardmgr, pcmcia monitoring daemon

When the above tool is used normally, the information obtained is as follows: cardctl config

Socket 0:

Vcc 3.3 V Vpp1 0.0 V Vpp2 0.0 V

Interface type is "memory and I/O"

Irq 3 [exclusive] [level]

Function 0:

Config base 0x0200

Option 0x41 status 0x00 pin 0x00 copy 0x00

Io 0x0100-0x010f [auto]

Cardctl status

Socket 0:

3.3 V 16-bit PC Card

Function 0: [ready], [bat dead], [bat low]

Cardctl ident

Product info: "SONY", "MEMORYSTICK (128 M)", "1.0"

Manfid: 0x00f1, 0x0000

Function: 4 (fixed disk)

/Etc/pcmcia/config is the configuration file of pcmcia and may add the card to the configuration file.

Card "SONY MSAC-PC2"

Manfid 0x1, 0x0000

Bind "ide-cs"

In this way, when the card is inserted, it will automatically identify and load the ide-cs driver.

However, the most common reason for this problem is that cardmgr is dead and 100% is used in the system CPU because it is used when the card cannot be correctly identified.

Card "Anonymous Memory"

Anonymous

Bind "memory_cs"

Since kernel 2.6 uses MTD to support memory_cs, memory_cs will not be loaded successfully, and then the CPU will be 100%.

After kill cardmgr, the system returns to normal. (Use kill-9)

You can also modify the above bind to prevent 100% CPU usage. (For example, bind "ide-cs ")

I don't want to be tortured by this broken card. I bought a new one yesterday.

MCR-5A of buffalo, support for MMC, SD, ms, ms PRO (ms duo, mini SD is also supported with adapter)

This card is relatively new, not so much trouble. Socket 0:

Product info: "", "Memory Card Adapter"

Manfid: 0x0045 and 0x0401

Function: 4 (fixed disk)

Socket 1:

No product info available

Debianlinux:/etc/udev/rules. d # cardctl config

Socket 0:

Vcc 3.3 V Vpp1 0.0 V Vpp2 0.0 V

Interface type is "memory and I/O"

Irq 5 [exclusive] [level]

Function 0:

Config base 0x0200

Option 0x41 status 0x00 pin 0x00 copy 0x00

Io 0x0100-0x010f [auto]

Socket 1:

Not configured

Debianlinux:/etc/udev/rules. d # cardctl status

Socket 0:

3.3 V 16-bit PC Card

Function 0: [ready], [bat dead], [bat low]

Socket 1:

No card

Add the following to the config file:

Card "bufflo 5in1 card adapter MCR-5A"

Manfid 0x0045 and 0x0401

Bind "ide-cs"

Tips:

1. check online if your card is supported http://pcmcia-cs.sourceforge.net/ftp/SUPPORTED.CARDS

2. if the configuration file is not written in the default config file, you need to add the configuration information to the config file by yourself. basically, you can obtain various information through cardctl.

3. if not, google or write your own driver. (thank you for your support)

4. -v can be added to the cardmgr parameter in/var/log/kern. you can see more detailed log information in the log to help you locate the problem. you can add the kill command to kill the system.

The default one, and then manually start cardmgr (for details, see man cardmgr)

5. if the card is not recognized, use cardctl eject and cardctl insert.

6. the ide-cs card will not be recognized by the system when no memory card is inserted.

7. do not use old cards. it is very troublesome.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.