From owner-p4-projects@FreeBSD.ORG Mon Feb 18 00:41:22 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E17CD1DC; Mon, 18 Feb 2013 00:41:21 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A52121DA for ; Mon, 18 Feb 2013 00:41:21 +0000 (UTC) (envelope-from pjd@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96B5DB8 for ; Mon, 18 Feb 2013 00:41:21 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.6/8.14.6) with ESMTP id r1I0fLTj071955 for ; Mon, 18 Feb 2013 00:41:21 GMT (envelope-from pjd@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.6/8.14.6/Submit) id r1I0fLKr071952 for perforce@freebsd.org; Mon, 18 Feb 2013 00:41:21 GMT (envelope-from pjd@freebsd.org) Date: Mon, 18 Feb 2013 00:41:21 GMT Message-Id: <201302180041.r1I0fLKr071952@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to pjd@freebsd.org using -f From: Pawel Jakub Dawidek Subject: PERFORCE change 222155 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2013 00:41:22 -0000 http://p4web.freebsd.org/@@222155?ac=10 Change 222155 by pjd@pjd_anger on 2013/02/18 00:40:33 Allow [] in remote address, which fixes IPv6 support. Reported by: simon Affected files ... .. //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#3 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#3 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#2 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#3 $ */ #include @@ -74,7 +74,7 @@ source { DP; return SOURCE; } timeout { DP; return TIMEOUT; } [0-9]+ { DP; yylval.num = atoi(yytext); return NUM; } -\"[a-zA-Z0-9_/ !@#\$%\^\&\*\(\)\+\=\|\;\?\,\.\-\:]*\" { DP; yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } +\"[a-zA-Z0-9_/ !@#\$%\^\&\*\(\)\+\=\|\;\?\,\.\[\]\-\:]*\" { DP; yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } \{ { DP; depth++; return OB; } \} { DP; depth--; return CB; } #.*$ /* ignore comments */; From owner-p4-projects@FreeBSD.ORG Mon Feb 18 00:51:33 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 41C1438A; Mon, 18 Feb 2013 00:51:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 05004388 for ; Mon, 18 Feb 2013 00:51:33 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) by mx1.freebsd.org (Postfix) with ESMTP id CCDD2F7 for ; Mon, 18 Feb 2013 00:51:32 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.6/8.14.6) with ESMTP id r1I0pWEs072819 for ; Mon, 18 Feb 2013 00:51:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.6/8.14.6/Submit) id r1I0pW3J072816 for perforce@freebsd.org; Mon, 18 Feb 2013 00:51:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 18 Feb 2013 00:51:32 GMT Message-Id: <201302180051.r1I0pW3J072816@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 222156 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2013 00:51:33 -0000 http://p4web.freebsd.org/@@222156?ac=10 Change 222156 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/02/18 00:50:36 Checkpoint an adaptation of the ARM at91 version of boot2 for use on the FreeBSD/BERI MIPS platform, including support for Intel StrataFlash-originated boot2 parts (which must self-relocate to DRAM before getting too far), and an Altera JTAG UART. Some elements of this work (e.g., the "boot:" prompt) and others don't (UFS-embedded kernel loading from the on-board flash, SD card kernel loading). Among other things, this required making the ARM-derived code 64-bit safe. Some further refinement, especially SD support, is still required. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/common/util.c#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/Makefile#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/altera_jtag_uart.c#1 add .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/boot2.c#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/cons.h#1 add .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/drv.h#1 add .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/flash.c#1 add .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/linker.cfg#1 add .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/mips.h#1 add .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/start.s#1 add Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/common/util.c#3 (text+ko) ==== @@ -125,7 +125,15 @@ va_start(ap, fmt); while ((c = *fmt++) != '\0') { - if (c != '%') { + switch (c) { + case '%': + break; + + case '\n': + putchar('\r'); + /* FALLTHROUGH */ + + default: putchar(c); continue; } ==== //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/Makefile#2 (text+ko) ==== @@ -1,15 +1,37 @@ # $FreeBSD$ -P=boot2 -FILES=${P} -SRCS=mips_init.S boot2.c beri_board.c +PROG= boot2 +BINDIR?= /boot +INSTALLFLAGS= -b + +FILES= ${PROG} +SRCS= start.s \ + boot2.c \ + altera_jtag_uart.c \ + flash.c + NO_MAN= -LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} + +AFLAGS= -G0 + +CFLAGS= -ffreestanding \ + -I${.CURDIR} \ + -I${.CURDIR}/../../../common \ + -I${.CURDIR}/../../../.. \ + -D_KERNEL \ + -Wall \ + -G0 -Xassembler -G0 \ + -fno-pic -mno-abicalls + +LDFLAGS= -nostdlib \ + -static \ + -N \ + -T linker.cfg \ + -G0 + +boot2: linker.cfg + +boot2.img: boot2 + objcopy -S -O binary boot2 boot2.img .include - -CFLAGS+= \ - -I${.CURDIR}/../../../common \ - -I${.CURDIR}/../../../.. \ - -D_KERNEL ==== //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/boot2.c#2 (text+ko) ==== @@ -1,4 +1,32 @@ /*- + * Copyright (c) 2013 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * Copyright (c) 2008 John Hay * Copyright (c) 2006 Warner Losh * Copyright (c) 1998 Robert Nordier @@ -28,8 +56,11 @@ #include -#include "lib.h" -#include "board.h" +#include "cons.h" +#include "drv.h" + +//#include "lib.h" +//#include "board.h" #define RBX_ASKNAME 0x0 /* -a */ #define RBX_SINGLE 0x1 /* -s */ @@ -66,8 +97,7 @@ #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" -//#define PATH_KERNEL "/boot/kernel/kernel" -#define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" +#define PATH_KERNEL "/boot/kernel/kernel" extern uint32_t _end; @@ -100,9 +130,12 @@ static void fixup_boot_drv(caddr_t, int, int, int); #endif +#include "util.c" #define UFS_SMALL_CGBASE #include "ufsread.c" +static struct dmadat __dmadat; + #ifdef DEBUG #define DPRINTF(fmt, ...) printf(fmt, __VA_ARGS__) #else @@ -143,7 +176,7 @@ default: if (s - cmd < sizeof(cmd) - 1) *s++ = c; - xputchar(c); + putchar(c); } c = getc(10000); } @@ -155,8 +188,8 @@ int autoboot, c = 0; ufs_ino_t ino; - dmadat = (void *)(0x20000000 + (16 << 20)); - board_init(); + dmadat = &__dmadat; + //board_init(); autoboot = 1; @@ -182,11 +215,11 @@ if (!autoboot || (OPT_CHECK(RBX_NOINTR) == 0 && (c = getc(2)) != 0)) getstr(c); - xputchar('\n'); + putchar('\n'); autoboot = 0; c = 0; if (parse()) - xputchar('\a'); + putchar('\a'); else load(); } @@ -195,11 +228,11 @@ static void load(void) { - Elf32_Ehdr eh; - static Elf32_Phdr ep[2]; + Elf64_Ehdr eh; + static Elf64_Phdr ep[2]; caddr_t p; ufs_ino_t ino; - uint32_t addr; + uint64_t addr; int i, j; #ifdef FIXUP_BOOT_DRV caddr_t staddr; From owner-p4-projects@FreeBSD.ORG Mon Feb 18 22:45:18 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 99EA6268; Mon, 18 Feb 2013 22:45:18 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 57258266 for ; Mon, 18 Feb 2013 22:45:18 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2CE3CB41 for ; Mon, 18 Feb 2013 22:45:18 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.6/8.14.6) with ESMTP id r1IMjHpI000792 for ; Mon, 18 Feb 2013 22:45:17 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.6/8.14.6/Submit) id r1IMjHMY000789 for perforce@freebsd.org; Mon, 18 Feb 2013 22:45:17 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 18 Feb 2013 22:45:17 GMT Message-Id: <201302182245.r1IMjHMY000789@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 222172 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2013 22:45:18 -0000 http://p4web.freebsd.org/@@222172?ac=10 Change 222172 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/02/18 22:45:12 Don't assume that the Intel StrataFlash has an MBR-based partition table on it -- for now, we'll just drop the UFS file system directly into our bootfs region. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/boot2.c#3 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/boot2.c#3 (text+ko) ==== @@ -215,7 +215,7 @@ if (!autoboot || (OPT_CHECK(RBX_NOINTR) == 0 && (c = getc(2)) != 0)) getstr(c); - putchar('\n'); + printf("\n"); autoboot = 0; c = 0; if (parse()) @@ -314,6 +314,7 @@ static int dskread(void *buf, unsigned lba, unsigned nblk) { +#if 0 struct dos_partition *dp; struct disklabel *d; char *sec; @@ -354,6 +355,7 @@ dsk_start -= d->d_partitions[RAW_PART].p_offset; dsk_meta++; } +#endif return drvread(buf, dsk_start + lba, nblk); } From owner-p4-projects@FreeBSD.ORG Tue Feb 19 13:41:54 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9EA86D55; Tue, 19 Feb 2013 13:41:54 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 62470D53 for ; Tue, 19 Feb 2013 13:41:54 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37CB3DF3 for ; Tue, 19 Feb 2013 13:41:54 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.6/8.14.6) with ESMTP id r1JDfsAT088632 for ; Tue, 19 Feb 2013 13:41:54 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.6/8.14.6/Submit) id r1JDfseo088629 for perforce@freebsd.org; Tue, 19 Feb 2013 13:41:54 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 19 Feb 2013 13:41:54 GMT Message-Id: <201302191341.r1JDfseo088629@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 222191 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 13:41:55 -0000 http://p4web.freebsd.org/@@222191?ac=10 Change 222191 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/02/19 13:40:54 Compile boot2 with debugging symbols ... for the time bring. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/Makefile#3 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/boot2/Makefile#3 (text+ko) ==== @@ -21,7 +21,8 @@ -D_KERNEL \ -Wall \ -G0 -Xassembler -G0 \ - -fno-pic -mno-abicalls + -fno-pic -mno-abicalls \ + -g LDFLAGS= -nostdlib \ -static \