summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-05-17 16:11:59 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-05-17 16:11:59 -0500
commit4324ee74d2a77c20704323dae57762b36301ea8a (patch)
treead536ea60f40cd920f22e2397d67527958543e8f
parentde80b963baf574b32661e153e01164aa6d8a5b44 (diff)
downloadtalos-hostboot-4324ee74d2a77c20704323dae57762b36301ea8a.tar.gz
talos-hostboot-4324ee74d2a77c20704323dae57762b36301ea8a.zip
Load base TOC and create kernel stack.
-rw-r--r--kernel.c12
-rw-r--r--kernel.ld14
-rw-r--r--makefile4
-rw-r--r--start.S6
4 files changed, 24 insertions, 12 deletions
diff --git a/kernel.c b/kernel.c
index fe019e583..a0f5d2247 100644
--- a/kernel.c
+++ b/kernel.c
@@ -1,14 +1,12 @@
void _main(void)
{
- unsigned int i = 100;
- while(i != 0)
- {
- asm volatile("eieio");
- i--;
- }
-
+ static unsigned char kernel_stack[16 * 1024] = {0};
+ register void * stack = &kernel_stack;
+ asm volatile("mr 1,%0" :: "r" (stack) );
+
while(1)
{
+ //asm volatile("wait");
}
}
diff --git a/kernel.ld b/kernel.ld
index 45fb1615a..0f44adb34 100644
--- a/kernel.ld
+++ b/kernel.ld
@@ -1,6 +1,6 @@
rom_offset = 0xfff00000;
base_load_address = 0x00000000;
-text_load_address = 0x00008000;
+text_load_address = 0x00003000;
hreset_load_address = 0x000ffffc;
SECTIONS
@@ -16,15 +16,21 @@ SECTIONS
*(.text)
*(.rodata)
*(.rodata.*)
- }
+ }
+
.data ALIGN(0x1000): {
+ data_load_address = .;
*(.data)
*(.data.*)
*(.branch_lt)
- *(.opd)
-
*(.bss)
+
+ toc_load_address = .;
+ *(.toc)
+ opd_load_address = .;
+ *(.opd)
+ *(.got)
}
. = hreset_load_address;
diff --git a/makefile b/makefile
index df8bff977..a40238991 100644
--- a/makefile
+++ b/makefile
@@ -1,7 +1,9 @@
CC = powerpc64-unknown-linux-gnu-gcc
LD = powerpc64-unknown-linux-gnu-ld
-CFLAGS = -O3
+COMMONFLAGS = -O3 -nostdlib
+CFLAGS = ${COMMONFLAGS} -mcpu=620
+LDFLAGS = -static ${COMMONFLAGS}
OBJECTS = start.o kernel.o
diff --git a/start.S b/start.S
index 58d0b7e8b..86eed054a 100644
--- a/start.S
+++ b/start.S
@@ -60,6 +60,12 @@ relocate_loop:
blr
finished_relocate:
+ ;// Set up initial TOC Base
+ lis 2, opd_load_address@h
+ ori 2, 2, opd_load_address@l
+ ld 2,8(2)
+
+ ;// Jump to main.
b _main
.org _start + 0x100
OpenPOWER on IntegriCloud