Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

outb()

Altera_Forum
Honored Contributor II
1,396 Views

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....
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
550 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
550 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
550 Views

Hello every body, 

 

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

 

Regards
0 Kudos
Altera_Forum
Honored Contributor II
550 Views

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).
0 Kudos
Reply