

GUS Programmer's Digest     Fri, 19 Nov 93  4:44         Volume 6: Issue  11  

Today's Topics:
                             OS/2 driver
                    Waz gonna be a real nice guy..

Standard Info:
	- Meta-info about the GUS can be found at the end of the Digest.
	- Before you ask a question, please READ THE FAQ.

----------------------------------------------------------------------

Date: Thu, 18 Nov 1993 12:39:21 -0500 (EST)
From: rjm@dretor.dciem.dnd.ca
Subject: Re: OS/2 driver

GUYLAIN LAVOIE <lavog00@DMI.USherb.CA> wrote:
> 
> Hi all...
>          After having waited too long to get my OS/2 gus driver,
> I decided to program one myself.  At this time, it is quite fun.
> I can peek and poke to the card... Set up voices... Until now,
> all worked fine, but now I'm in deep trouble, I really don't know
> how to program the dma transferts (on the motherboard and card)...
> I checked the sdk source but it is very hard to read. 

I have the same feelings and am also working on one.  I am currently
in the process of porting the functions that I need inside the SDK
(removal of PIC accesses, proper hooking of INT handlers, logical to
physical address translations, ...) and then placing the wrappers for
the replacement DevHlp calls around them.  I hope to have a PDD with
the same functionality (and device name) as SBOS2 very soon so that
applications written for it will work unchanged (trakker).

> ...

> Ok now what I don't understand! :)
> How do I tell the card the dma channel that the dma will use?

Use parameters on the device line in the config.sys.  See the example
AUDIODD included in the PDK for an example of how to parse them.

> What is this thing about dma transfert speed?

Use high speed (as done in the SDK).  OS/2 PDDs write directly to the
DMA controller (no DevHlp unfortunately) so that part of the SDK should 
be okay to use as an example.

> How do I tell the dma to pitch the buffer to the card?

This is more complicated.  Under OS/2 it is recommended that the DMA
buffer be allocated only once and used at that fixed address for all
services.  You should copy data received from the IO request packet
to that buffer and then start it up.

> Must I trap the dma controller irq (if one exist) or trap the
> card irq?  And in witch case?

You trap the card IRQ which signals that a DMA terminal count has been
reached.

> There is 2 dma controlers that exist, one 8 bits, the other 16 bits.
> Are these in my computer at the same time?  If so... does 8 bits channels
> goes through the 8 bits controler and 16 bits channels through 16 bits one?
> 

Ouch.  Yes they are both there.  Channels 0-3 are 8 bit and 4-7 are 16.
I recommend you read the SDK sources some more.  They are pretty good
late night reading material.

>...

> And one last thing... I would like to know if my approch to simulate
> irqs for an application is correct.  An application that wants to
> receive interrupts create a thread with the max priority and that thread
> wait on a semaphore that the driver will clear when an irq is generated.
> The only problem so far is that it may be 0 to x milliseconds  between
> the time the driver  cleared the semaphore and the time the thread is free
> to pass over the wait.  In os/2, by default the max time than a thread
> can have the control is 3 milliseconds. So normally the thread will
> wait between 0 and 3 milliseconds.  Does someone think that this
> time is too long to make the driver useful for mod and general card use?

There is no need to create a time critical thread in your application.
Just use DosReads and DosWrites to the device (e.g. GUSOS2$) and let
it handle the transfers.  OS/2 will lock down the buffers that you pass
to it.

Robert.
-- 
# Robert J. Manley,  rjm@dretor.dciem.dnd.ca      #
# NTT Systems Inc., Toronto, Ontario, CANADA      #
# OS/2:OSs :: 92,93 Blue Jays:MLB :: Canada:World #

------------------------------

Date: Fri, 19 Nov 93 0:16:43 GMT
From: "Bjarni R. Einarsson" <bre@os.is>
Subject: Waz gonna be a real nice guy..

I tried to upload my Pascal code to epas.. but ran out of disk space!
Major bummer.. if there had been 22k more free it would have made it.
How often do they clean up the submit directory?  There has been stuff
in there for weeks...

For those who are interested, this thing is a "front end" for GusPlay 
by Robert Adolfsson (CASCADA) and the most of the Ultradox code from 
Renaissance.

So there is HALF a zip file in the submit directory.. what can I do 
about it?  I'm perfectly willing to show off via. E-Mail, so if anybody
wants a UUencoded copy of the zipfile I can send it, no problem.

Just ask me nicely :-)

    -- Bjarni

BTW.. the (HALF) zip file is called gp15-pas.zip, in case somebody wants
      to take a peek or delete it or something.
  ______________________________________________   ___________________
 /                                              \ /                   \
( "Shee, you guys are so unhip its a wonder your O Bjarni R. Einarsson )
(  bums don't fall off!" -- Zaphod Beeblebrox    O  - - bre@os.is - -  )
 \______________________________________________/ \___________________/

------------------------------

End of GUS Programmer's Digest V6 #11
*************************************

To post to tomorrow's digest:                    <gus-sdk@dsd.es.com>
To (un)subscribe or get help:            <gus-sdk-request@dsd.es.com>
To contact a human (last resort):          <gus-sdk-owner@dsd.es.com>

FTP sites:           archive.epas.utoronto.ca              /pub/pc/ultrasound
                     wuarchive.wustl.edu            /systems/msdos/ultrasound
                     archive.orst.edu                    /pub/packages/gravis
                     theoris.rz.uni-konstanz.de                /pub/sound/gus
FTP mail server:     mail-server@nike.rz.uni-konstanz.de

Hints:
      - Get the FAQ from the FTP sites or the request server.
      - Mail to <gus-sdk-request@dsd.es.com> for info about other GUS
	related mailing lists (general use, musician's, etc.).



