All of lore.kernel.org
 help / color / mirror / Atom feed
* how can I have access to the memory as in flat mode?
@ 2002-06-23 15:13 Frederic Marmond
  2002-06-25 23:17 ` h-peter recktenwald
  0 siblings, 1 reply; 2+ messages in thread
From: Frederic Marmond @ 2002-06-23 15:13 UTC (permalink / raw)
  To: linux-assembly


Hi,

few days ago, i posted mails to try to know better about linear memory 
in linux.
perhapse you've already answer me, but I could'nt see mails from the list...
So, I managed to make my prog work by using /dev/mem
it's very ugly, but it worked.

Is there any other way to access somewhere?
In fact the exact problem is:

on a embeded system, the mac-adress of  eth0 and eth1 are stored in a 
flash memory, mapped somewhere.
The 'standard' driver (natsemi) doesn't know this, and try to access to 
the 'normal' pci network card.
So, i have to read the mac adress by hand, and modify the value returned 
by the 'standard' driver.

I know the adress, but I've got seg-faults when trying to access it from 
the driver (readb, (unsigned char*)0xf8000, ...)

any help?

Fred


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

* Re: how can I have access to the memory as in flat mode?
  2002-06-23 15:13 how can I have access to the memory as in flat mode? Frederic Marmond
@ 2002-06-25 23:17 ` h-peter recktenwald
  0 siblings, 0 replies; 2+ messages in thread
From: h-peter recktenwald @ 2002-06-25 23:17 UTC (permalink / raw)
  To: fmarmond; +Cc: linux-assembly

On Sun, 23 Jun 2002 17:13:51 +0200
Frederic Marmond <fmarmond@eprocess.fr> wrote:

> 
> Hi,
> 
> few days ago, i posted mails to try to know better about linear memory 
> in linux.
> perhapse you've already answer me, but I could'nt see mails from the list...
> So, I managed to make my prog work by using /dev/mem
> it's very ugly, but it worked.
> 
> Is there any other way to access somewhere?
> In fact the exact problem is:
> 
> on a embeded system, the mac-adress of  eth0 and eth1 are stored in a 
> flash memory, mapped somewhere.
> The 'standard' driver (natsemi) doesn't know this, and try to access to 
> the 'normal' pci network card.
> So, i have to read the mac adress by hand, and modify the value returned 
> by the 'standard' driver.
> 
> I know the adress, but I've got seg-faults when trying to access it from 
> the driver (readb, (unsigned char*)0xf8000, ...)
				^^^^^^^^^^^^

i'm most probably the least experieced on this access mode, thus only 
guessing, i.e. the way how i would start trying:

is your code running in kernel mode (e.g. module)?
otherwise that address would not be accessible, 1st GB owned by kernel.

in kernel mode you might try sys_open on /dev/kmem and set the 'file pointer' 
to the mentioned mmap-ed(?) address, then read w. 
	sys_read fd,memory-address,number-of-byte-to-read

which might even work from user space (by a 'normal' program) when called 
with 'root' access privileges.

> 
> any help?

???? - I'd yet never try any of those...


regards,
	hp

-- 
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
NO abusive software patents http://petition.eurolinux.org/pr/pr17.html
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2002-06-25 23:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-23 15:13 how can I have access to the memory as in flat mode? Frederic Marmond
2002-06-25 23:17 ` h-peter recktenwald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.