mmap in kernel module
- From: pslana@xxxxxxxxx
- Date: 8 Jun 2006 23:38:29 -0700
Hi, i'm newby in kernel programming.
I need to directly address a device in the memory, but i can't use
open, mmap and munmap.
What i actually need to do is the following (from application point of
view):
"""
mem = open("/dev/mem", O_RDWR | O_SYNC);
base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, mem,
EBI_BASE & ~MAP_MASK);
munmap(base, MAP_SIZE);
cs_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, mem,
CS_BASE & ~MAP_MASK);
"""
MAP_SIZE, MAP_SHARED, CS_BASE, EBI_BASE and MAP_MASK are predifinied
consts which define addresses, masks and offsets.
How can i do this in the device_open method?
Please help.
thanks in advance
.
- Follow-Ups:
- Re: mmap in kernel module
- From: Geronimo W. Christ Esq
- Re: mmap in kernel module
- Prev by Date: Re: Limiting write cycles to CF card for mysql
- Next by Date: LINUX ON ILLUSION M5 RECEIVER (FUJITSU PROCESSOR) - HELP
- Previous by thread: Limiting write cycles to CF card for mysql
- Next by thread: Re: mmap in kernel module
- Index(es):
Relevant Pages
|