LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   IO and CPU register area mapping (https://www.linuxquestions.org/questions/linux-kernel-70/io-and-cpu-register-area-mapping-677724/)

!rajkums! 10-20-2008 03:18 AM

IO and CPU register area mapping
 
Generally the available memory like RAM is passed on to the kernel image through bootloader. This memory area is then mapped to the virtual area starting from 0xC0000000.While filling the page table entries kernel, uses PHYS_TO_VIRT(x) and VIRT_TO_PHYS(x) macros.
But i am not getting how other IO areas and CPU peripheral register areas are getting mapped by the kernel. Can anybody explain the mechanism generally used for IO area mapping and the general virtual address at which it is being mapped? Does the kernel uses specific macros for this purpose ?

Quakeboy02 10-20-2008 08:19 PM

Isn't this done by the interaction between the BIOS and the boards before boot and then just passed on as part of "Plug and Play"? I can't believe that it could be renegotiated by the Linux kernel. We used to have to set jumpers on the boards and then weed out conflicts before PnP came along. You might want to look into the lspci command as a start, as it can list all the io and memory areas.
Code:

lspci -vv
Hmm, looks like you can do something from user space with "isapnptools" for old boards that need to be hardcoded. See http://www.linuxjournal.com/article/3269 or google "Linux Plug and Play" for more info.

!rajkums! 10-21-2008 05:13 AM

Thanks for the reply Quake.
Yep. Somehow kernel is made to know that these are the areas which has to mapped as IO. May be in PC platform, BIOS interacts with the board and lets the kernel know about this.
But i am looking for how it is happening in a non-pc platform like an arm or ppc. In these platforms there is no BIOS concept and moreover these processors itself will be having in-built peripheral controllers and hence its register area. So, how these areas are getting mapped,by the kernel.


All times are GMT -5. The time now is 02:38 PM.