Hi,

Geert Uytterhoeven wrote:

O.k the inb and outb is fine now, but I get this weird (link) problem:

/sio.c:46: undefined reference to `local symbols in discarded section .fixup' /sio.c:46: undefined reference to `local symbols in discarded section .fixup' /sio.c:46: undefined reference to `local symbols in discarded section .fixup' /sio.c:46: undefined reference to `local symbols in discarded section .fixup' /sio.c:47: undefined reference to `local symbols in discarded section .fixup' /tmp/ccq1O4nL.o:/sio.c:48: more undefined references to `local symbols in discarded section .fixup' follow

(Similar story with my program:)


Alternatively, define your own inb() and friends, based on the definitions in
<asm/io.h>.

O.k, by simply copying the inb() definition from asm/io.h and putting it in my program, like so:

#include <stdio.h>
#define __KERNEL__
#include <asm/io.h>

#define _IO_BASE        isa_io_base
#define inb(port)       in_8((u8 *)((port)+_IO_BASE))

unsigned long isa_io_base = 0xfe000000;

int main() {
//      ioperm(0x00, 0xff, 1);
        printf ("Status register: %x\n", inb(0x08));
        return 0;
}

it will build! (It's beyond my knowledge why that has made a difference). I get a segafault of course, since I am running in user space, but at least it is appears to be making progress. Thanks for the help.

Now just need to try and get ioperm().

Regards,

Ross..


Reply via email to