linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Verify system io addresses
@ 2005-01-28 17:10 Jeff.Fellin
  2005-01-28 19:14 ` linux-os
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff.Fellin @ 2005-01-28 17:10 UTC (permalink / raw)
  To: linux-kernel

I want to develop a device driver that would allow access to board
registers and memory that is addressable
on the system bus.  The reason for this is to allow hardware developers to
access board registers while the system
is running to determine what is wrong with a board. The problem I'm having
is attempting to determine if an address
is addressable and would not cause a system panic when accessing. I'm
looking for functions similar to the
verify_access for user addresses, or if that is not available a method to
determine that an address fault in the
kernel is actually due to a bad board address being used.

The driver has a user program that allows the hardware developers to peek
and poke at address locations.
So it is possible for them to mistype the address.

Thank you in advance for your help.

Jeff Fellin
RFL Electronics
Jeff.Fellin@rflelect.com
973 334-3100, x 327


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Verify system io addresses
  2005-01-28 17:10 Verify system io addresses Jeff.Fellin
@ 2005-01-28 19:14 ` linux-os
  0 siblings, 0 replies; 2+ messages in thread
From: linux-os @ 2005-01-28 19:14 UTC (permalink / raw)
  To: Jeff.Fellin; +Cc: Linux kernel

On Fri, 28 Jan 2005 Jeff.Fellin@rflelect.com wrote:

> I want to develop a device driver that would allow access to board
> registers and memory that is addressable
> on the system bus.  The reason for this is to allow hardware developers to
> access board registers while the system
> is running to determine what is wrong with a board. The problem I'm having
> is attempting to determine if an address
> is addressable and would not cause a system panic when accessing. I'm
> looking for functions similar to the

>From within the kernel, on Intel machines, all addresses that are
mapped (using ioremap_nocache()) are addressable even if there is
no hardware at that address. It cannot cause a system panic. A
read from non-existent hardware will simply return a value with
all bits set (0xffffffff for a size_t). A write will go to
hyper-space, doing nothing.

> verify_access for user addresses, or if that is not available a method to
> determine that an address fault in the
> kernel is actually due to a bad board address being used.
>

There will be no such faults. You to use ioremap_nocache() first.
Remember to iounmap() when you are through.

> The driver has a user program that allows the hardware developers to peek
> and poke at address locations.
> So it is possible for them to mistype the address.
>
> Thank you in advance for your help.
>

If the access is through a port (in and out instructions), you
don't have to do anything, ports are always available in kernel
space.


BBBBUUUTTT!  If you write to somebody else's address-space like
a hard-disk controller, you can destroy all your data requiring
a complete re-installation of everything. That's why what you
want to do is NOT what you should do.

You need to have a competent programmer make a driver and
its attendant test-program to thoroughly test your board(s)
with no possibility of somebody entering wrong information.

> Jeff Fellin
> RFL Electronics
> Jeff.Fellin@rflelect.com
> 973 334-3100, x 327

Cheers,
Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
                  98.36% of all statistics are fiction.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-28 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-28 17:10 Verify system io addresses Jeff.Fellin
2005-01-28 19:14 ` linux-os

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).