public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Vandewoestyne <Bart.Vandewoestyne@pandora.be>
To: linux-kernel@vger.kernel.org
Subject: assembler -> linux system calls
Date: Thu, 23 Aug 2001 22:56:41 +0200	[thread overview]
Message-ID: <3B856E09.EAAE6564@pandora.be> (raw)

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

             reply	other threads:[~2001-08-23 20:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-23 20:56 Bart Vandewoestyne [this message]
2001-08-23 21:10 ` assembler -> linux system calls Richard B. Johnson
2001-08-23 21:30   ` Bart Vandewoestyne
2001-08-23 23:36 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B856E09.EAAE6564@pandora.be \
    --to=bart.vandewoestyne@pandora.be \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox