Re: want to be a hardware developer ?

Vladimir Dergachev <[email protected]>
Newsgroups gmane.comp.xfree86.forum
Message-ID <[email protected]>
On Wed, 26 Mar 2003, Sven Luther wrote:

> On Wed, Mar 26, 2003 at 08:14:55AM -0500, Vladimir Dergachev wrote:
> > On Wed, 26 Mar 2003, Sven Luther wrote:
> >
> > > On Tue, Mar 25, 2003 at 07:54:38PM -0500, Vladimir Dergachev wrote:
> > > >      * Port it to Windows. You can use hws_win from
> > > >        http://gatos.sf.net/apps.php for direct access to memory mapped
> > > >        hardware (this is windows port of hw_script - though PCI id
> > > >        scanning is not supported yet).
> > >
> > > Hey, do you pre chance know of a windows tool to snoop what a particular
> > > driver writes to the register aperture ?
> >
> > No. This could be possible if another driver were to unmap it and
> > thus intercept all writes - but, at the very least, this is a non-trivial
>
> Mmm, i don't know enough about windows programming, never use windows
> anyway apart from testing that the hardware really works or such. How
> would this work ? you unmap the region, intercept the writes/reads and log
> them, and transparently pass them on.
>
> When the region is unmapped, the driver would be writting/reading to an
> illegal zone of memory, how do you intercept those ? Using a interrupt
> handler or something such ?
>

Yes. Windows has a handler that gets called when a segmentation fault
happens. I have seen Borland tools popup a dialog box and ask whether I
want to start a debugger when this happens. This probably applies to
driver code - or it would be rather hard to write them.

So the write would trap, the debugger would examine cpu state, determine
which instruction caused it (and what it was writing), log the write,
perform operation for the driver and return control. Same scheme should
work for reads.

This is where my Windows knowledge ends. The following issues might come
up :

   * we need some way to debug interrupt handler. fault in interrupt
     handler could be tricky to handle

   * it is not certain it would be easy to unmap the memory. it could be
     that something special is needed (like a handle) that only the driver
     knows

   * the driver could mess with sti/cli. Less likely now as SMP hardware
     becomes more widely available.

> > task. A hardware ICE can help - but these things were very expensive last
> > time I checked.
>
> Not a solution then.

It should be possible to design our own board. The easiest would be to
make one for slot cpu designs and use, say, USB 2.0 to deliver data to
another computer - should be reasonably fast too. The graphics cards tend to
support earlier standards too, though I am not certain how many slotted
motherboards support AGP 2x or 4x - required for most modern cards.

Possible issues:

     * it will likely take from 6 month to 1 year to design the board
       and parts+manufacture costs could be $500-$1000 - assuming low
       volume.

     * availability of slot motherboards is uncertain, perhaps it is
       better to choose a low pin count cpu, or even try snooping
       north bridge or AGP port itself.

     * driver execution would be a lot slower than with software
       solution above (on the positive side CPU ICE board can do a
       lot more than debug memory access in Windows).

                        best

                           Vladimir Dergachev

>
> Friendly,
>
> Sven Luther
> _______________________________________________
> Forum mailing list
> [email protected]
> http://XFree86.Org/mailman/listinfo/forum
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.