General Support - inb outb not working with Kanotix 64 live on Intel dual-core RBernatchez - 23.10.2006, 20:55 Uhr Titel: inb outb not working with Kanotix 64 live on Intel dual-core
Unable to get inb/outb to work with Kanotix 64 live, although identical code works properly on Suse 9.3 (32-bit version).
#include <stdio.h>
#include <asm/io.h> // Also tried <sys/io.h>
#include <unistd.h
int main()
{
int dataport = 0x378; // Also tried 0x3bc and 0x278
int success;
unsigned char data;
success = ioperm( dataport, 3, 1 ); //returns '0' for success
outb( 0xaa, dataport );
data = inb( dataport );
// On next line data always equals on 0xff on Kanotix 64 Live, but
// returns 0xaa for port 0x378 on Suse 9.3 (32-bit)
printf("data value read from port 0x%x = 0x%x\n", dataport, data);
}
The above code (test.c) is compiled using the following command:
gcc -O2 -o test test.c
The resulting application is run as root by first running 'su'
slh - 23.10.2006, 21:02 Uhr Titel: RE: inb outb not working with Kanotix 64 live on Intel dual-
No need to post your homework questions everywhere, I deleted your identical posts from the other categories.