Browse Source

riscv: bringup

with the right coreboot version on the spike emulator, we get to main.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 7 years ago
parent
commit
e1935afe6d
2 changed files with 20 additions and 6 deletions
  1. 2 2
      sys/src/9/riscv/kernel.ld
  2. 18 4
      sys/src/9/riscv/main.c

+ 2 - 2
sys/src/9/riscv/kernel.ld

@@ -12,8 +12,8 @@ KERN_LOAD_ADDR = 0xffffffff00000000;
 
 SECTIONS
 {
-	/* Entry Linked and loaded at 0x80810000 */
-	. = 0x80810000;
+	/* Entry Linked and loaded at 0x81810000 */
+	. = 0x81810000;
 
 	.bootstrap : {
 		*(.boottext .bootdata)

+ 18 - 4
sys/src/9/riscv/main.c

@@ -16,11 +16,25 @@
 #include "init.h"
 #include "io.h"
 
+void testPrint(uint8_t c);
+
+void fuck(char *s)
+{
+	while (*s)
+		testPrint(*s++);
+}
+
+static int x = 0x123456;
+
 void
 main(uint32_t mbmagic, uint32_t mbaddress)
 {
-	void testPrint(void);
-	
-	while (1)
-		testPrint();
+
+	testPrint('0');
+	if (x != 0x123456)
+		fuck("Data is not set up correctly\n");
+	//memset(edata, 0, end - edata);
+	fuck("got somewhere");
+	while (1);
+
 }