delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/15/04:48:15

Date: Wed, 15 Jan 97 09:42:52 GMT
Message-Id: <9701150942.AA14567@leopard.proteon.com>
From: Neil Jarvis <Neil DOT Jarvis AT proteon DOT com>
To: salvador AT natacha DOT inti DOT edu DOT ar
Cc: Neil DOT Jarvis AT proteon DOT com, djgpp AT delorie DOT com, hotpulp AT netidea DOT com
In-Reply-To: <m0vk70u-000S1fC@natacha.inti.edu.ar>
(salvador AT natacha DOT inti DOT edu DOT ar)
Subject: Re: DMA buffer in protected mode
Reply-To: Neil DOT Jarvis AT proteon DOT com
Mime-Version: 1.0 (generated by tm-edit 7.43)

>>>>> "SET" == Salvador Eduardo Tropea (SET) <salvador AT natacha DOT inti DOT edu DOT ar> writes:

    >> The trick about using memory above 1M is getting the physical address
    >> to program the DMA with. If you are interested I have a piece of code
    >> that lets me malloc() the DMA buffer and then work out its the
    >> physical address.

    SET>   You MUST use the DPMI services, because you never know
    SET>   where your program will be loaded so even if you are using
    SET>   a 16 bits DMA channel you can't suppose that part of your
    SET>   program will be loaded in the first 16Mb, so malloc doesn't
    SET>   work.  Or, are you talking about a "malloc" that calls to
    SET>   the DPMI services?

I'm talking about the malloc() provided by the djgpp libc, which in
turn calls sbrk, which in turn calls DPMI. This still doesn't
guarantee that the memory is in the first 16M, but I never said that
my trick didn't have some provisos ... such as disabling virtual
memory, and not installing more that 16M in your machine :-) These
restrictions are actually requirements for other reasons in my system,
so the trick works for me.

-Neil

-- 
***********************************************************************
                              Neil Jarvis
    Proteon International Ltd, R&D, York, UK. Tel: (+44) 1904 693409
                        Neil DOT Jarvis AT proteon DOT com
                   http://tom.proteon.com:8080/~naj/
***********************************************************************
                          Thought of the day:
              Give me ambiguity or give me something else.
***********************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019