Jose,
Recently I have been accessing, from User Space, an ISA  video frame grabber
card which has 64K of memory.  Enclosed is the file.  There is some extra
stuff, but the statements are there and it works.   Basically,


    int  fd;

    unsigned char *buf;

    if ( (buf = (unsigned char *)calloc( 0xffff, sizeof(unsigned char) )) <
0)    //This is the buffer I'll use to access the memory
      {
        fprintf(stderr,"calloc problem \n");
        exit(1);
      }

    if (!(fd=open("/dev/mem",O_RDWR))) {
        fprintf(stderr, "ERROR with /dev/mem open  %s\n", strerror(errno));
        exit(1);
    }
 
     
   if ( (lseek( fd, 0xD0000, SEEK_SET ) ) < 0 )
      {
       fprintf(stderr,"Lseek error: %s\n",strerror(errno) );
       exit(1);
      }

    write( fd, buf, 0xffff );

    close(fd);
 



 <<jpeLseek.c>> 

> -----Original Message-----
> From: José Daniel Muñoz Frías [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, February 11, 2000 7:36 AM
> To:   [EMAIL PROTECTED]
> Subject:      [rtl] configuring ISA card memory address in LILO
> 
>       Hello,
>       
>       I've got an ISA card at the address 0xD0000. I want to access it
> from a
> user program. As I can't read physical memory from it, I prepared
> (copied :-) ) a module which makes the way through. I know LILO needs to
> know that it shouldn't map the card's memory area, but can't remember
> how to do it.
>       I'd like to know this, or any other (simpler) way to access the card
> from the user program.
> 
>       Thanks
> 
>        
> -- 
> __________________________________________________________________________
> _____
> José Daniel Muñoz Frías                         
> mailto:[EMAIL PROTECTED]
> Universidad Pontificia Comillas ICAI               
> http://www.dea.icai.upco.es
> Alberto Aguilera 23, 28015 Madrid Spain
> Tel. 34-91-5422800 Fax 34-91-5596569
> __________________________________________________________________________
> _____
> --- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> ----
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/~rtlinux/

jpeLseek.c

Reply via email to