Dos2Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm having the following DOS-code that I want to port 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 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;
}

How do i translate this?  Can I just leave the 'far' out?  And how do
I replace the FP_SEG and FP_OFF things?

Greetzzz,
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
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux