View Full Version : Linux->Nasm->Flush ports
July 9th, 2010, 10:10 PM
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.
July 10th, 2010, 12:18 AM
If you're doing this from inside a Linux User-level application you will cause an exception/fault. Linux is a protected O.S. which means you cannot access hardware directly from a User-level application. Your code does not have the necessary permissions.
If you want to access hardware your application must call a driver (System-level code).
July 10th, 2010, 05:23 AM
yeah you are right .. i am calling an assembly function from C. So I need to get permission to that port using ioperm() first and than it works.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.