On Monday 29 September 2003 15:48, Erez Doron wrote:
> Muli Ben-Yehuda wrote:
> >On Mon, Sep 29, 2003 at 11:45:56AM +0300, Erez Doron wrote:
> >>hi
> >>
> >>i've written a device driver which maps a card's memory to a device.
> >>
> >>i can read/write/seek the device
> >>
> >>i can't seem to mmap it though
> >
> >What does mmap return? what does your mmap implementation look like?
> >more details please, I flunked mind reading.
>
> the relevant code is:
>
> if (-1==(mmap_fd=open(devname,O_RDWR))) {perror(devname);exit(1);};
> printf("fd=%d\r\n",mmap_fd);
> printf("mem-mapping ...\r\n");
> if (-1==(mmapped=(unsigned int *)mmap((char
> *)0,65536,PROT_READ|PROT_WRITE,MAP_FIXED,mmap_fd,0)))
> {perror("mmap");exit(1);};
>
>
> output:
>
> fd=3
> mem-mapping ...
> mmap: No such device


You seem to have missed something quite basic - if you implement your own dev 
entry and want to mmap it you need to implement an mmap method, just like 
read, write, seek etc.

Gilad
>
>
> cheers,
> erez.
>
>
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]

-- 
Gilad Ben-Yossef <[EMAIL PROTECTED]>
Codefidence. A name you can trust (tm)
http://www.codefidence.com


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to