Skip to contentSkip to conversation

how can I have access to the memory as in flat mode?

DISCUSSION Frederic Marmond 2 participants 2 messages Jun 23, 2002 – Jun 25, 2002

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 19 lines · On Sun, 23 Jun 2002 17:13:51 +0200 Frederic Marmond <[email protected]>…

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.

Quoted 2 lines

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.

Quoted 2 lines

any help?

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

regards,
hp

Signature · 6 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html