GemPC Card setup on Ubuntu

Two days ago I bought Gemplus GemPC Card reader for PCMCIA.
It was detected, by kernel and dmesg reported the following message:

[  100.000997] pcmcia_socket pcmcia_socket0: pccard: card ejected from slot 0
[  101.792085] pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0
[  101.792480] pcmcia 0.0: pcmcia: registering new device pcmcia0.0 (IRQ: 3)
[  101.794126] serial_cs 0.0: trying to set up [0x0157:0x0100] (pfc: 0, multi: 0, quirk:   (null))
[  101.794182] serial_cs 0.0: speaker requested, but PRESENT_STATUS not set!

The problem was that I need this card to be bind to some serial port. It took me two days and reading many useless results from Google. Suddenly, I decided to look deeper to this issue and found that it is common issue for PCMCIA devices on Linux – they are not bind to any serial port. The same problem was for modems.
So, I looked into the file /etc/pcmcia/config.opts and found the following strings:

include port 0x100-0x3af
include port 0x3e0-0x4ff
include port 0x820-0x8ff
include port 0xc00-0xcf7

Command setserial -g /dev/ttyS[0123] reported that all four serial ports are reserved. I decided to comment out string 2-4, so that it looked as following:

include port 0x100-0x3af
#include port 0x3e0-0x4ff
#include port 0x820-0x8ff
#include port 0xc00-0xcf7

After reboot, dmesg reported the following information

[  100.000997] pcmcia_socket pcmcia_socket0: pccard: card ejected from slot 0
[  101.792085] pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0
[  101.792480] pcmcia 0.0: pcmcia: registering new device pcmcia0.0 (IRQ: 3)
[  101.794126] serial_cs 0.0: trying to set up [0x0157:0x0100] (pfc: 0, multi: 0, quirk:   (null))
[  101.794182] serial_cs 0.0: speaker requested, but PRESENT_STATUS not set!
[  101.834170] 0.0: ttyS1 at I/O 0x2f8 (irq = 3) is a 16450

Edit /etc/reader.conf.d/libgcr410 file as following:

# Gemplus GCR410 reader
# see /usr/share/doc/libgcr410/Readme
FRIENDLYNAME      "GCR410"
DEVICENAME        /dev/ttyS1
LIBPATH           /usr/lib/pcsc/drivers/serial/libgcr410.so
CHANNELID         0x02f8

Execute the following command:

sudo /etc/init.d/pcscd restart

Estonian id-card center provides software also for Linux. So, people, who have Estonian id-card, can execute ID-card utility and it will look as following:

diagnostics report the following info:
Locale: English

ID-card package version: 3.4.3759.322-ubuntu-10-10
ID-card utility version: 3.4.3759.254-ubuntu-10-10
OS: Ubuntu 11.04 (32)
CPU: model name : Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz

Library paths: /usr/lib/qt4/plugins;/usr/bin
Libraries:
libdigidoc 3.4.3759.252-ubuntu-10-10
libdigidocpp 3.4.3759.288-ubuntu-10-10
openssl 0.9.8o-5ubuntu1
libpcsclite1 1.7.0-2ubuntu2
opensc 0.12.5217.250-ubuntu-10-10
QT (4.7.2)

PCSC service status: Running

Card readers:
* GemPCTwin serial 00 00
ID - [id-number]
ATR - [hash]

Browsers:
firefox 5.0+build1+nobinonly-0ubuntu0.11.04.2

Leave a Reply

%d bloggers like this: