[Top] [All Lists]

trying to mmap part of the system memory (RAM)

Subject: trying to mmap part of the system memory (RAM)
From: mojoe thinks <>
Date: Thu, 21 Jul 2005 07:02:36 -0700 (PDT)
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024;; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=tfn5tlOoB55j/v56gs8tYuYAQlYaxSrokzC53RjVlsVHTNkpppk0/Q9m91jIpSJNYb0vKTO7WUWq31XTAGBesMdyzqLmbjNeDRbZn78s3t3VVEdBv2NMm+xr/Zo+FT4KMkPvM+5LrVvt12ZoKEnNezBYCRb2JrO+EHGsySGC7ho= ;
Original-recipient: rfc822;
I've been trying to impliment mmap() fucntionality in my driver code. The intent is to reserve a piece of memory as buffer (about 2M) and map this area to the user space that calls this driver.
In the book Linux Device Driver by Rubini says that if we limit the use of system memory by the kernel, ie. tell the kernel to use less than the available amount of kernel space using command line option, we could in effect reuse the remaining memory by using the ioremap() system call.
I am working on MIPS RM5200 core (32 bit external Sys/Ad bus), the total availabe RAM size on the system is 64M, I have specified in the PMON boot code 32M size for use. So when the system boots up i can see that around 28M space is available using the free command.
Now when i use the ioremap() system call, it returns me an address, which i presume to be the virtual address. When i try to use this address driectly or with writeb()/readb() system call, the whole system just reboots.
Can any one please tell if i am doing the right thing.. is there an lternate to ioremap() which would actually work? How do i get hold of the unused RAM space?
The address range that i'm using is 0xA2000000 as there is a direct mapping of memory in kseg1 address space for MIPS
I would be delighted to hear from anybody with a possible sol. :-)
Thanking in advance..

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

<Prev in Thread] Current Thread [Next in Thread>