Jump to content

[Edit] Finding an equivalent to the "iopl" function [/Edit]


kossi
 Share

6 posts in this topic

Recommended Posts

Edit: Things have changed ... See second post :blink:

 

 

Hi!

 

I'm working on a port of a command line tool which turns on the radio switch on my wlan card. It compiles and runs under linux without any issues.

 

First time I tried to compile the source (under mac os x in xcode) I got the errors about missing functions called "inb", "outb" and "iopl".

So I tried to put headers from mac os x to my sourcecode to compile correctly. With adding "protos.h" the "inb", "outb" errors where gone.

 

To solve the "iopl" issue I wanted to add the "IOService.h" header file which I found in the Kernel.framework.

So I looked at the apple homepage to see how adding a framework to the project works.

 

After adding the Kernel.framework to my project and putting "#include <Kernel/IOService.h>" to the sourcecode xcode claimed that he couldn't find the header file.

So I changed the line into "#include <Kernel/IOKit/IOService.h> and xcode found the header but claimed then, that he couldn't find hundreds of other header files.

 

I don't know how to solve this problem so I wanted to ask if anyone of you could help me with this.

 

I added the sourcecode to my post, so you can have a look at it.

 

 

Many thanks in advance! :blink:

 

Best regards

 

kossi

Link to comment
Share on other sites

Things changed a bit... I found out adding "IOService.h" was a bad idea... It doesn't provide the "iopl" function.

The actual sourcecode compiles but if you try to use it, it gives you an error message about missing symbol "_iopl" ...

 

So my problem atm is, that I don't know how to find an equivalent to the "iopl" function.

 

I added the actual source to my post again.

 

 

help :hysterical:

 

kossi

 

Link to comment
Share on other sites

I am leaving for class, so I cannot look at your source code just yet (I will later), but have you tried to add the kernel.framework to your project? YOu not only want to include the appropriate header files, but also want to add the entire framework. You can do this by right clicking your project on the left hand side of the project window and selecting add existing frameworks...

 

The frameworks are in /Library/Frameworks (im pretty sure anyway, you should find them easily)

 

Try that and see if it helps. if not, I will be looking at your source a little later today.

Link to comment
Share on other sites

@ Rammjet:

 

I changed "iopl" to "i386_iopl" but still no luck... "sysarch.h" seems to be missing in Mac OS X.

 

But thanks for the tip :)

 

@ SaberSHO:

 

I added the Kernel.Framework to my project but the problem was, that when I started to compile, the headers called by the header file in my sourcecode (in this case it was "IOService.h") were not found.

 

But the "IOService.h" didn't provide the missed function so it's not used anymore in the code.

 

It would be great if you could have a look at the sourcecode :)

 

Thanks in advance :)

Link to comment
Share on other sites

Some strange behavior here:

 

localhost:~/fsaa1655g kossi$ gcc main.c -o test
In file included from main.c:3:
/System/Library/Frameworks/Kernel.framework/Headers/IOKit/IOLib.h:37:26: error: IOKit/system.h: No such file or directory
/System/Library/Frameworks/Kernel.framework/Headers/IOKit/IOLib.h:41:27: error: IOKit/IOLocks.h: No such file or directory
/System/Library/Frameworks/Kernel.framework/Headers/IOKit/IOLib.h:47:30: error: kern/thread_call.h: No such file or directory
/System/Library/Frameworks/Kernel.framework/Headers/IOKit/IOLib.h:48:24: error: kern/clock.h: No such file or directory

 

What am I doing wrong? I included IOLib.h like this:

 #include <Kernel/IOKit/IOLib.h>

 

It's kinda weird ...

 

Btw the files really exist. They are located in the same directory as "IOLib.h".

 

kossi

Link to comment
Share on other sites

 Share

×
×
  • Create New...