• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Puzzled about addresses  (Read 2327 times)
akc42
Newbie
*

Karma: 0
Posts: 7


View Profile
« on: November 19, 2009, 01:20:26 AM »

I am puzzled about the addresses that are used in many of the commands.  I am obviously aware that they are hex numbers, related to the addresses of things, but I can't seem to find any explanation of how the nand and ram are laid out and why particular addresses are chosen.

For instance - the factory boot sequence defines the bootcmd environment

bootcmd=nand read.e 0x800000 0x100000 0x400000 ; bootm 0x800000

help for nand read.e says 0x800000 is an addr and there is one other parameter (off | partition size).  I can't find any more documentation that refers to this, yet this command has 3 parameters.

I assume the kernel is being loaded into RAM at 8MB and then the bootm command starts it executing from there.  WHY 8MB?  The Debian instructions (http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html) loads it into 4MB and puts an Initrd Image at 8MB.  Why the difference.  Are these numbers plucked out of thin air, or is there a reason they are like they are?
Logged

radael
Jr. Member
**

Karma: 1
Posts: 57


View Profile
« Reply #1 on: December 29, 2010, 10:05:51 PM »

bootcmd=nand read.e 0x800000 0x100000 0x400000 ; bootm 0x800000

I assume the kernel is being loaded into RAM at 8MB and then the bootm command starts it executing from there.  WHY 8MB?  The Debian instructions (http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html) loads it into 4MB and puts an Initrd Image at 8MB.  Why the difference.  Are these numbers plucked out of thin air, or is there a reason they are like they are?

Yes these commands copy the kernel (4 MB length) from Flash into RAM, starting at the 8 MB address; and then start execution.

0x800000 is the RAM target address
0x100000 is the starting (Flash) address from which to load (standard kernel Flash storage address)
0x400000 is the length of memory to copy

The reasons for the Flash addresses are easy -- cramming everything in as closely as possible.  I don't know why the RAM address of 8 MB was used.  The page you reference no longer seems to have a 4 MB starting address.  Perhaps it has something to do with alignment ( Undecided ).

Might keep in mind that use of initrd is often only temporary -- for new installations (mounting in a RAM file system so that a new rootfs can be uncompressed and written).
Logged

radael
Jr. Member
**

Karma: 1
Posts: 57


View Profile
« Reply #2 on: December 31, 2010, 10:53:22 PM »

The reason for the RAM starting (0x800000) is because the first 8 MB are reserved for U-Boot.

Watch the console during startup or restart, stop it before the autoboot.

The U-Boot log will say something like:

Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done.

http://www.plugcomputer.org/plugwiki/index.php/BootNarrative

So, there is definitely a reason for the 0x800000.
Logged

Pages: [1]
Print
Jump to: