delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/03/14:46:15

From: "D. Jeff Dionne" <jeff AT maribor DOT pfnet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: BEGINNER -address of arrays etc - Help
Date: Thu, 02 Oct 1997 16:15:51 -0400
Organization: DKG / Dionne & Associates
Lines: 42
Message-ID: <343400F7.2A672850@maribor.pfnet.com>
References: <EHFIz7 DOT 4DH AT cix DOT compulink DOT co DOT uk>
NNTP-Posting-Host: 207.219.73.2
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Peter Scargill wrote:
> 
> This is my second attempt at putting this message in. What hope do I 
> have
> of solving a C problem if I can't even send mail properly :-))
> 
> Ok, DOS program ising DJGPP. This came with the BT848 graphic chip
> development test software.

Ahhh.  I'd be interested in whatever examples came with that test
software :-)  You might also look at the Linux driver for Brooktree
(bt848) capture cards http://www.thp.Uni-Koeln.DE/~rjkm/linux/bttv.html

> 
> Actually I used (unsigned int)&my_array[0]. The compiler took it 
> but the
> thing goes for a walk so it is obviously writing somewhere it 
> should not.

That will give you the virtual address of your array (note that if
you really must put the address in something other than a pointer,
it's best to use a long, then it will also work on 64 bit machines
like Alpha if you decide to port).  In order for the bt848 to write
it's stuff to your capture buffer, you need to give it the physical
address, not the virtual one.  Linux and DJGPP handle the conversion
differently, so you'll need to read the DJGPP docs to figure out how
to convert that pointer to your array.  You might also be interested to
know that on some machines other than Intel based PeeCee's, you'll find
that the _bus_ address requires yet another traslation, so linux has
sets of functions for virt_to_phys() virt_to_bus() and so on.  In this
case, you'd be looking for the bus address, since it's a direct transfer
from one device on the bus to another (which is the same as the physical
address on an Intel PC).  DJGPP will I immagine have simmilar conversion
functions (or perhaps someone has make some compatible routines).

Cheers,
Jeff.

> 
> Remember I've never used a 32 bit compiler before. Seems like a 
> valid 32
> bit address would be sent but obviously not. Comments anyone?

- Raw text -


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