[comp.sys.mac] Serial Drivers

han@apple.UUCP (Byron Han, fire fighter) (02/03/88)

With regards to the serial drivers...  it is a VERY good idea to close your
serial driver when you are finished.  In other words, using RAMSDopen and
RAMSDClose are strongly recommended.  It is cheesy to leave the drivers open
when your application terminates.  Using the ROM driver does not allow you
to close it without causing people to become sad  :-(

So,  1 - try and use the RAM based drivers
     2 - try not to directly open driver's by refnum (-6, -7, -8, -9)
          use their name if at all possible (.Ain, .Aout, .Bin, .Bout)
     3 - always always always close the RAM based serial driver when
           quitting your application.  There is a means to insure that
           DTR stays high when closing the serial driver.  Documented in
           IM IV.
-- 
------------------------ Byron Han,  Communications Tool ----------------------
     Apple Computer, Inc.  20525 Mariani Ave, MS 27Y  Cupertino, CA 95014
 ATTnet:408-973-6450    applelink:HAN1    domain:han@apple.COM     MacNET:HAN
GENIE:BYRONHAN   COMPUSERVE:72167,1664   UUCP:{sun,voder,nsc,decwrl}!apple!han

atchison@hpindda.HP.COM (Lee Atchison) (02/04/88)

Question:

Why would anyone want to use the ROM serial driver over the RAM serial driver?

Where is the RAM serial driver located?  In the System file?

Is the RAM serial driver included with all Systems?

I'm writing a program that needs to read and write to the serial port.  I want
it to work on a variety of different macs.  Is it wrong for me to assume that
the RAM serial driver will always exist on a system?

Thanks in Advance.

			-lee

----
Lee Atchison
Hewlett Packard, Information Networks Division
atchison%hpindda@hplabs.hp.com

han@apple.UUCP (Byron Han, fire fighter) (02/05/88)

article <6500012@hpindda.HP.COM> atchison@hpindda.HP.COM (Lee Atchison) writes:
>Question:
>Why would anyone want to use the ROM serial driver over the RAM serial driver?

There really is no reason to use the ROM driver.  Originally, space was
tight on the 128K Macintoshes and every byte counted.  These days, space
is not so critical. 

>Where is the RAM serial driver located?  In the System file?

either in the System or in the ROM.  I don't know.  It shouldn't matter.

>Is the RAM serial driver included with all Systems?
>
>I'm writing a program that needs to read and write to the serial port.  I want
>it to work on a variety of different macs.  Is it wrong for me to assume that
>the RAM serial driver will always exist on a system?

References  - Inside Macintosh Volume II, IV

For the Macintosh 128, 512, XL:
    there is a version of the RAM based serial driver in resource SERD, id 1
        for the 128/512, id 2 for the XL

For the Macintosh 512e, Plus, SE, II:
    there is a single new serial driver that replaces the old RAM/ROM serial
        drivers.  "For best results, include the RAM serial drivers as 
        resources of type 'SERD' in the resource fork of your application
        and continue to use RAMSDOpen and RAMSClose.  If the 128K ROM
        (or later) is present, the new driver is automatically included.

Sooooo, if the target machine is 128K ROM or later (see technote 129 to
find out how to determine this), you can assume that using RAMSDOpen and
RAMSDClose will work.  If the target machine is 128/512/XL, then including
the SERD resources will guarantee that RAMSDOpen/RAMSDClose will work.

PLEASE try to use the RAMSDOpen/RAMSDClose calls.  
ALSO ALWAYS ALWAYS ALWAYS call RAMSClose when terminating.  

Cleanliness is always appreciated by the Apple Thought Police :-)
-- 
------------------------ Byron Han,  Communications Tool ----------------------
     Apple Computer, Inc.  20525 Mariani Ave, MS 27Y  Cupertino, CA 95014
 ATTnet:408-973-6450    applelink:HAN1    domain:han@apple.COM     MacNET:HAN
GENIE:BYRONHAN   COMPUSERVE:72167,1664   UUCP:{sun,voder,nsc,decwrl}!apple!han

palarson@watdragon.waterloo.edu (Paul Larson) (02/06/88)

I recieved the RAM serial drivers with my Lightspeed Pascal
package.  They are resources of type SERD.  It's probably best
to include the serial drivers in the resource fork of any application
which may need them.

	Johan Larson

atchison@hpindda.HP.COM (Lee Atchison) (02/09/88)

Could somebody please send me a copy of the RAM Serial Driver?  I've looked
all over and I can't seem to find a copy.  It's not in any of my system
files, and it wasn't included with my compiler (I've got Turbo Pascal 1.0).

Is the RAM driver freely distributable?  Or are there limitations?  Ie. if I
write a commercial (or shareware) program that requires the RAM serial
driver, can I distribute it with my program?

BTW, I discovered that I didn't have the RAM driver when I tried to do a
RAMSDOpen (or whatever that routine is called) and got an error -192 (which
I couldn't find documented anywhere).  I'm assuming that this error means
the driver isn't installed, is this correct?  Or does this error mean that
something else is wrong?

Thanks for the help.

			-lee

ps.  Please send me a message before you send my the driver, so I don't
get flooded with copies.

----
Lee Atchison
Hewlett Packard, Information Networks Division
atchison%hpindda@hplabs.hp.com