Author Topic: Linux->Nasm->Flush ports  (Read 8755 times)

Offline yousafsajjad

  • Jr. Member
  • *
  • Posts: 5
Linux->Nasm->Flush ports
« on: July 09, 2010, 09:07:35 PM »
Hi,

I am using the following code to flush port:

 in      al, 081h
 out     081h, al     

but it is giving me segmentation fault. Does anyone how I can do it.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Linux->Nasm->Flush ports
« Reply #1 on: July 09, 2010, 09:45:23 PM »
Try sys_ioperm (101?) first. You'll need root permissions to do this. To give your program root permissions, without the "user" having to be root... As root:

Code: [Select]
chown root:root myprog
chmod +s myprog

I'm not sure what your proposed code is going to do for you, but I think you'll be able to do it without segfault if you do sys_ioperm first...

Best,
Frank


Offline yousafsajjad

  • Jr. Member
  • *
  • Posts: 5
Re: Linux->Nasm->Flush ports
« Reply #2 on: July 12, 2010, 02:41:40 PM »
you are very right. Thanks for your help.