lkml.org 
[lkml]   [2001]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectDos2Linux
How do I translate the following piece of DOS-code to linux?

static union {
unsigned int *a; // One 32 bits address
unsigned long l; // One 32 bits long
unsigned int w[2]; // Two 16 bits words
unsigned char b[4]; // Four 8 bits bytes
} DMAaddr;

static union {
signed int w; // One 16 bits words
signed char b[2]; // Two 8 bits bytes
} DMAcntr;

...

static void setadr( unsigned int far *buff, unsigned int length )
{
unsigned int lw;

lw = FP_SEG( buff ); // Segment address of buffer
DMAaddr.w[1] = ( lw >> 12 ) & 0xf; // Makes real 32bit address
DMAaddr.w[0] = ( lw << 4 ) & 0xfff0;
DMAaddr.l += ( unsigned long )FP_OFF( buff );
DMAcntr.w = length;
}


Thanks,
mc303

--
Ing. Bart Vandewoestyne Bart.Vandewoestyne@pandora.be
Hugo Verrieststraat 48 GSM: +32 (0)478 397 697
B-8550 Zwevegem http://users.pandora.be/vandewoestyne
----------------------------------------------------------------------
"Any fool can know, the point is to understand." - Albert Einstein
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:02    [W:0.038 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site