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