assembler -> linux system calls

From: Bart Vandewoestyne (Bart.Vandewoestyne@pandora.be)
Date: Thu Aug 23 2001 - 15:56:41 EST


I am trying to write a linux device driver for a data acquisition
card. The little homepage for my project is at
http://mc303.ulyssis.org/heim/
There is already a DOS driver available, and I am trying to port the
DOS code right now.

Somewhere in the DOS code, there is some assembler code included:

.RADIX 16
.MODEL SMALL

.486

.CODE

      PUBLIC _inpl

_inpl PROC FAR

      push bp
      mov bp,sp

      mov dx, Word Ptr [bp+6]
      in EAX,dx

; bswap EAX

      push EAX
      pop ax
      pop dx

      mov sp,bp
      pop bp
      ret
_inpl ENDP

      PUBLIC _inplI

_inplI PROC FAR

      push bp
      mov bp,sp

      mov dx, Word Ptr [bp+6]
      in EAX,dx

      push EAX
      pop ax
      pop dx

      mov sp,bp
      pop bp
      ret
_inplI ENDP

      PUBLIC _swem

_swem PROC FAR

      push bp
      mov bp,sp

      mov EAX, DWord Ptr [bp+6]

      bswap EAX

      push EAX
      pop ax
      pop dx

      mov sp,bp
      pop bp
      ret
_swem ENDP

      PUBLIC _outpl

_outpl PROC FAR

      push bp
      mov bp,sp

      mov dx, Word Ptr [bp+0ah]
      mov ax, Word Ptr [bp+8]
      push ax
      push dx
      pop EAX
      mov dx, Word Ptr [bp+6]
      out dx,EAX

      mov sp,bp
      pop bp
      ret
_outpl ENDP

      PUBLIC _outplI

_outplI PROC FAR

      push bp
      mov bp,sp

      mov dx, Word Ptr [bp+8]
      mov ax, Word Ptr [bp+0ah]
      push ax
      push dx
      pop EAX
      mov dx, Word Ptr [bp+6]
      out dx,EAX

      mov sp,bp
      pop bp
      ret
_outplI ENDP

      END

I would like to know by what linux native system calls I can replace
the commands inpl, inplI, outpl, outplI, swem. I guess the following
mapping should do it:

DOS assembler -> Linux

inpl inpl
inplI ???
outpl outpl
outplI ???
swem ???

Could somebody tell me what function to use where the question marks
are written? Are the other mappings from inpl and outpl also correct?

Thanks for helping me out,
mc303

PS: The DOS code is also at http://mc303.ulyssis.org/heim

-- 
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/



This archive was generated by hypermail 2b29 : Thu Aug 23 2001 - 21:01:02 EST