RE: RAM or "empty"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Well , if /proc/iomem gives the PHYSICAL address
>range of devices , then why is the  System RAM 
>split into 3 different address ranges as seen below 
>(marked by arrows ) ? Is it bcoz the Motherboard is
>designed in this manner ? 

        The area from 640KB- 1MB in x86 machines is not mapped to RAM but to
certain device ROMs, this is the memory hole and this area should not be
treated as rest of the RAM. The kernel takes care of this by making sure
that all the 'struct pages' which falls in this range has their Reserved
flag set.

~> cat /proc/iomem
00000000-0009fbff : System RAM  <--- 1
0009fc00-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000e0000-000effff : Extension ROM
000f0000-000fffff : System ROM
00100000-1fecffff : System RAM  <---- 2
  00100000-0028dadf : Kernel code
  0028dae0-00324f63 : Kernel data
1fed0000-1feeffff : ACPI Non-volatile Storage
1fef0000-1fefffff : System RAM  <---- 3
40000000-40000fff : Intel Corp. 82801BA/BAM/CA/CAM
Ethernet Controller
  40000000-40000fff : eepro100
40300000-4037ffff : Intel Corp. 82815 CGC [Chipset
Graphics Controller]
44000000-47ffffff : Intel Corp. 82815 CGC [Chipset
Graphics Controller]
feea0000-ffffffff : reserved

>Are these memory address ranges dynamically 
>determined ? Which kernel code file does this ?

	Again, in x86 machines, kernel gets the info about system RAM size
and memory holes by making a BIOS call duing boot up. As for the kernel code
and data, the linker scripts has some variables which helps the kernel
determines its size. The PCI device's memory map can be find by accessing
the device's configuration regisers (with the help of the host to PCI
bridge).

>Also , does  /proc/ioports represent IO-mapped 
>PHYSICAL memory addresses ,
>similar to the  the Memory-mapped PHYSICAL memory 
>addresses in /proc/iomem ?

         IO Ports unlike IO memory does not have a virtual to physical
translation
ie what ever you specify as the IO Port address in your 'IN' or 'OUT'
assembly instructions will appear in the address lines.

> >Also , does the VM in linux translate the memory 
> >address of programs into actual Physical addresses 
> >of RAM , or is it that Hardware does the actual
> >translation to Physical addresses  ( since the RAM 
> >addresses would differ across different Computers 
> >depending on the amount of RAM & also the
> Motherboard
> >design ) .
> 
>  Most of the processors will require the OS to setup
> page directories/tables
> which it will refer
> to convert the virtual address to physical address.
> You are right that the
> RAM addresses differ across 
> systems, In one of the boards i worked, the SDRAM
> physical start address was
> 0xc4000000, so the kernel page
> tables were set such that, virtual address 0xc000
> 0000 was mapped to
> physical address 0xc400 0000 and so on. 
> 

>So you mean to say the Page tables being setup 
>during initialization at boot up would take care 
>of this dynamically or would this require a kernel 
>code change ( which file )?


    In normal x86 machines you can see that kernel virtual address
0xc0000000 is physical address 0x0, in the board i mentioned as the
designers knew that the SDRAM starts at physical address 0xc4000000 and not
0x0, they altered the macro 
( i think it was __virt_to_phys ) so that the kernel sets up the page tables
are setup as desired

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux