home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / mswindo / programm / misc / 1329 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  2.6 KB

  1. Path: sparky!uunet!mcsun!uknet!axion!apricot!marcusj
  2. From: marcusj@apricot.co.uk (Marcus Jenkins)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: DMA in Windows
  5. Message-ID: <1992Aug14.080353.25550@apricot.co.uk>
  6. Date: 14 Aug 92 08:03:53 GMT
  7. References: <1992Aug13.125330.9899@wuecl.wustl.edu>
  8. Organization: Apricot Computers Limited
  9. Lines: 45
  10.  
  11. wilcox@swarm.wustl.edu (Don Wilcox) writes:
  12.  
  13. >First, what would be a good doc on the PC's DMA interface in general, and any
  14. >limitations on that interface in Windows?
  15.  
  16. IBM PC tech. ref. + Intel's DMA controller data book.
  17.  
  18. >Second, the source code that I have (for DOS) wants the input buffer to be
  19. >aligned on a 256K boundary.  Any ideas why?
  20.  
  21. Yes and no.  If, on an AT (as opposed to MCA), you try and DMA over a 128k
  22. boundary (i.e. physical address of 20000h, 40000h etc.) the DMA controller
  23. will wrap around to the bottom of that 128k (i.e. physical address of 0h, 
  24. 20000h correspondingly).  A 256k limitation would obey this rule.
  25.  
  26. >I have a DOS app that interfaces with the board, and when it is run from DOS,
  27. >it works just fine.  When I run it in a window in Windows, the acquisition is
  28. >garbled.  I've tried munging with PIF file settings, but I cannot seem to get
  29. >a combination that works.  2 questions here:  since the DOS app is running in
  30. >a VM (this is enhanced mode Windows), could the DMA buffer be mis-aligned and
  31. >this cause the problem; and second, any ideas on PIF settings?
  32.  
  33. Part of the problem might be that the DMA controller is virtualised in
  34. Enhanced Mode.  You could write your own VxD to handle the DMA controller
  35. (i.e. do no tricky virtualisation on *your* DMA channel, but do the
  36. normal virtualisation for the reset e.g. the floppy's).
  37. The DDK, I believe, has an example VxD for the DMA controller.
  38.  
  39. When programming the DMA controller, you are *always* dealing with
  40. physical memory addresses (i.e. what you get from 16*segment+offset).
  41. This still applies in Windows, so you will have to get your selector:
  42. offset addresses mapped to segment:offset addresses before getting
  43. any sense out of the DMA controller.  I guess that your buffer *must*
  44. be in un-swappable, un-moveable memory, too.
  45.  
  46. Hope this helps a little bit.
  47.  
  48.  _ _ _
  49. ' ) ) )                         Internet: marcusj@apricot.co.uk
  50.  / / / __.  __  _. . . _        UUCP: marcusj@apricot.uucp
  51. / ' (_(_/|_/ (_(__(_/_/_)_      If all else fails from US, try:  
  52. Marcus Jenkins                  apricot!marcusj@relay.EU.net
  53. Tel: +44 21 472 3002  Fax: +44 21 471 2935
  54. Disclaimer:  Anything I wrote above is, of course, my own view and
  55.              does not in any way represent my employer.
  56.