Autor |
Nachricht |
|
Titel: inb outb not working with Kanotix 64 live on Intel dual-core
Verfasst am: 23.10.2006, 20:55 Uhr
|
|
Anmeldung: 23. Okt 2006
Beiträge: 1
|
|
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' |
|
|
|
|
 |
|
Titel: RE: inb outb not working with Kanotix 64 live on Intel dual-
Verfasst am: 23.10.2006, 21:02 Uhr
|
|
Anmeldung: 16. Aug 2004
Beiträge: 1905
|
|
No need to post your homework questions everywhere, I deleted your identical posts from the other categories. |
|
|
|
|
 |
|
|
|