Need help!!! direct memory access

Need help!!! direct memory access

Post by Jooho Le » Wed, 13 May 1998 04:00:00



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.

--
?t??3? ??o????|?? ?3? ????|
          ????1? ? ?t1

http://dfs.iis.u-tokyo.ac.jp/

   Institute of Industrial Science
        University of Tokyo
Hashimoto Lab. PhD Student Lee, Jooho

 
 
 

Need help!!! direct memory access

Post by Paul Flinder » Wed, 13 May 1998 04:00:00



> 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.

This was separately posted to c.o.l.d.apps.

If you wish to post to multiple newsgroups then learn to crosspost -
do not post copies to multiple groups.

A crossposted article has a single message id and a Newsgroups: header
listing multiple groups. Such an article will be presented only once
to each person even if they read all the groups. The ensuing thread
will also be crossposted thus preventing helpful (even altuistic)
people wasting their valuable effort by posting answers that have
already been posted by other people in other group.

If you do not know how to crosspost then please learn typically you
can simply edit the Newsgroups: line by hand before posting.

--
Paul

 
 
 

Need help!!! direct memory access

Post by Georg Ach » Thu, 14 May 1998 04:00:00


|>

|>
|> > 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          
 
 
 

Need help!!! direct memory access

Post by Paul Flinder » Thu, 14 May 1998 04:00:00



> |> 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:

> ...

> Voila, no kernel fiddling, no crashes, just works...

Voila, abstraction boundaries violated, timings up the spout, root
access required, security problems galore introduced....

Please folks, just because you _can_ hit the hardware in Linux doesn't
make it a good idea.

 
 
 

Need help!!! direct memory access

Post by Keith Wrigh » Thu, 14 May 1998 04:00:00




> |>

> |>
> |> > 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:

> Voila, no kernel fiddling, no crashes, just works...
> --

Why is this easier than writing a driver?  You still have have to put
the correct bytes into that location to make the card do its thing.  I
don't believe there is any technique that allows you to write
arbitrary data to an abitrary absolute hardware address, but prevents
you from crashing the system.

--
     --Keith

This mail message sent by GNU emacs and Linux.
Food, Shelter, Source code.

 
 
 

1. Direct access to video memory under X

Is it possible to get direct hardware access to the VGA card? Probably I don't
need direct hardware access but rather I need to read and write directly into
the gfx memory. Any ideas how I could achieve this when X is running? I don't
mind when windows are overwritten in the course because they could be
refreshed and I would want to save the content anyway.

--
Gerhard Gruber

Fr jedes menschliche Problem gibt es immer eine einfache L?sung:
Klar, einleuchtend und falsch. (Henry Louis Mencken)

2. grep problem

3. direct memory access, gettimeofday: any GURUS out there?

4. No Drag and Drop

5. Direct memory access on Linux...

6. help with tcpip problem under Interactive

7. Direct access to video memory

8. Help! How do I use threading?

9. Direct memory access under linux

10. Direct video memory access under X

11. Tyan S1833D - Need help accessing memory > 64M

12. need help accessing device i/o memory from device driver

13. Need help with VME memory access