I am working on writing my device driver code. This time I write code for my DB-25 parallel port, but for this I have to use
Code:
sys/io.h
header file. As per my compiler error, its not found in directory. For this, I download the header file and insert in the directory. But still error found.
What now I have to do? Is there any other header file for low level port input output ???
Do you understand to which directory #include <sys/xxx> refers? It's the compiler's include/sys directory, not the application dir. Apparently your compiler isn't a regular PC or embedded compiler, otherwise io.sys would be already in place. You can of course change the #include statement to any place where io.sys can be found, e.g. "io.sys" for the application dir. But makes the content of io.sys sense for this compiler?
Do you understand to which directory #include <sys/xxx> refers? It's the compiler's include/sys directory, not the application dir. Apparently your compiler isn't a regular PC or embedded compiler, otherwise io.sys would be already in place. You can of course change the #include statement to any place where io.sys can be found, e.g. "io.sys" for the application dir. But makes the content of io.sys sense for this compiler?
io.h has the definition of low-level runtime functions, some compilers have it in the general include directory <io.h>, some have it under <sys/io.h>. It's ususally referencing other include files. Copying io.h from a different compiler doesn't necessarily work, instead you should find out how the respective functions are provided by your compiler, if it has io.h and where it is located. It may be necessary to modify also the code itself, write wrapper functions or at least some #defines.
This are necesary steps when porting C code between different computer platforms or compilers.