[fpc-pascal] ioctl

Alain Michaud Alain.Michaud at nrc-cnrc.gc.ca
Tue May 16 18:18:53 CEST 2006


Hi,

  I am trying to use the FpIOCtl in the BASEUNIX unit. Guess what?  the
only thing I get back is -1 !

Is there any example code available on how to talk to a kernel module?

The only kernel that I know to talk to is the one that I am trying is
the one that I am writing myself. I am not too familiar with writing
device drivers in C. Therefore I would apreciate if someone could sent
me an example of a SIMPLE "char" module.

So far, I could register the device using

 "register_chrdev(major, name, &fops)" 

This seems to work, since I then see the driver in: /proc/modules
/proc/devices and /sys/modules

My next step is to issue an FPIOCTL commant but the return code is -1
and the driver never sees the command.

Question:  

Do I need open a "file deccriptor" in order to communicate using IOCTL?
It should not be?

I have spent the week-end on this, and failed again ... My self esteem
is close to nul at this point. Help please...

Thank you 

Alain Michaud






More information about the fpc-pascal mailing list