kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Clarification on memory mapping
@ 2011-06-01  6:34 sandeep kumar
  2011-06-01 16:00 ` Mulyadi Santosa
  2011-06-01 17:38 ` Prashant Shah
  0 siblings, 2 replies; 4+ messages in thread
From: sandeep kumar @ 2011-06-01  6:34 UTC (permalink / raw)
  To: kernelnewbies

Hi,
I am new to kernel programming. Last few days i have been reading about
memory management, memory mapping etc.,
But i could not put the things together.
Here i need clarifications regarding the few things whether wat i understood
is right or not.

1) Mapping means bringing a device memory which is not in the address space
of kernel/user to its address space.

ioremap() :
2) ioremap does mapping of a particular i/o device to kernel logical memory
address.

mmap()
3) mmap does the mapping of a device memory to user space virtual address.

kmap()
4) gets a kernel virtual address of an allocated high memory page.

5) And finally memory mapping does a manipulation of a PTE.

Tell if i have interpreted anything wrong and please correct me.

Thank you




-- 
With regards,
Sandeep Kumar Anantapalli,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110601/922f1ece/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Clarification on memory mapping
  2011-06-01  6:34 Clarification on memory mapping sandeep kumar
@ 2011-06-01 16:00 ` Mulyadi Santosa
  2011-06-01 17:38 ` Prashant Shah
  1 sibling, 0 replies; 4+ messages in thread
From: Mulyadi Santosa @ 2011-06-01 16:00 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jun 1, 2011 at 13:34, sandeep kumar <coolsandyforyou@gmail.com> wrote:
> Hi,
> I am new to kernel programming. Last few days i have been?reading about
> memory management, memory mapping etc.,
> But i?could not?put the things together.
> Here i need clarifications regarding the few things whether wat i understood
> is right or not.
>
> 1) Mapping means bringing a device memory which is not in the address space
> of kernel/user to its address space.
>
> ioremap() :
> 2) ioremap?does mapping of a particular i/o device to kernel logical memory
> address.
>
> mmap()
> 3) mmap does the mapping of a device memory to user space virtual address.

it maps either a file or you do anonymous page allocation here. I
doubt it deals with device....at least directly....


> kmap()
> 4)?gets a kernel virtual address of an allocated high memory page.
>
> 5) And finally memory mapping does a manipulation of a PTE.
>
> Tell if i have interpreted anything wrong and please correct me.
>
> Thank you
>
>
>
> --
> With regards,
> Sandeep Kumar Anantapalli,
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>



-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Clarification on memory mapping
  2011-06-01  6:34 Clarification on memory mapping sandeep kumar
  2011-06-01 16:00 ` Mulyadi Santosa
@ 2011-06-01 17:38 ` Prashant Shah
  2011-06-01 23:47   ` Dave Hylands
  1 sibling, 1 reply; 4+ messages in thread
From: Prashant Shah @ 2011-06-01 17:38 UTC (permalink / raw)
  To: kernelnewbies

Hi,

On Wed, Jun 1, 2011 at 12:04 PM, sandeep kumar
<coolsandyforyou@gmail.com> wrote:
> Hi,
>
> ioremap() :
> 2) ioremap does mapping of a particular i/o device to kernel logical memory
> address.

Please correct me if I am wrong.

I think this function will remap the I/O registers location to a
memory location, so instead of using inb/outb you can use the memory
based functions like readb/writeb.

eg : lets say I want to read from I/O port 0x80. I will have to use
the inb() function. Now if I ioremap() it to a memory location it I
can use the readb() instead.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Clarification on memory mapping
  2011-06-01 17:38 ` Prashant Shah
@ 2011-06-01 23:47   ` Dave Hylands
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Hylands @ 2011-06-01 23:47 UTC (permalink / raw)
  To: kernelnewbies

Hi Prasant,

On Wed, Jun 1, 2011 at 10:38 AM, Prashant Shah <pshah.mumbai@gmail.com> wrote:
> Hi,
>
> On Wed, Jun 1, 2011 at 12:04 PM, sandeep kumar
> <coolsandyforyou@gmail.com> wrote:
>> Hi,
>>
>> ioremap() :
>> 2) ioremap does mapping of a particular i/o device to kernel logical memory
>> address.
> Please correct me if I am wrong.
>
> I think this function will remap the I/O registers location to a
> memory location, so instead of using inb/outb you can use the memory
> based functions like readb/writeb.
>
> eg : lets say I want to read from I/O port 0x80. I will have to use
> the inb() function. Now if I ioremap() it to a memory location it I
> can use the readb() instead.

I'm pretty sure thats not the case (I'm not that familiar with the x86
I/O space on modern processors). I think that if you need to use
in/out instructions then you need to do that and there is no way of
mapping this into memory space.

ioremap is primarily used with memory-mapped peripherals (very common
on most non-x86 architectures). If basically maps a chunk of physical
memory into a virtual space.

If that physical memory happens to conincide with device registers,
then that will allow the driver to manipulate those registers.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-01 23:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-01  6:34 Clarification on memory mapping sandeep kumar
2011-06-01 16:00 ` Mulyadi Santosa
2011-06-01 17:38 ` Prashant Shah
2011-06-01 23:47   ` Dave Hylands

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).