2001-12-26 17:58:04

by toxischerabflussreiniger

[permalink] [raw]
Subject: writing device drivers for commercial hardware

As I'm new to linux kernel development I wonder how to write a
device driver, say for a card reader, if you don't have some
documentation about it.
How do you manage that? Searching for it in the web? I really don't
know ... there's a small book with my card reader but you won't find
a single line about technical stuff in it.
It's a (pretty simple and cheap) card reader connected to serial port.

Many thanks.


-----------------
Marc,
<[email protected]>


2001-12-26 18:38:25

by Alan

[permalink] [raw]
Subject: Re: writing device drivers for commercial hardware

> know ... there's a small book with my card reader but you won't find
> a single line about technical stuff in it.
> It's a (pretty simple and cheap) card reader connected to serial port.

If its connected to a serial port it may well be enough to find the
baud rate it uses and dump the data. If not then wire

Cardreader--->Linux Box----->Windows PC

and copy the serial data in both directions through the Linux box and also
log it.

2001-12-26 18:37:06

by Manfred Spraul

[permalink] [raw]
Subject: Re: writing device drivers for commercial hardware

I'd start with:

- read the existing smartcard drivers
- check the windows driver - there is software that monitors the serial port and logs all calls.
http://www.sysinternals.com/ntw2k/freeware/portmon.shtml
Try to reverse engineer the protocol between the driver and the smartcard reader.
- open the smartcard reader, and check if you can identify the producer of the ICs that are used. Then try to find the datasheet.
google often helps.
- Ask the company that makes the smartcard reader - perhaps they'll help you?

I'm not sure if the driver should be user space or kernel space, but I'd definitively start in userspace.

Good luck,
--
Manfred


2001-12-26 18:50:45

by Bjoern A. Zeeb

[permalink] [raw]
Subject: Re: writing device drivers for commercial hardware

On Wed, 26 Dec 2001 [email protected] wrote:

> As I'm new to linux kernel development I wonder how to write a
> device driver, say for a card reader, if you don't have some
> documentation about it.
> How do you manage that? Searching for it in the web? I really don't
> know ... there's a small book with my card reader but you won't find
> a single line about technical stuff in it.
> It's a (pretty simple and cheap) card reader connected to serial port.

Hi,

did something similar before christmas. Had a small win installation in
a vmware, slsnif running on the linux host and connected vmware on a
ttyp slsnif gave me. easy.

BTW what card reader is it ? There are already enough _user space_
implementations for serial smartcard readers. This is where this
normally belongs to.
Check http://www.linuxnet.com/ p.ex.

--
Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT
56 69 73 69 74 http://www.zabbadoz.net/

2001-12-26 18:59:45

by toxischerabflussreiniger

[permalink] [raw]
Subject: Re: writing device drivers for commercial hardware

On 26 Dec 2001, at 19:50, Bjoern A. Zeeb wrote:


> BTW what card reader is it ? There are already enough _user space_
> implementations for serial smartcard readers.

As I've said, this is a really cheap one, I don't think that it's well-
known.
It's from ELV and called 'GSM- und Chipkartenleseger?t', so, it's a
German one. Sorry for that.
But thanks for all your hints and tips. I'll keep on trying.



-----------------
Marc,
<[email protected]>

2001-12-31 10:08:49

by Sven Geggus

[permalink] [raw]
Subject: Re: writing device drivers for commercial hardware

In article <3C2A2BF6.9718.4C5955@localhost> you wrote:

> As I've said, this is a really cheap one, I don't think that it's well-
> known.
> It's from ELV and called 'GSM- und Chipkartenleseger?t', so, it's a
> German one. Sorry for that.
> But thanks for all your hints and tips. I'll keep on trying.

Wegen diesem teil hab ich schon bei ELV angefragt:

Keinerlei Doku im Gegensatz zu den sonstigen ELV Produkten. Ich nehme an,
dass es sich um Taiwan Schrott handelt, den die selbst nur durchreichen.

Wie die Vorredner schon sagten: Meist braucht man fuer seriell
angeschlossenen Geraete definitiv keinen Kernelreiber. Der vorhandene
Treiber fuer die serielle Schnittstelle reicht aus.

Conrad verkauft ein ebensobilliges Teil von Towitoko, fuer das es
Linuxtreiber gibt (stichwort scez).

Gute Links rund um das Thema Programmierung der seriellen Schnittstelle
unter Linux hat die Homepage eines ganz anderen Projektes:

http://wth.berlios.de

Sven


--
"I'm a bastard, and proud of it"
(Linus Torvalds, Wednesday Sep 6, 2000)

/me is giggls@ircnet, http://geggus.net/sven/ on the Web