Mail Archives: djgpp/1997/10/03/14:46:15
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 -