NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: yousafsajjad on July 09, 2010, 09:07:35 PM

Title: Linux->Nasm->Flush ports
Post by: yousafsajjad 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.
Title: Re: Linux->Nasm->Flush ports
Post by: Frank Kotler 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

Title: Re: Linux->Nasm->Flush ports
Post by: yousafsajjad on July 12, 2010, 02:41:40 PM
you are very right. Thanks for your help.