Re: GEOS device driver questions

GWRepNate@aol.com
Sat, 14 Dec 1996 11:09:01 -0500

In a message dated 96-12-13 15:38:10 EST, diel@intbuso.boeblingen.netsurf.de
writes:
> Nathan, I have learned already a lot from your answers to my questions.
> Nevertheless, I did not yet succeed in just getting my driver loaded.
> Let's see whether we can get closer.
>
> > Oh, now I understand. Is this new driver going to replace the pcmcia
> >driver, or work in concert with it?
>
> Ultimately, the driver should work in concert with the existing pcmcia
> driver. For the time being, I wouldn't mind if it replaces the existing
> driver.
>
> > Could it be that your driver is not being loaded? If anything is ever
> >launched it will be shown in Swat. Swat will try to find the .sym file
for
> >the geode and if it can't find it, Swat will stop and ask for your input.
> >Therefore, I'm guessing that your new driver is not being loaded.
>
> I also believe that my driver is not being loaded.
> What do I have to do to get it loaded ?
> From your (and Eds ) further comments, I learned that there are basically
> two ways to load a driver.
> 1. Specify the "driver" parameter in the .gp file of a geode requiring
> the driver.
> 2. call an explicit GeodeUseDriver() in a geode.
> As already mentioned, I have tried both ways without success.
> with alternative 1: GLUE complaints that it cannot locate the library
> smcard
> with alternative 2: The return code from GedeUseDriver says
> "Incompatible library protocol"
>
> > You mean you tried to make the name of your driver "pcmcia"? In this
case,
> >make sure you name the source directory "PCMCIA" and the name of the .gp
file
> >must be PCMCIA.GP. Otherwise Swat won't be able to find your application
when
> >you try to "send" it over, nor will it know how to find the .sym file
when
> >your geode is started.
>
> I just tried the name "pcmcia" after the real name (being "smcard") did
> not work and the driver is a kind od pcmcia driver.
>
> > Is "smcard" the name of your driver? I don't recognize it as a system
> >geode.
>
> Yes, it is "smcard" and it is certainly not a system geode but my private
> (driver) geode. Does it have to be a system geode ?
> Maybe I should in fact rename my driver to "pcmcia" and ... ? ...

Now I understand. You can't reference smcard with the "driver smcard" line
in your .gp file because your driver isn't listed in the appropriate platform
file in the INCLUDE\LDF directory. You'll need to do one of two things to be
able to use your driver in an application: 1) Add an entry for smcard to the
appropriate .plt file in the LDF directory and reference it in your .gp file.
2) Use GeodeUseDriver() to load the driver at run-time and do not specify the
driver in your .gp file.

> > If you don't specify the name of the driver in your .gp file then your
> >geode will launch whether the driver is available or not. Then at
run-time
> >your geode uses GeodeUseDriver to attempt to load the needed driver. If
it
> >can't be found, then your geode will have to deal with it in another way.
The
> >easiest thing to do is specify the name of the driver you want in your
.gp
> >file and not use GeodeUseDriver at all. The advantage of doing it the
other
> >way is that your geode will launch without the driver and it can still do
> >something like "I need the XXX driver to run. Please restart me after
putting
> >the XXX driver in the YYY directory."
>
> I guess I would prefer the "driver" parameter in the .gp file, but I
> cannot get it working.

See answer 1) in my paragraph above.

> > Chances are you need to ask for a driver with non-zero protocol
numbers.
> >I've never tried this myself, so I'm just guessing. Try looking in the
.plt
> >file (located in the Include\Ldf directory on your host machine) for the
> >platform you're using (e.g. zoomer, omnigo, pt9000, or geos201) and look
for
> >the driver name you want. The file lists all the libraries and drivers
> >available on that platform and what their protocol numbers are. Glue uses
> >these .plt files to determine if your app will work with the
library/driver
> >you specify in your .gp file.
>
> My driver has an .ldf file in my local SMCARD directory, but I cannot find
> a protocol number for it in the omnigo.plt file.
> I assume these .plt file contains protocol numbers only for system geodes.
> Right ?
> How can I get a new protocol number (for my driver or its ldf ?) and add
> it to the .plt file ?

Right, the .plt files only contain the protocol numbers to system geodes.
The protocol number of your driver is 0.0 unless you use grev to change that.
Check the Tools book, section 10.7 on using grev. Then add an entry for your
smcard driver to the .plt file, if you want to use the "driver smcard" line
in your .gp file. Otherwise, if you're just going to load your driver at
run-time using GeodeUseDriver then you can skip everything I said above.

> > Again, I would have thought this might be in the GEOS.INI file, but I
> >didn't see anything. It could be that GEOS will know to load the "pcmcia"
> > ......
>
> Can I extend the GEOS.INI file such that my driver is known to GEOS ?

I don't know of an existing entry for specifying the pcmcia driver in the
GEOS.INI file. You can add entries to the .INI file, but that doesn't mean
the system will utilize them. The answer is essentially no, you can't make
the system load your driver. I think your only choice is to rewrite the
pcmcia driver and replace it exactly. In other words, create a geode with the
same protocol number and names. And be sure to provide all the same services
that are provided by the pcmcia driver.

Nathan
P.S. You can send messages to just "geos-dev@lifelike.com", rather than
carbon-copying individuals. Otherwise we get the mail twice.