Hi,
I've searched through this list and can't seem to figure out what's
going on.
All that my program does is try to get a start value Mmaped to
0x80840000. The idea is to build stuff on top of this once I get it
working.
I'm having the program print out the file descriptor and the memory
map address.
The output I get is 3 for the FD (which is expected) and mmap sends
the variable start to 2aac2000. If I specify MAP_FIXED, then I get a
zero back (so mmap failed).
Anyone have any thoughts as to what's going on?
Thanks for your help!
Aaron
Here is my code:
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
main()
{
unsigned int *PADR, *PADDR;
unsigned char *start;
int fd = open("/dev/mem", O_RDWR|O_SYNC);
printf("FD: %d \n",fd);
start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd,
0x80840000);
printf("Start Address Map: %x \n", start);
close(fd);
}
Output from the program:
$ ./a.out
FD: 3
Start Address Map: 2aac2000
$
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|