|>
|>
|> > Is there any way to access memory directly?
|> > I have to control a isa interface card which is memory mapped. Its
|> > physical address is D0000h. I want to use GCC but I could not find any
|> > proper function for this. Plese give me some comments.
|>
|> Write a device driver.
And years later the driver works ;-) For this simple application, you can use the
mmap()-call to re-map physical memory into user-memory. You have to be root for
that, but shouldn't matter. An example:
void *map_mem(int phys_start) /* call with 0xd0000 */
{
int fd;
void* log_start;
fd = open("/dev/mem", O_RDWR); /* maybe check error code... */
log_start=mmap((caddr_t)0, 4096*2, /* map 16K*/
PROT_READ|PROT_WRITE,
MAP_SHARED, fd,
(off_t)phys_start);
close(fd);
return log_start;
Quote:}
Voila, no kernel fiddling, no crashes, just works...
--
Bye
http://www.informatik.tu-muenchen.de/~acher/
"Oh no, not again !" The bowl of petunias