views:

158

answers:

1

Hi,

I'd like to compile a c programm developed for linux using cc under os x. It includes the header sys/io.h. When compiling I get the error that this file could not be found? Isn't there any sys/io.h header file under os x?

Any help would be really appreciated!

Thanks!

A: 
$ ls /usr/include/sys/io.h
ls: /usr/include/sys/io.h: No such file or directory

It doesn't look like it. You may have to do some porting.

Linux has this header file. It looks like it has to do with low level port input and output.

In general, things in /usr/include/sys are going to be operating-system specific, so you'll have to port to a new architecture if it's not already ported.

WhirlWind
Thanks for your answer!The program makes use of functions like outb(), to write values to certain registers. Is there any equivalent header file for os x providing me such functions?
ioh
I found out that if if I want to use low level io under osx I'll have to have kernel mod priv. in other words I'll have to write a kext?
ioh
It would be my guess that you'll have to write a kext, though it depends on the exact device. OS X provides support for certain devices from userspace.
WhirlWind
well, thanks! I'll do some research about kexts. I heard it shouldn't be that hard.
ioh
If it's a simple device, just create a kext with a userclient, and you should be able to build your code to do the same thing as linux through that userclient.
WhirlWind