2001-07-03 14:45:50

by Guillaume Lancelin

[permalink] [raw]
Subject: Memory access

Writing a device driver for a IO card, I have the following message from
the kernel:
Unable to handle kernel paging request at virtual address 000d0804.
[then it gives the register values]
Segmentation fault."

This address (0xd0804) is the location of a "mailbox" reserved by the IO
card, and from which commands are passed to the card.

My question: is the kernel using or protecting this area of the memory,
and is there a way to deprotect it??? (how dangerous!)

Thanks
Guillaume



_______________________________________________________________
Do You Yahoo!?
Yahoo! Messenger: Comunicaci?n instant?nea gratis con tu gente -
http://messenger.yahoo.es


2001-07-03 14:52:00

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: Memory access

Em Tue, Jul 03, 2001 at 04:45:32PM +0200, Guillaume Lancelin escreveu:
> Writing a device driver for a IO card, I have the following message from
> the kernel:
> Unable to handle kernel paging request at virtual address 000d0804.
> [then it gives the register values]
> Segmentation fault."
>
> This address (0xd0804) is the location of a "mailbox" reserved by the IO
> card, and from which commands are passed to the card.
>
> My question: is the kernel using or protecting this area of the memory,
> and is there a way to deprotect it??? (how dangerous!)

are you accessing it directly? read Documentation/IO-mapping.txt

- Arnaldo

2001-07-03 14:54:30

by Brian Gerst

[permalink] [raw]
Subject: Re: Memory access

Guillaume Lancelin wrote:
>
> Writing a device driver for a IO card, I have the following message from
> the kernel:
> Unable to handle kernel paging request at virtual address 000d0804.
> [then it gives the register values]
> Segmentation fault."
>
> This address (0xd0804) is the location of a "mailbox" reserved by the IO
> card, and from which commands are passed to the card.
>
> My question: is the kernel using or protecting this area of the memory,
> and is there a way to deprotect it??? (how dangerous!)

Use ioremap()

--

Brian Gerst

2001-07-03 14:57:53

by Richard B. Johnson

[permalink] [raw]
Subject: Re: Memory access

On Tue, 3 Jul 2001, [iso-8859-1] Guillaume Lancelin wrote:

> Writing a device driver for a IO card, I have the following message from
> the kernel:
> Unable to handle kernel paging request at virtual address 000d0804.
> [then it gives the register values]
> Segmentation fault."
>
> This address (0xd0804) is the location of a "mailbox" reserved by the IO
> card, and from which commands are passed to the card.
>
> My question: is the kernel using or protecting this area of the memory,
> and is there a way to deprotect it??? (how dangerous!)
>

This is not the correct address!! The addresses in the kernel are
virtual addresses, you need to execute ioremap(0xd0804, LENGTH) to
get the correct virtual address for access.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

I was going to compile a list of innovations that could be
attributed to Microsoft. Once I realized that Ctrl-Alt-Del
was handled in the BIOS, I found that there aren't any.


2001-07-03 14:57:10

by Eli Carter

[permalink] [raw]
Subject: Re: Memory access

Guillaume Lancelin wrote:
>
> Writing a device driver for a IO card, I have the following message from
> the kernel:
> Unable to handle kernel paging request at virtual address 000d0804.
> [then it gives the register values]
> Segmentation fault."
>
> This address (0xd0804) is the location of a "mailbox" reserved by the IO
> card, and from which commands are passed to the card.
>
> My question: is the kernel using or protecting this area of the memory,
> and is there a way to deprotect it??? (how dangerous!)

Sounds like you may want to look into ioremap() and maybe buy Linux
Device Drivers by Rubini (O'Reilly).

Have fun!

Eli
-----------------------. No wonder we didn't get this right first time
Eli Carter | through. It's not really all that horribly
eli.carter(at)inet.com `- complicated, but the _details_ kill you. Linus

2001-07-03 15:36:57

by Alan

[permalink] [raw]
Subject: Re: Memory access

> My question: is the kernel using or protecting this area of the memory,
> and is there a way to deprotect it??? (how dangerous!)

The kernel maps ISA space at different addresses. What address and how it is
accessed depends on the CPU and system

isa_readb/readw/readl(addr)
isa/writeb/writew/writel(value,addr)

to read/write 8,16,32 bit values