0
votes

I have read that if Linux kernel virtual address is between 0xC0000000 and (0xC0000000 + 896MB). The mapping is direct to the physical address.

That is if RAM is at 0x80000000. Which is mapped directly to 0xC0000000.

How is this achieved in Linux. does someone tell MMU to subtract an Offset each time the Virtual address is between 0xC0000000 and (0xC0000000 + 896MB)

1
You should probably tag arm if that's the arch you're referring to. This is rather arch specific stuff.tangrs
"This is rather arch specific stuff" -- Actually it seems to be board specific. I've worked on Linux on ARM for a few years, and never read of such a mapping.sawdust

1 Answers

0
votes

You're not asking how Linux does address translation, but how the MMU does it.

All Linux does is set up a data structure called a page table in memory and points the MMU to this.

The page table contains entries describing what to do with every block of virtual address space (the size of the block is usually in the range of 4KB-1MB depending on your platform and configuration). You can map it to a physical address, set permission flags or cause a page fault on attempt to access it.

The MMU walks this table every time a memory access is made to work out what to do (and keeps a cache of it somewhere).