home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / alt / msdos / programm / 3097 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  2.5 KB

  1. Xref: sparky alt.msdos.programmer:3097 comp.os.msdos.programmer:11799 comp.sys.ibm.pc.programmer:737
  2. Path: sparky!uunet!spool.mu.edu!umn.edu!cybrspc!roy
  3. From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail)
  4. Newsgroups: alt.msdos.programmer,comp.os.msdos.programmer,comp.sys.ibm.pc.programmer,comp.la
  5. Subject: Re: Setting up serial ports
  6. Message-ID: <FVoVwB5w165w@cybrspc.UUCP>
  7. Date: Mon, 04 Jan 93 18:36:26 CST
  8. References: <1993Jan04.043635.5841@microsoft.com>
  9. Organization: Villa CyberSpace, Minneapolis, MN
  10. Lines: 40
  11.  
  12. jenk@microsoft.com (Jen Kilmer) writes:
  13.  
  14. > In article <1992Dec30.200952.5153@panther.mot.com> ronf@panther3.panther.mot.
  15. > >Being my first post, I hope this is the appropriate newgroup.
  16. > >
  17. > >I am a Unix/C/Assembler type that finds himself in the position of having to
  18. > >write/port an app. on an IBM PC.  One of the functions needed is to establis
  19. > >carrier on a modem.  My problem?  How do I setup the com?: port using 'C'.
  20. > >Asking the user to use the DOS mode command would be sort of kludgy.
  21. > Well, if you wanted to do what the ms-dos mode command does, it
  22. > does an int 21 to set up the serial port. The int 21 is implemented
  23. > throught the serial port device driver [also a part of msdos unless 
  24. > you've installed a replacement for the default one in io.sys] which
  25. > eventually does a BIOS call. The BIOS then talks to the UART directly.
  26.  
  27. Jen, I really like the delicacy with which you've phrased this.  :-)
  28.  
  29. The best way I have found to handle the com port from C is to use an
  30. interrupt-driven library.  I never, ever use bioscom().
  31.  
  32. > You can of course talk to the UART or the BIOS yourself, and skip msdos
  33. > - particularily if you want to program the chip in a method not provided
  34. > by msdos/BIOS.
  35.  
  36. Or if you want to handle data rates in excess of 1200 baud successfully.
  37. The BIOS routines aren't interrupt-driven, and polling a port is most
  38. difficult when you are capturing and processing high-speed data.  Your
  39. mileage may vary, of course, but it makes sense to me to be prepared for
  40. the worst from the start.  A good library will support you up to 57,600
  41. bps (and perhaps beyond).
  42.  
  43. Granted, this application may need only a few bytes and an asserted DCD
  44. line... but the next one might need to handle a 19,200 modem.  If you
  45. start with a library now, you'll be up to speed with it when the time
  46. comes to increase capability.
  47. --
  48. Roy M. Silvernail --    [my opinions] "You can't be serious!"
  49. roy%cybrspc@cs.umn.edu  [get 'em now]   "Sure, I _can_..."
  50. cybrspc!roy@cs.umn.edu  [send $19.93]        -- me
  51.