[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help with some low level access



On Tue, 4 Feb 2003, Ross Vumbaca wrote:
> 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().

You didn't mmap() /dev/mem? You do need to use the mmap() result as _IO_BASE,
not the physical 0xfe000000.

That's what you can do in ioperm().

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds



Reply to: