This question pertains to stream modules on a Sun Sparc 1 running
SunOS4.1.1
I'm currently writing an application that requires me to do some
processing of raw data that comes across a serial line. I've
decided that the appropriate way of dealing with this (and
hiding the horrors from the application level program) is to
insert a module into the stream.
Using that brilliant piece of documentation, known as "STREAMS
Programming" in the Sun documentation set, I've run into
problems when I come to push (ioctl(fd, I_PUSH, "modname"))
my module. It returns an error indicating that I have an
invalid arguement to my ioctl call. Okay, I think, it obviously
doesn't know of the existance of my module.
Now it strikes me that I can add my module information into
the fmodsw structure in /sys/sun/str_conf.c and remake a
kernel that knows the module name and the variable name
of my streamtab structure. Unfortunately I'm not root
and the sys-op is not interested in creating a new kernel
for me.
My alternative is to use modload to dynamically load the
module into the kernel when I need it. The only documentation
on this is in the device drive section of the manual set.
It is as good a document as streams manual (which doesn't
tell you how to register a module to load - argh). I
have written a wrapper program that sets up the vdldrv struct
(not being able to figure out what things should be set to
I set pointers to NULL as I don't want to define character
or block device entry points or controller information, and
any variables to 0). The wrapper also defines a xxxinit for
modload.
Modload successfull loads the compiled wrapper (-DKERNEL -Dsun4c)
and gives an address where the (I assume) xxxinit resides and the
module id. Using adb I debug the kernel and look at fmodsw struct.
You've guessed it: my module information isn't there. When I try
to run my program, it again can not find my module name and blows
up on the I_PUSH.
What I would like to know is what am I doing wrong. Has anyone
got streams to work in the manner that I have described above?
Does anyone have any other suggestions/alternatives.
advTHANKSance
--
,
"A storm breaks trees, Mark -%)
Solzhenitsyn ...!{uunet!ubc-cs, utai}!calgary!msw