Dos2Linux

Bart Vandewoestyne (Bart.Vandewoestyne@pandora.be)
Tue, 04 Sep 2001 11:02:30 +0200


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/