perhaps the wrong forum...

This is the English forum for all topics related to IO-Warrior. Please post in English only

Moderator: Guido Körber

Post Reply
haarts
Posts: 26
Joined: Wed Jan 03, 2007 1:14 pm

perhaps the wrong forum...

Post by haarts »

Dear all,

I am sorry to ask but I am new to this whole 'shared library'/c stuff. As I understand it there are two way of accessing my IOW24. One through simple select()/read()/write() operations and the other through the iowkit API. Right? I managed to compile this library on my linux(debian) box and ended up with a libiowkit.so in the src directory. All nice and well, but how do I use it?? I read the "IOWarrior Library.pdf" and tried the first IowKitOpenDevice example. The entire program looks like this:

Code: Select all

#include "iowarrior.h"

IOWKIT_HANDLE ioHandle; 
ioHandle = IowKitOpenDevice(); 

int main (int argc, char **argv) {
        if (ioHandle != NULL) 
        { 
                // ... success, access devices 
        } 
        else 
        { 
                // ... didn't open IoWarrior, handle error 

        } 
}
and I try to compile with this Makefile:

Code: Select all

MODULE_DIR=/home/harm/share/LinuxSDK/Kernel_2.6/Driver
SO_DIR=/home/harm/share/LinuxSDK/Kernel_2.6/iowkit/src
all: advopen

clean :
        rm -f advopen;


advopen : advopen.c
        gcc -Wall -g -I ${MODULE_DIR} -L ${SO_DIR} advopen.c -o advopen
This does not work, not to my surprise I might add. I have the feeling this shared library should be somewhere in the includes as well. But I have no idea how Makefiles or includes work.

Does someone pity this fool and shed some light on it? Many thanks in advance.
Robert Marquardt
Posts: 543
Joined: Mon Dec 01, 2003 6:09 pm

Post by Robert Marquardt »

This looks like the Iowkit 1.4. Please download the current 1.5 SDK from our website. Best the SDK for all systems because it contains all the documentation also.
The Linux subdirectory contains also some instruction files on how to install (this is also true for the Iowkit 1.4, please read the files named INSTALL).
haarts
Posts: 26
Joined: Wed Jan 03, 2007 1:14 pm

Post by haarts »

Aha! Can I still use the old kernel module?
Robert Marquardt
Posts: 543
Joined: Mon Dec 01, 2003 6:09 pm

Post by Robert Marquardt »

No. Install the new one instead. It supports the IOWarrior 56 and implements a real write(). The 1.4 libiowkit.so uses an ioctl() call for writing whereas the 1.5 libiowkit.so uses the implemented write().

The new driver is on its way to be included in Kernel 2.6.21.
haarts
Posts: 26
Joined: Wed Jan 03, 2007 1:14 pm

Post by haarts »

I was afraid for that. How do I uninstall a kernel module? Can I just remove it? I guess not. I think I should remove it with rmmod, then remove it from the disk and then run depmod. Is that correct? I rather want to be save than sorry.
Robert Marquardt
Posts: 543
Joined: Mon Dec 01, 2003 6:09 pm

Post by Robert Marquardt »

Simply install the new one. It overwrites the old one. Installation unloads the old module installs the new one and loads it.
haarts
Posts: 26
Joined: Wed Jan 03, 2007 1:14 pm

Post by haarts »

Alright! I got as far as to rebuild the kernel module and the iowkit. One suggestion: I had to rename the directory "iowkit 1.5" to "iowkit-1.5" (note the space). Otherwise 'make' got confused seeing everything after the space as a new make target.

I do not have time to actually try writing an own program atm. Will get back!
Robert Marquardt
Posts: 543
Joined: Mon Dec 01, 2003 6:09 pm

Post by Robert Marquardt »

Try the test programs.
haarts
Posts: 26
Joined: Wed Jan 03, 2007 1:14 pm

Post by haarts »

I must say I am impressed! This is precisely the starting point I was looking for.
Two thumbs for your support and documentation, this definitely helps advertising the greatness of the IOW from CodeMercenaries!
Post Reply