kdb
[Top] [All Lists]

Re: kdb questions

To: kaos@xxxxxxxxxxxxxxxxx (Keith Owens)
Subject: Re: kdb questions
From: Scott Lurndal <slurn@xxxxxxxxxxx>
Date: Wed, 12 Jul 2000 18:09:28 -0700 (PDT)
Cc: randy.dunlap@xxxxxxxxx (Dunlap Randy), kdb@xxxxxxxxxxx
In-reply-to: <1015.963445902@xxxxxxxxxxxxxxxxxxxxxx> from "Keith Owens" at Jul 13, 2000 09:51:42 AM
Sender: owner-kdb@xxxxxxxxxxx
> 
> On Wed, 12 Jul 2000 16:44:43 -0700, 
> "Dunlap, Randy" <randy.dunlap@xxxxxxxxx> wrote:
> >With kdb (i386), are there ways to
> >1) read a physical memory address or
> >2) read from an io port?
> 
> There are no builtin commands to do this, mainly because each bit of
> hardware has different rules about when ports can be read, e.g. write A
> to port X before you can read B from port Y.  Also kdb disables all
> interrupts which makes it difficult to do any I/O.  My current optinion
> is that this problem is best dealt with by the writing your own little
> kdb module to provide the hardware specific commands for the driver
> being debugged.
> 

Hi Randy, 

One can always examine a physical memory address with 'md' by adding 
_PAGE_OFFSET (normally 0xc0000000) to the physical address.  Of course
if there are side effects from the read (i.e. consuming FIFO bytes, 
etc.) there may be subsequent difficulties in the driver which owns
the hardware.  (if the kernel is ever modified such that there is 
no longer a one-to-one mapping between KVA and PA spaces then new
commands, mdp and mmp should be implemented to access the Physical
address space).

I one prototyped a command to read I/O ports.   I just never got
around to including it in the base kdb, but I don't see any reason
why it shouldn't be.   I'll try to dig it up one of these evenings.
(mdi <ioport> [<width>] - memory display, I/O address space)

The interrupt issue is a bit of a red herring, as one can simply poll
for completion when using kdb, if you are using mdi/mmi to play with
the I/O ports.

scott


<Prev in Thread] Current Thread [Next in Thread>