-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 03 October 2001 18:38, Heiko Nardmann wrote:
> On Wednesday 12 September 2001 20:29, you wrote:
> > h.nardmann@... said:
> > > How is this done? Do I just call ioctl() with the real file
> > > descriptor? Is the real file descriptor available in this situation
> > > already or do I have to open the device before? According to struct
> > > chan in chan.h there is a file descriptor. Is this the one to use?
> >
> > Yup, that's the one to use. Just invoke the same ioctl on it and return
> > the same return value. If there are structures passed in as arguments,
> > then it gets a bit more complicated, but if it's just the command and a
> > non-pointer argument, then it's pretty simple.
> >
What do you mean with "more complicated" if structures are passed? My
understanding of ioctl() is really limited ...
> > > OT: where do I find some documentation about these control codes? The
> > > header file and some man pages which I have checked weren't very
> > > helpful. Any other source?
> >
> > They are not well documented. I usually locate a driver that implements
> > the one I'm interested in and see what it does.
> >
> > Jeff
>
> Now I am back and have time to do the ioctl() implementation.
>
> My problem just is where to get access to the struct chan which holds the
> file descriptor for the target. The function ssl_ioctl() only gets a
> pointer to struct tty and a struct file but no one to struct chan.
A few days ago I added the following lines to 2.4.10-7:arch/um/drivers/ssl.c
(attached as a unified diff against UML 2.4.10-7: ssl.c.diff).
Do you think these lines are enough to access to a chipcard reader attached
to the serial line /dev/ttyS0 ? Are there any settings (e.g. raw flag) to be
set additionally? I currently get a different behaviour when running the test
program from the normal host.
For testing I use the filesystem root_fs.rh71.pristine.bz2.
This is how I start UML:
linux ubd0=/home/nardmann/UML/root_fs.rh71.pristine ssl=pty
ssl0=tty:/dev/ttyS0
I have a dynamically linked test file which tries to access the chip card
readers. I copied this file to the root fs stated above.
I have the following entry as ttyS0 in /dev in the root fs:
crw-rw-rw- 1 root root 5, 64 Nov 6 17:21 dev/ttyS0
Notice that I set the major value according the info in one of your last
emails to me.
I do not get any messages like unimplemented ioctls on the screen.
Here is the expected output of the test program:
- ----------------------------------------------
Test-CTAPI
==========
Verwendeter Port: 1
CT_init: 0
second CT_init: -1
CT_data (resetCT): 0 (len=2) 9000
CT_data (activate ICC): 0 (len=12) 9001
CT_data (deactivate ICC): 0 (len=2) 6700
CT_close: 0
second CT_close: -1
CT_init again: 0
CT_data (resetCT): 0 (len=2) 9000
CT_data (activate ICC): 0 (len=12) 9001
CT_data (deactivate ICC): 0 (len=2) 6700
CT_close: 0
- ----------------------------------------------
Here is what I get:
- ----------------------------------------------
Test-CTAPI
==========
Verwendeter Port: 1
CT_init: 0
second CT_init: -1
CT_data (resetCT): -8 (len=2) 0000
CT_data (activate ICC): -128 (len=1024) 1200
CT_data (deactivate ICC): -128 (len=1024) 1200
CT_close: 0
second CT_close: -1
CT_init again: 0
CT_data (resetCT): -8 (len=1024) 1200
CT_data (activate ICC): -128 (len=1024) 1200
CT_data (deactivate ICC): -128 (len=1024) 1200
CT_close: 0
- ----------------------------------------------
Attached is
1.: test_api.uml.strace.log: the strace output which I get when running the
test program inside UML
2.: test_api.strace.log: the strace output which I get when running the test
program on the normal host
Any idea what to change inside uml additionally?
I noticed that in the UML logfile there is no occurrence of shmat() which is
really curious since it appears in the source code of this test program and
also in the logfile of the test on the real host.
- --
Heiko Nardmann (Dipl.-Ing.), h.nardmann@..., Software Development
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de),
Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax : +49 271 48950-50
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE76Odppm53PRScYygRAs5ZAJ0X2ILWvr9ZZc/puTCafs1ucCnP8gCdFHp6
wX0LD7V2+5LWXRwtulq4uRU=
=s1my
-----END PGP SIGNATURE-----
|