Mail Archives: djgpp/2017/08/18/07:00:12

X-Authentication-Warning: mail set sender to djgpp-bounces using -f
X-Received: by with SMTP id q63mr5898906pga.83.1503053450434;
Fri, 18 Aug 2017 03:50:50 -0700 (PDT)
X-Received: by with SMTP id b187mr78832vke.14.1503053450328;
Fri, 18 Aug 2017 03:50:50 -0700 (PDT)
Newsgroups: comp.os.msdos.djgpp
Date: Fri, 18 Aug 2017 03:50:50 -0700 (PDT)
Complaints-To: groups-abuse AT google DOT com
Injection-Info:; posting-host=; posting-account=Q0wMHAoAAADjYrghh94FTf6YnbpTqZgp
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <>
Subject: Can I use transferbuffer temporarly a for short DMA transfer?
From: "RayeR (glaux AT centrum DOT cz) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Injection-Date: Fri, 18 Aug 2017 10:50:50 +0000
Bytes: 1917
Lines: 9
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I need to do one IDE busmaster DMA tranfer. For this purpose I need a 512+8B buffer in physical memory - I have to fill bussmaster PDRT IO register with physical address of buffer where I put PDR entry and data. 
So it seems to me the easiest way is to use __tb, where I can copy my structures and data via dosmemput and then start DMA transfer by writting to IO registers.
But I don't know how long my data in transferbuffer? Is it shared for some DJGPP functions like if I do a printf or anything calling a DOS it may get overwritten?
Or should I rather allocate dos memory block separately?

The DMA buffer must fulfil 2 conditions: 
1) phys. address must be word aligned - probably OK, AFAIK dosmem is allocated in paragraphs
2) buffer cannot cross over 64kB boudary, e.g. FFF0h + size 512B is wrong, FE00h + size 512B is OK.
Should I care about 2nd condition myself?

- Raw text -

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