Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

outb()

Hello,

Can anyone help me with this simple issue?

how to compile such simple test:

# include <sys/io.h>

int main(void)

{

ioperm(0x340,0x342,1);

outb(0x340,0x0);

exit(0);

}

there are no outb() function declared in headers....

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello,

    outb/ioperm, etc. have no meaning in uCLinux, since it&#39;s designed specifically for MMUless processors.

    I believe that the IORD/IOWR macros will work, just fine, for you. They can be found @:

    # include <io.h>

    Cheers,

    - slacker
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello slacker,

    I&#39;d like to know if there is a tutorial where I can find the syntax of macros such as IORD or IOWR. If there aren&#39;t any, how can you rewrite aj_&#39;s small program?

    thanks.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello every body,

    I&#39;m sure that someone has already cope with these kind of programs...

    Regards
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It is indeed possible to use outb() and similar in userspace by including <asm/io.h>, or at least it should be.

    As far as I remember all the code in asm/io.h is inside# ifdef __KERNEL__, so you have to do some adjustments to this file to be able to access the IO-functions from userspace (refer to f.ex i386).