Re: GEOS version numbers and protocol numbers

GWRepNate@aol.com
Mon, 16 Dec 1996 11:34:51 -0500

In a message dated 96-12-16 07:52:35 EST, diel@intbuso.boeblingen.netsurf.de
writes:
> There are chances that my problem with getting my device driver loaded
> has to do with version numbering or protocol numbers. Therefore, I have
> the following questions:
> - Are there special rules with respect to version numbers and protocol
> numbers of device drivers ?
> For example in driver.def is the following definitions
> ; Protocol number for "DriverFunction" interface. All other driver
> ; protocols
> ; will be based on this number.
> ;
> DRIVER_PROTO_MAJOR equ 2
> DRIVER_PROTO_MINOR equ 0
> and in the header for DR_INIT
> protominor KernelDR_INITWithGeodeHandle ; etype
> - What are the (standard) means to control version numbers and protocol
> numbers ?
> I used the -P and -R parameters of Glue to set my version number to
> 2.0.0.0 and my Protocol number to 2.0.
> I know GREV can also be used to control version numbers, but I had
> difficulties using it (see below).

Use Grev. It is the tool for setting both the protocol and revision numbers
of the geode you're writing. The -P and -R only display the current protocol
and revision numbers, not change them. Here are some examples of using grev:

- Create .rev file:
grev new myapp.rev

- Update protocol major number:
grev NPM myapp.rev

- Update protocol minor number:
grev npm myapp.rev

- Change release/revision number:
grev newrev myapp.rev x.y.z
[Note that the book is incorrect in showing only two digits. Grev wants
three period-separated numbers.]

For more information on grev, see section 10.7 in the Tools book.

> - If there are special rules, what might I have done wrong ?
> This is of course a difficult question. Just in case somebody has an
> idea.

I don't know much about drivers, but I would assume there are no special
rules. The only thing that makes a difference to the system is the protocol
number. When GEOS wants to open a driver or library it checks the protocol
number to make sure it is an up-to-date version. If your protocol number is
too low, GEOS won't use it (and will likely report an error if it can't find
a driver that does have a satisfactory protocol number). How to know how high
to set the number is something I do not know.

> - What means the statement
> #PROTOCONST = xxxxx
> which I found in many local.mk files for drivers ?
> Does it have to do with protocols and should I have similar
> definitions ?
> I could not find an explanation in the SDK documentation.
> - GREV commands (most of them) require a "file" parameter.
> Which filename do I have to use ?
> The name of the .goc file does not work.
> Do I need a .REF file ? If yes, how can I build one ?

You create the file, naming it whatever you want. Of course, only a file
name of the form <geode-name>.rev will be recognized. <geode-name> is the
name of the directory your source code is in, which is also the name of the
.gp file, and the name specified in the .gp file on the "name" line. All four
must be the same.

> Regards, Hans Diel

Nathan