Subject: Re: is mmap on /dev/mem broken on sparc64?
To: Matthias Scheler <tron@zhadum.de>
From: Sean Davis <dive@endersgame.net>
List: port-sparc64
Date: 03/12/2005 18:57:59
On Sat, Mar 12, 2005 at 06:12:35PM -0500, Sean Davis wrote:
> On Sat, Mar 12, 2005 at 10:30:15PM +0000, Matthias Scheler wrote:
> > In article <20050312215700.GA7098@endersgame.net>,
> > 	Sean Davis <dive-nb@endersgame.net> writes:
> > > Okay, I've tried about a million variations on this code... no luck with any
> > > of them. Basically, I'm trying to mmap a specific region of memory with the
> > > eventual goal of getting a ROM dump from an Adaptec 2940UW.
> > 
> > It looks like mem(4) does *not* support mmap() under NetBSD-sparc64.
> > Try using read(2) instead.
> 
> Sorry for the newbie-esque question, but if I'm using read(), instead of
> mmap(), I should lseek to where I need to be, right?

Okay, now I've run into another snag. Once I lseek to the offset (defined as
0x1ff00000000 (where pci stuff starts, as I was told by someone else) plus
0x00010000 (the ROM address of the controller card)), I get EBADF from
read(). According to everything I've been told in my efforts to get a dump
of this firmware, there SHOULD be 128k there for me to read, but I get EBADF
regardless of whether I use lseek() or pread(). Any hints?

- Sean

--
 _
( ) ASCII Ribbon Campaign
 X
/ \ For Plain Text Email