Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Linux Memory usage in AT91 (AT91SAM9260)
PostPosted: Thu Mar 12, 2009 6:32 pm 
Offline

Joined: Wed Mar 11, 2009 7:06 pm
Posts: 7
I am wondering how Linux handles memory in my AT91SAM9260 once it loads. Specifically after U-Boot and with a Ram Disk. Anyone have a good reference or an easy answer?

For instance, after U-Boot loads the Kernel and it begins executing.

Does it reclaim the area that U-Boot was residing in?
Does it relocate itself to the top of memory?
And if you have a ram disk passed in from U-Boot as an initrd (initrd and rootfs=dev/ram), how does linux work around this area, before and after it in SDRAM?

Thanks for any help!
Carl


Top
 Profile  
 
 Post subject: Re: Linux Memory usage in AT91 (AT91SAM9260)
PostPosted: Thu Jun 11, 2009 11:00 am 
Offline

Joined: Sat Jun 06, 2009 6:29 am
Posts: 6
Does it reclaim the area that U-Boot was residing in?
> No Once the U-Boot has loaded the kernel into other mapped memory space specific for kernel, it passes control to the kernel and the kernel understands only the space allocated to it. Thus no reclaming is done and U-boot goes into background has has no significance until the systems is done or reset once again


Does it relocate itself to the top of memory?
> Nothing happens this sort of thing as per my idea since no such debugging messages are displayed on the screen once the kernel has started executing.


And if you have a ram disk passed in from U-Boot as an initrd (initrd and rootfs=dev/ram), how does linux work around this area, before and after it in SDRAM?
> U-boot passes the board information to the kernel through a structure bd_info present in u-boot-1.1.3/include/asm-arm/u-boot.h (Assuming u-boot-1.1.3 is your top directory) to the kernel which is then used by the kernel.


Top
 Profile  
 
 Post subject: Re: Linux Memory usage in AT91 (AT91SAM9260)
PostPosted: Wed Aug 05, 2009 5:08 am 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 204
Location: USA
Hi there

> Does it reclaim the area that U-Boot was residing in?

Sort of, but not explicitly. The kernel is not aware of where U-Boot is/was. That RAM is part of the memory that is put under kernel control.

> Does it relocate itself to the top of memory?

Sort of.
The kernel is loaded to the physical memory address that was specified when it was built, which might be 0x20008000. When memory management is enabled, the kernel image is mapped to virtual memory starting at 0xC0000000. It's a physical to virtual memory mapping performed by the MMU that does not involve copying.

> And if you have a ram disk passed in from U-Boot as an initrd (initrd and rootfs=dev/ram),
> how does linux work around this area, before and after it in SDRAM?

Don't understand your question.
The physical memory (in 4KiB page chunks) can be assigned to any virtual (page aligned) memory address.

BTW the ARM architecture does not use the bd_info structure any more (at least U-Boot 1.1.5). U-Boot configured for ARM passes memory, CPU, board information to the kernel using ATAGs.

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: