Re: memory consumed by kernel

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

 



Hi Arun,

>> I can definitely confirm that not all ARM processors start their RAM
>> at physical address zero.
>>
>> If you have a kernel module (or you can rebuild your kernel to add a
>> printk), you can have it print out the 4 bytes at virtual address
>> 0xC0004000. The top 3 nibbles of this first word will be the top 3
>> nibbles of the physical address of your first page of memory.
>>
>> So, something like:
>>
>> printk( "0x%08x\n", *(uint32_t *)0xc0004000 );
>
> I tried printing,
>
>  printk( "0x%08x\n", *(uint32_t *)0xc0004000 );
>  printk("0x%08x\n", virt_to_phys(0xc0004000));
>
> Output:
>  0x00000000
>  0x13004000

Ok - so this tells me that your SDRAM starts at 0x13000000

I realized that printing 0xc0004000 corresponds to memory location zero.

What we really wanted was the MMU entry which correponds to virtual
address 0xc0000000. The high 3 nibbles is 0xc00, so we would have
needed to do

 printk( "0x%08x\n", *(uint32_t *)(0xc0004000 + ( 0xc00 * 4 ));

and that should print

0x130xxxxx

> So I initialized  the variable "i" in the kernel module to 0x13004000.
> But still it is not entering the while loop.

PFN's are equal to the physical address shifted right by 20.

So the PFN for 0x13004000 would be 0x130 or 304 (base 10)

> Makefile.boot is saying
>
> zreladdr-y      := 0x13008000
> params_phys-y      := 0x13000100

This further confirms that physical memory starts at 0x13000000

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

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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