You are here:

C/inportb() and outportb()

Advertisement


Question
Hi Mr Premnath, I need a favour from you, I was actually using these functions inportb() and outportb() in DOS as dos.h, now i want to run these functions in unix, what would be the header file for these functions. Thanks in advance....
Regards
Azeem

Answer
Hai dear Azeem !

   The function's what you have mentioned ( inportb() outportb() ) are not standard C library functions and more over this is an exclusive property of Turbo C/C++ you cannot expect these functions on other compilers and over other platform ,the scenario is same for dos.h as well.
  
   In UNIX gcc environment all the port access are similar to the file access, say if you need to access the LPT1 port then this can be made possible just like the common file opening fp = fopen("/dev/lp1" , "r"); and all other read / write operations can be done in the same way how you used to deal with the common text / data files, GCC doesn't have a function support that exclusively deals with the ports

I hope this answer would help you out, to proceed further , revert me in case  issue


Thanks and Regards
Prince M. Premnath  

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.