linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Kotler <fbkotler@comcast.net>
To: joy_mm@ieee.org
Cc: linux-assembly@vger.kernel.org
Subject: Re: Segfault on ioperm
Date: Thu, 20 Jan 2005 13:40:18 -0500	[thread overview]
Message-ID: <41EFFB12.64D2C558@comcast.net> (raw)
In-Reply-To: 4b0d6e0d0501200552126d8cbb@mail.gmail.com

joy merwin monteiro wrote:
> 
> Hi,
> 
> I had been here before, I can't figure out why the code isnt working.

Seems like everybody's got a different idea what's wrong...
I might as well throw in my wild guess, too :)

> global _start
> 
> port equ 378h
> stat equ port+1
> ctrl equ port+2
> 
> section .text
> _start:
> 
>     mov eax,101
>     mov ebx,port
>     mov ecx,3

This is the number of ports you're enabling, right?

>     mov edx,port

And this should be the "turn-on" value... I imagine you want
"3" here, too, for "in" and "out" permissions...

>     int 80h

Check the returned value here, as Richard says, if signed,
bail out.

>     mov dx,port
>     mov al,0xff
>     out 378h,al  <----- segfault here

"out dx, al", as Jan suggests...

>     mov eax,1
>     int 0x80
> 
> Any help/ pointers?

Odd that it should work on a different distro... If you
suspect ld, grab newer binutils... Different permissions
setup would be more likely, I would think... But check that
return value - it should tell the tale. (assume you know
that -ERRNO is in eax, not -1 and ERRNO in errno, as man 2
says...)

Best,
Frank

  parent reply	other threads:[~2005-01-20 18:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-20 13:52 Segfault on ioperm joy merwin monteiro
2005-01-20 14:58 ` Richard Cooper
2005-01-20 15:26 ` Jan Wagemakers
2005-01-20 18:15   ` joy merwin monteiro
2005-01-20 18:40 ` Frank Kotler [this message]
2005-01-21 12:43   ` joy merwin monteiro
2005-01-21 14:29     ` Frank Kotler
2005-01-23  8:35       ` Jan Wagemakers
2005-01-23  8:17     ` Jan Wagemakers
2005-01-24  3:28       ` joy merwin monteiro

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=41EFFB12.64D2C558@comcast.net \
    --to=fbkotler@comcast.net \
    --cc=joy_mm@ieee.org \
    --cc=linux-assembly@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;
as well as URLs for NNTP newsgroup(s).