PERFORCE change 105702 for review

Warner Losh imp at FreeBSD.org
Tue Sep 5 22:07:11 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=105702

Change 105702 by imp at imp_lighthouse on 2006/09/05 22:07:01

	Initial support for booting off the sd part.  Still
	mondo-primitivo, but it seems to get the job done for
	compressed kernels.  Symbols aren't loaded because there's
	something wrong with doing that...
	
	ok, it isn't pretty, but it is progress...

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#10 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#10 (text+ko) ====

@@ -67,7 +67,8 @@
 			OPT_SET(RBX_PAUSE))
 
 #define PATH_CONFIG	"/boot.config"
-#define PATH_KERNEL	"/boot/kernel/kernel"
+//#define PATH_KERNEL	"/boot/kernel/kernel"
+#define PATH_KERNEL	"/kernel.gz.tramp"
 
 #define ARGS		0x900
 #define NOPT		8
@@ -138,7 +139,9 @@
 static inline int
 xfsread(ino_t inode, void *buf, size_t nbyte)
 {
-    if ((size_t)fsread(inode, buf, nbyte) != nbyte) {
+    ssize_t rv;
+
+    if ((size_t)(rv = fsread(inode, buf, nbyte)) != nbyte) {
 	printf("Invalid %s\r\n", "sector");
 	return -1;
     }
@@ -215,6 +218,7 @@
 
     /* Present the user with the boot2 prompt. */
 
+    p_strcpy(kname, PATH_KERNEL);
     for (;;) {
 	if (!autoboot || !OPT_CHECK(RBX_QUIET))
 	    printf("\r\nFreeBSD/arm boot\r\n"
@@ -237,7 +241,9 @@
 {
     Elf32_Ehdr eh;
     static Elf32_Phdr ep[2];
+#if 0
     static Elf32_Shdr es[2];
+#endif
     caddr_t p;
     ino_t ino;
     uint32_t addr;
@@ -267,13 +273,21 @@
 	if (xfsread(ino, p, ep[i].p_filesz))
 	    return;
     }
+#if 0
+    printf("3\n");
     p += roundup2(ep[1].p_memsz, PAGE_SIZE);
     if (eh.e_shnum == eh.e_shstrndx + 3) {
+	printf("4\n");
 	fs_off = eh.e_shoff + sizeof(es[0]) *
 	  (eh.e_shstrndx + 1);
-	if (xfsread(ino, &es, sizeof(es)))
+	printf("5\n");
+	if (xfsread(ino, &es, sizeof(es))) {
+	    printf("5a\n");
 	    return;
+	}
+	printf("6\n");
 	for (i = 0; i < 2; i++) {
+	    printf("6.%d\n", i);
 	    memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size));
 	    p += sizeof(es[i].sh_size);
 	    fs_off = es[i].sh_offset;
@@ -282,7 +296,9 @@
 	    p += es[i].sh_size;
 	}
     }
+#endif
     addr = eh.e_entry;
+    printf("In 5, 4, 3, 2, 1\n");
     ((void(*)(int))addr)(RB_BOOTINFO | (opts & RBX_MASK));
 }
 


More information about the p4-projects mailing list