Hello,
I am having problems with memory faults when using USB SDK under QNX4. My
goal is to use the IO Manager framework such that after a device enumerates
and entry in the prefix tree appears for read, write, and ioctl operations
from other processes. I was given a work around which uses an internal
frame work supplied in the iomgr.lib supplied in the beta version of the
SDK. This appears to be incompatible with the iomgr framework available on
QUICS as it implements pthread functions (determined from unresolved
references when linked against the Framework library).
I have been able to communicate with my device within the insertion callback
with no anomalies, but any attempts to communicate from outside the child
process have resulted in memory faults. I have tried to tfork the server
process but this results in the Receive function of my parent crashing in
memory fault. I have tried storing all the results from my usbd_* calls in
shared memory but this leads to a memory fault in the first call to the
stack outside of the one process.
I have another process which is now managing my prefix tree. As devices are
inserted and removed update information is sent to the other process for the
control of the available devices.
Is there an interface with /dev/usb which I am not understanding?
Is there a way to interface with the server with user implemented read,
write, and ioctl functions?
Any ideas would be appreciated.
Thank you,
Arthur Peet
The framework suggested previously is as follows:
o
o
o
if( fork() == 0) { // tfork will not work.
if( server_init( ) == -1 ) {
fprintf( stderr, “Unable to initialize server\n” );
return( -1 );
if ( status = inode_init( 10 ) ) != EOK ) {
fprintf( stderr, “Unable to init inode table (%s)\n”,
strerror( status ) );
return( -1 );
}
// Connect to the stack.
connectStatus = usbd_connect( &shm->deviceParms, &shm->connection ); //
This will not work outside of this fork.
server( &version ); // This call is different than the standard IO Lib
which accepts no parameters (void).
} else { file://Parent
while( 1 ){
Receive( …… ); // I would like to accept messages for read, write,
and ioctl operations in this process.
o
o // I have no way to access the usbd_* functions within this
fork.
o // I have tried tfork and shared memory to no avail.
o
switch( msg……){
}
}