Re: GEOS device driver questions

GWRepNate@aol.com
Wed, 11 Dec 1996 12:32:30 -0500

In a message dated 96-12-11 08:05:53 EST, diel@intbuso.boeblingen.netsurf.de
writes:
> I developed a new PCMCIA driver which I tested already under DOS and which
> I now want to port to OMNIGO/GEOS.

Oh, now I understand. Is this new driver going to replace the pcmcia
driver, or work in concert with it?

> >Which driver do you want to specify? I believe it's name will be the same
> >as that shown in Swat when the system is booting.
>
> My driver does not show up in SWAT when the system is booting. Maybe
> that's my first problem (?).

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.

> >It is the "permanent"
> >name of the driver, usually eight characters or less. For PCMCIA it would
> >be "pcmcia".
>
> When I tried it with name = "pcmcia" , the application generation by the
> SDK worked fine, but at run-time I got the message
> "Couldn't launch the app"
> When I used the name which I gave as the permanent name in the .gp file
> (it is "smcard", or "smcardec" ), PMAKE or probably GLUE says
> "cannot locate library smcard" (or cannot locate library
> smcardec)

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.

Is "smcard" the name of your driver? I don't recognize it as a system
geode.

> Questions:
> 1. What is the right way to specify my drivers name ?
> The answer to this question probably should also explain how I have
> to introduce my driver to the GEOS. Right now I just
> - declared it in the .gp file as a driver
> - transfer it to the target machine in the directory
> \SYSTEM\PCMCIA\

I don't know the answer to this. I was looking in the GEOS.INI file hoping
there was an entry for pcmcia. It's there but it's not used to specify the
pcmcia driver. The name "pcmcia" could be hard-coded into the system
somewhere.

> 2. When do I have to specify such a dependency on a driver, anyway ?
> Does, for example GeodeUseDriver require this .gp parameter ?

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."

> >GeodeUseDriver takes care of all initialization in the driver. Simply
> >call the function and you're ready to start using the driver. Be sure to
> >call GeodeFreeDriver when you're done with it.
>
> When I invoked GeodeUseDriver( filename, 0, 0, err ) GEOS returned the
> error code 11
> GLE_LIBRARY_PROTOCOL_ERROR,
> Do you have an idea what the problem might be ?

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.

> >GEOS calls a driver when it is needed. If it isn't needed during bootup,
> >it isn't called up.
>
> Is there a way to tell GEOS that I would like to have the driver loaded
> during bootup ?

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"
driver when it detects a drive that no other driver can handle. In other
words, when GEOS detects a device it attempts to determine what it is. It can
sometimes do this without having to load any drivers, while other times it
just starts loading drivers and see which one works. I'm guessing again, as
this is not my area of expertise.

> >I might be misunderstanding your question, but here's an answer: The last
> >thing displayed in Swat when it is finished booting GEOS differs from one
> >machine to the next. On the Zoomer, two lines about zmanager are the last
> >things printed. When booting GEOS2X two lines about debug are the last
> >lines printed. On the OmniGo, the last line printed is about the pcmcia
> >geode exiting. For which platform are you writing a PCMCIA driver?
>
> I'm writing the driver for GEOS-OMNIGO.
> I was curious about this "reused patient pcmcia" message, because I
> thought it might be something interesting to me as a writer of a pcmcia
> device driver.

When Swat says "reusing patient xxx" that means that geode xxx has been
reloaded and Swat is reusing the .sym file it found the first time the geode
was launched. You'll eventually see a "thread Y of xxx exited" when the geode
exits the system.

Nathan