A GPR400 / GemPC400 Linux driver
Introduction
I made this driver to allow me access to lot's of diffrent types of IC cards that I can't read with the original driver written by Jaiger. This driver is an improvement of the original driver and permits me to read synchronous cards for which an "ASIC" driver exists, and of course allow access to microprocessor smartcards, that the original driver provided before.
Download
- The GPR400 linux driver: gpr400.tar.gz
- The GPR400 ICC Driver file archive: iccdrv.ZIP. (Got from the Gemplus' support).
- Sample source code for reading and loading data from a GPM 256 card: gpr400_test.c
How does it work ?
First, you need to load the binary file containing the driver for your specific card. Those files are stored in the Icc drivers archive. The following table shows which file is needed for which card. The load sequence is provided by the GPR400_IOCTL_LOAD_MEMORY call provided by the ioctl driver mecanism. (example: gpr400_test.c).
Next, after the SELECT and ACTIVATE ioctl calls, you'll be able to OPEN a SESSION and EXCHANGE APDU commands with your card.
| Card type | GPR driver |
|---|---|
| GAM 226 | Iccdrv0f.gpr |
| GFM | Iccdrv06.gpr |
| GPM 103 | Iccdrv07.gpr |
| GPM 256 | Iccdrv03.gpr |
| GPM 271 | Iccdrv0e.gpr |
| GPM 276 | Iccdrv0d.gpr |
| GPM 416 | Iccdrv04.gpr |
| GPM 8K (SLE4418 / SLE4428) | Iccdrv08.gpr |
| GPM 2K (SLE4432 / SLE4442) | Iccdrv09.gpr |
Tests report
Some cards have been reported to work with this driver and not with the Jaiger's one. Some cards might work with Jaiger's and not with mine too. Actually, tests have been performed with this asynchronous cards too:
| Schlumberger Cryptoflex 16Ko | log |
| Gemplus GemXpresso 211is | log |
| Gemplus GemXplore Xpresso V3 B1P | log |
| Gemplus GPK8000 | log |
| MCOS 24k EEPROM | log |
| Sagem Windows for smart cards | log |
Technical informations
Due to a lack of good documentation provided by Gemplus, this
driver is a complete reverse engeneering hack. The pdf documentations used
to make this possible are:
- The GPR400 Reference Manual (Ref: 248_E5234010.pdf)
- The Windows API description (Ref: 267_E5234016.pdf)
- The WinGPR software documentation (Ref: 299_E5234018.pdf)
The GPR400 reader is built around two specific components. Of course
I don't have the datasheet for them, and asking google doesn't provide
me nothing really interesting. So, I will glad if someone can give me
them:
- TEMIC Micro-1FEM-5 / CSIC V1.1 / 9814 .Z23522E
- MHS / GPR400 V1.1 / IVC52CLC - 16 / INTEL 8082 / 9609 .Z04142B
This section try to explain how are exactly mapped the datas in the PCMCIA attribute space memory. This information may be inexact, so if anyone can confirm it would be helpful; Gemplus flatly refused.
| Offset in AM space | Description |
|---|---|
| 0x0000 to 0x00FF | GPR400 ROM. |
| 0x0100 to 0x06D3 | internal RAM space dedicated to driver's subroutine or new GPR400 commands. |
| 0x06D4 to 0x07CF | internal RAM space, no specific usage. The Asic stack space is here. |
| 0x07D0 to 0x07DF | The famous SETUP, GENERAL SMARTCARD and CLOCK registers. |