From owner-p4-projects@FreeBSD.ORG Tue Sep 5 22:07:11 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D935716A4E7; Tue, 5 Sep 2006 22:07:10 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D22D16A4DD for ; Tue, 5 Sep 2006 22:07:10 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB64243D60 for ; Tue, 5 Sep 2006 22:07:09 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k85M79fx019171 for ; Tue, 5 Sep 2006 22:07:09 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k85M79cg019168 for perforce@freebsd.org; Tue, 5 Sep 2006 22:07:09 GMT (envelope-from imp@freebsd.org) Date: Tue, 5 Sep 2006 22:07:09 GMT Message-Id: <200609052207.k85M79cg019168@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 105702 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2006 22:07:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=105702 Change 105702 by imp@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)); }