diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2010-05-14 15:47:08 -0500 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2010-05-14 15:47:08 -0500 |
commit | e0a656540df6e0a138d3e56e928b7be218092dfc (patch) | |
tree | fd9dfac07e085fe6653a66defa504c2f25177b12 | |
parent | b6c39a5c3f282383f189e238e0631c850a8bccc9 (diff) | |
download | talos-hostboot-e0a656540df6e0a138d3e56e928b7be218092dfc.tar.gz talos-hostboot-e0a656540df6e0a138d3e56e928b7be218092dfc.zip |
Relocate kernel image to start at 0.
-rw-r--r-- | kernel.ld | 9 | ||||
-rw-r--r-- | start.S | 11 |
2 files changed, 14 insertions, 6 deletions
@@ -1,12 +1,13 @@ -base_load_address = 0xfff00000; -text_load_address = 0xfff08000; -hreset_load_address = 0xfffffffc; +rom_offset = 0xfff00000; +base_load_address = 0x00000000; +text_load_address = 0x00008000; +hreset_load_address = 0x000ffffc; SECTIONS { . = base_load_address; - .text.intvects ALIGN(0x1000): { + .text.intvects ALIGN(0x1000): AT(base_load_address + rom_offset) { *(.text.intvects) } @@ -15,8 +15,8 @@ _start: pre_relocate: mflr 2 lis 1,0x0010 - cmp 0,2,1 ;// Check LR is less than 1MB - bc 0,0,finished_relocate ;// No need to relocate if less than 1MB + cmpl 0,2,1 ;// Check LR is less than 1MB + blt finished_relocate ;// No need to relocate if less than 1MB ;// Get addresses for relocation. ;// Write address in r5 @@ -30,6 +30,10 @@ pre_relocate: and 1,1,2 ;// and with pre_relocate's address from r2 to get start of ;// rom section. + ;// Update LR to low address. + and 6,2,3 + mtlr 6 + ;// Moving 1MB , so load r2 with (1MB / 8 bytes per word) lis 2, 0x2 mtctr 2 @@ -51,6 +55,9 @@ relocate_loop: not 10,10 and 11,11,10 mtmsr 11 + + ;// Jump to low address. + blr finished_relocate: b _main |